From 7d66bf7870f3178e174883a0099134c034898d77 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 21 Mar 2024 15:00:07 -0400 Subject: [PATCH 01/77] add other stuff --- packages/pigeon/CHANGELOG.md | 4 + packages/pigeon/lib/ast.dart | 6 + packages/pigeon/lib/generator_tools.dart | 9 +- packages/pigeon/lib/kotlin/templates.dart | 347 ++++++++++++++++++ packages/pigeon/lib/pigeon.dart | 2 +- packages/pigeon/lib/pigeon_lib.dart | 17 +- .../lib/generated.dart | 2 + .../kotlin/com/example/test_plugin/.gitignore | 4 +- .../com/example/test_plugin/TestPlugin.kt | 7 + .../test_plugin/InstanceManagerTest.kt | 129 +++++++ packages/pigeon/pubspec.yaml | 3 +- script/configs/allowed_unpinned_deps.yaml | 1 + 12 files changed, 526 insertions(+), 5 deletions(-) create mode 100644 packages/pigeon/lib/kotlin/templates.dart create mode 100644 packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/InstanceManagerTest.kt diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md index ea6cd9df5b55..7e9c46e85a94 100644 --- a/packages/pigeon/CHANGELOG.md +++ b/packages/pigeon/CHANGELOG.md @@ -1,3 +1,7 @@ +## 17.3.0 + +* [kotlin] Adds implementation for `@ProxyApi`. + ## 17.2.0 * [dart] Adds implementation for `@ProxyApi`. diff --git a/packages/pigeon/lib/ast.dart b/packages/pigeon/lib/ast.dart index bc4ec8c44777..26319e59d2d8 100644 --- a/packages/pigeon/lib/ast.dart +++ b/packages/pigeon/lib/ast.dart @@ -4,6 +4,7 @@ import 'package:collection/collection.dart' show ListEquality; import 'package:meta/meta.dart'; +import 'kotlin_generator.dart'; import 'pigeon_lib.dart'; typedef _ListEquals = bool Function(List, List); @@ -139,6 +140,7 @@ class AstProxyApi extends Api { required this.fields, this.superClass, this.interfaces = const {}, + this.kotlinOptions, }); /// List of constructors inside the API. @@ -153,6 +155,10 @@ class AstProxyApi extends Api { /// Name of the classes this class considers to be implemented. Set interfaces; + /// Options that control how Kotlin code will be generated for a specific + /// ProxyApi. + final KotlinProxyApiOptions? kotlinOptions; + /// Methods implemented in the host platform language. Iterable get hostMethods => methods.where( (Method method) => method.location == ApiLocation.host, diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index 66dd99750f34..223ada1768b5 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -13,7 +13,7 @@ import 'ast.dart'; /// The current version of pigeon. /// /// This must match the version in pubspec.yaml. -const String pigeonVersion = '17.2.0'; +const String pigeonVersion = '17.3.0'; /// Read all the content from [stdin] to a String. String readStdin() { @@ -301,6 +301,13 @@ const String seeAlsoWarning = 'See also: https://pub.dev/packages/pigeon'; /// parameters. const String classNamePrefix = 'Pigeon'; +/// Prefix for apis generated for ProxyApi. +/// +/// Since ProxyApis are intended to wrap a class and will often share the name +/// of said class, host APIs should prefix the API with this protected name. +// TODO: -> platformProxyApiPrefix +const String hostApiPrefix = '${classNamePrefix}Api'; + /// Name for the generated InstanceManager for ProxyApis. /// /// This lowers the chances of variable name collisions with user defined diff --git a/packages/pigeon/lib/kotlin/templates.dart b/packages/pigeon/lib/kotlin/templates.dart new file mode 100644 index 000000000000..276ed9e284cc --- /dev/null +++ b/packages/pigeon/lib/kotlin/templates.dart @@ -0,0 +1,347 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import '../generator_tools.dart'; + +/// The Kotlin `InstanceManager`. +const String instanceManagerTemplate = ''' +/** + * Maintains instances used to communicate with the corresponding objects in Dart. + * + *

Objects stored in this container are represented by an object in Dart that is also stored in + * an InstanceManager with the same identifier. + * + *

When an instance is added with an identifier, either can be used to retrieve the other. + * + *

Added instances are added as a weak reference and a strong reference. When the strong + * reference is removed with [remove] and the weak reference is deallocated, the + * `finalizationListener` is made with the instance's identifier. However, if the strong reference + * is removed and then the identifier is retrieved with the intention to pass the identifier to Dart + * (e.g. calling [getIdentifierForStrongReference]), the strong reference to the + * instance is recreated. The strong reference will then need to be removed manually again. + */ +@Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate", "unused") +class $instanceManagerClassName(private val finalizationListener: $_finalizationListenerClassName) { + /** Interface for listening when a weak reference of an instance is removed from the manager. */ + interface $_finalizationListenerClassName { + fun onFinalize(identifier: Long) + } + + private val identifiers = java.util.WeakHashMap() + private val weakInstances = HashMap>() + private val strongInstances = HashMap() + private val referenceQueue = java.lang.ref.ReferenceQueue() + private val weakReferencesToIdentifiers = HashMap, Long>() + private val handler = android.os.Handler(android.os.Looper.getMainLooper()) + private var nextIdentifier: Long = minHostCreatedIdentifier + private var hasFinalizationListenerStopped = false + + init { + handler.postDelayed( + { releaseAllFinalizedInstances() }, + clearFinalizedWeakReferencesInterval + ) + } + + companion object { + // Identifiers are locked to a specific range to avoid collisions with objects + // created simultaneously from Dart. + // Host uses identifiers >= 2^16 and Dart is expected to use values n where, + // 0 <= n < 2^16. + private const val minHostCreatedIdentifier: Long = 65536 + private const val clearFinalizedWeakReferencesInterval: Long = 3000 + private const val tag = "$instanceManagerClassName" + + /** + * Instantiate a new manager. + * + * + * When the manager is no longer needed, [stopFinalizationListener] must be called. + * + * @param finalizationListener the listener for garbage collected weak references. + * @return a new `$instanceManagerClassName`. + */ + fun create(finalizationListener: $_finalizationListenerClassName): $instanceManagerClassName { + return $instanceManagerClassName(finalizationListener) + } + + /** + * Instantiate a new manager with an `$instanceManagerClassName`. + * + * @param api handles removing garbage collected weak references. + * @return a new `$instanceManagerClassName`. + */ + fun create(api: ${instanceManagerClassName}Api): $instanceManagerClassName { + val instanceManager = create( + object : $_finalizationListenerClassName { + override fun onFinalize(identifier: Long) { + api.removeStrongReference(identifier) { + if (it.isFailure) { + Log.e(tag, "Failed to remove Dart strong reference with identifier: \$identifier") + } + } + } + }) + $_instanceManagerApiName.setUpMessageHandlers(api.binaryMessenger, instanceManager) + return instanceManager + } + } + + /** + * Removes `identifier` and its associated strongly referenced instance, if present, from the + * manager. + * + * @param identifier the identifier paired to an instance. + * @param the expected return type. + * @return the removed instance if the manager contains the given identifier, otherwise `null` if + * the manager doesn't contain the value. + */ + fun remove(identifier: Long): T? { + logWarningIfFinalizationListenerHasStopped() + return strongInstances.remove(identifier) as T? + } + + /** + * Retrieves the identifier paired with an instance. + * + * + * If the manager contains a strong reference to `instance`, it will return the identifier + * associated with `instance`. If the manager contains only a weak reference to `instance`, a new + * strong reference to `instance` will be added and will need to be removed again with [remove]. + * + * + * If this method returns a nonnull identifier, this method also expects the Dart + * `$instanceManagerClassName` to have, or recreate, a weak reference to the Dart instance the + * identifier is associated with. + * + * @param instance an instance that may be stored in the manager. + * @return the identifier associated with `instance` if the manager contains the value, otherwise + * `null` if the manager doesn't contain the value. + */ + fun getIdentifierForStrongReference(instance: Any?): Long? { + logWarningIfFinalizationListenerHasStopped() + val identifier = identifiers[instance] + if (identifier != null) { + strongInstances[identifier] = instance!! + } + return identifier + } + + /** + * Adds a new instance that was instantiated from Dart. + * + * + * The same instance can be added multiple times, but each identifier must be unique. This + * allows two objects that are equivalent (e.g. the `equals` method returns true and their + * hashcodes are equal) to both be added. + * + * @param instance the instance to be stored. + * @param identifier the identifier to be paired with instance. This value must be >= 0 and + * unique. + */ + fun addDartCreatedInstance(instance: Any, identifier: Long) { + logWarningIfFinalizationListenerHasStopped() + addInstance(instance, identifier) + } + + /** + * Adds a new instance that was instantiated from the host platform. + * + * @param instance the instance to be stored. This must be unique to all other added instances. + * @return the unique identifier (>= 0) stored with instance. + */ + fun addHostCreatedInstance(instance: Any): Long { + logWarningIfFinalizationListenerHasStopped() + require(!containsInstance(instance)) { "Instance of \${instance.javaClass} has already been added." } + val identifier = nextIdentifier++ + addInstance(instance, identifier) + return identifier + } + + /** + * Retrieves the instance associated with identifier. + * + * @param identifier the identifier associated with an instance. + * @param the expected return type. + * @return the instance associated with `identifier` if the manager contains the value, otherwise + * `null` if the manager doesn't contain the value. + */ + fun getInstance(identifier: Long): T? { + logWarningIfFinalizationListenerHasStopped() + val instance = weakInstances[identifier] as java.lang.ref.WeakReference? + return instance?.get() + } + + /** + * Returns whether this manager contains the given `instance`. + * + * @param instance the instance whose presence in this manager is to be tested. + * @return whether this manager contains the given `instance`. + */ + fun containsInstance(instance: Any?): Boolean { + logWarningIfFinalizationListenerHasStopped() + return identifiers.containsKey(instance) + } + + /** + * Stop the periodic run of the [$_finalizationListenerClassName] for instances that have been garbage + * collected. + * + * + * The InstanceManager can continue to be used, but the [$_finalizationListenerClassName] will no + * longer be called and methods will log a warning. + */ + fun stopFinalizationListener() { + handler.removeCallbacks { this.releaseAllFinalizedInstances() } + hasFinalizationListenerStopped = true + } + + /** + * Removes all of the instances from this manager. + * + * + * The manager will be empty after this call returns. + */ + fun clear() { + identifiers.clear() + weakInstances.clear() + strongInstances.clear() + weakReferencesToIdentifiers.clear() + } + + /** + * Whether the [$_finalizationListenerClassName] is still being called for instances that are garbage + * collected. + * + * + * See [stopFinalizationListener]. + */ + fun hasFinalizationListenerStopped(): Boolean { + return hasFinalizationListenerStopped + } + + private fun releaseAllFinalizedInstances() { + if (hasFinalizationListenerStopped()) { + return + } + var reference: java.lang.ref.WeakReference? + while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != null) { + val identifier = weakReferencesToIdentifiers.remove(reference) + if (identifier != null) { + weakInstances.remove(identifier) + strongInstances.remove(identifier) + finalizationListener.onFinalize(identifier) + } + } + handler.postDelayed( + { releaseAllFinalizedInstances() }, + clearFinalizedWeakReferencesInterval + ) + } + + private fun addInstance(instance: Any, identifier: Long) { + require(identifier >= 0) { "Identifier must be >= 0: \$identifier" } + require(!weakInstances.containsKey(identifier)) { + "Identifier has already been added: \$identifier" + } + val weakReference = java.lang.ref.WeakReference(instance, referenceQueue) + identifiers[instance] = identifier + weakInstances[identifier] = weakReference + weakReferencesToIdentifiers[weakReference] = identifier + strongInstances[identifier] = instance + } + + private fun logWarningIfFinalizationListenerHasStopped() { + if (hasFinalizationListenerStopped()) { + Log.w( + tag, + "The manager was used after calls to the $_finalizationListenerClassName have been stopped." + ) + } + } +} +'''; + +/// Creates the `InstanceManagerApi` with the passed string values. +String instanceManagerApiTemplate({ + required String dartPackageName, + required String errorClassName, +}) { + final String removeStrongReferenceName = makeChannelNameWithStrings( + apiName: _instanceManagerApiName, + methodName: 'removeStrongReference', + dartPackageName: dartPackageName, + ); + final String clearName = makeChannelNameWithStrings( + apiName: _instanceManagerApiName, + methodName: 'clear', + dartPackageName: dartPackageName, + ); + return ''' +/** +* Generated API for managing the Dart and native `$instanceManagerClassName`s. +*/ +class $_instanceManagerApiName(internal val binaryMessenger: BinaryMessenger) { + companion object { + /** The codec used by $_instanceManagerApiName. */ + private val codec: MessageCodec by lazy { + StandardMessageCodec() + } + + /** + * Sets up an instance of `$_instanceManagerApiName` to handle messages from the + * `binaryMessenger`. + */ + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: $instanceManagerClassName) { + run { + val channel = BasicMessageChannel(binaryMessenger, "$removeStrongReferenceName", codec) + channel.setMessageHandler { message, reply -> + val identifier = message as Number + val wrapped: List = try { + instanceManager.remove(identifier.toLong()) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } + run { + val channel = BasicMessageChannel(binaryMessenger, "$clearName", codec) + channel.setMessageHandler { _, reply -> + val wrapped: List = try { + instanceManager.clear() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } + } + } + + fun removeStrongReference(identifier: Long, callback: (Result) -> Unit) { + val channelName = "$removeStrongReferenceName" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(identifier) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure($errorClassName(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } +} +'''; +} + +const String _instanceManagerApiName = '${instanceManagerClassName}Api'; + +const String _finalizationListenerClassName = + '${classNamePrefix}FinalizationListener'; diff --git a/packages/pigeon/lib/pigeon.dart b/packages/pigeon/lib/pigeon.dart index 7f2fb7505fa8..aa84da034c7c 100644 --- a/packages/pigeon/lib/pigeon.dart +++ b/packages/pigeon/lib/pigeon.dart @@ -7,7 +7,7 @@ export 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; export 'cpp_generator.dart' show CppOptions; export 'dart_generator.dart' show DartOptions; export 'java_generator.dart' show JavaOptions; -export 'kotlin_generator.dart' show KotlinOptions; +export 'kotlin_generator.dart' show KotlinOptions, KotlinProxyApiOptions; export 'objc_generator.dart' show ObjcOptions; export 'pigeon_lib.dart'; export 'swift_generator.dart' show SwiftOptions; diff --git a/packages/pigeon/lib/pigeon_lib.dart b/packages/pigeon/lib/pigeon_lib.dart index 8f418d042598..47d076870e2d 100644 --- a/packages/pigeon/lib/pigeon_lib.dart +++ b/packages/pigeon/lib/pigeon_lib.dart @@ -138,7 +138,7 @@ class FlutterApi { /// methods. class ProxyApi { /// Parametric constructor for [ProxyApi]. - const ProxyApi({this.superClass}); + const ProxyApi({this.superClass, this.kotlinOptions}); /// The proxy api that is a super class to this one. /// @@ -148,6 +148,10 @@ class ProxyApi { /// Note that using this instead of `extends` can cause unexpected conflicts /// with inherited method names. final Type? superClass; + + /// Options that control how Kotlin code will be generated for a specific + /// ProxyApi. + final KotlinProxyApiOptions? kotlinOptions; } /// Metadata to annotation methods to control the selector used for objc output. @@ -1535,6 +1539,16 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor { } } + KotlinProxyApiOptions? kotlinOptions; + final Map? kotlinOptionsMap = + annotationMap['kotlinOptions'] as Map?; + if (kotlinOptionsMap != null) { + kotlinOptions = KotlinProxyApiOptions( + fullClassName: kotlinOptionsMap['fullClassName']! as String, + minAndroidApi: kotlinOptionsMap['minAndroidApi'] as int?, + ); + } + _currentApi = AstProxyApi( name: node.name.lexeme, methods: [], @@ -1542,6 +1556,7 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor { fields: [], superClass: superClass, interfaces: interfaces, + kotlinOptions: kotlinOptions, documentationComments: _documentationCommentsParser(node.documentationComment?.tokens), ); diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/generated.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/generated.dart index 31aff33a3f36..b7861ee4d574 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/generated.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/generated.dart @@ -3,3 +3,5 @@ // found in the LICENSE file. export 'src/generated/core_tests.gen.dart'; +export 'src/generated/proxy_api_tests.gen.dart' + show ProxyApiSuperClass, ProxyApiTestClass, ProxyApiTestEnum; diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/.gitignore b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/.gitignore index a870aa16cae1..4ec9cb9997ad 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/.gitignore +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/.gitignore @@ -3,4 +3,6 @@ # such as a flag to suppress version stamp generation. *.kt !TestPlugin.kt -!CoreTests.gen.kt \ No newline at end of file +!CoreTests.gen.kt +!ProxyApiTestApiImpls.kt +!ProxyApiTests.gen.kt diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/TestPlugin.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/TestPlugin.kt index 8b4e8bc4fb18..a3fd8446e047 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/TestPlugin.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/TestPlugin.kt @@ -10,10 +10,17 @@ import io.flutter.embedding.engine.plugins.FlutterPlugin /** This plugin handles the native side of the integration tests in example/integration_test/. */ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { var flutterApi: FlutterIntegrationCoreApi? = null + private var instanceManager: PigeonInstanceManager? = null override fun onAttachedToEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { HostIntegrationCoreApi.setUp(binding.getBinaryMessenger(), this) flutterApi = FlutterIntegrationCoreApi(binding.getBinaryMessenger()) + + val instanceManagerApi = PigeonInstanceManagerApi(binding.binaryMessenger) + instanceManager = PigeonInstanceManager.create(instanceManagerApi) + + val codec = ProxyApiCodec(binding.binaryMessenger, instanceManager!!) + codec.setUpMessageHandlers() } override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {} diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/InstanceManagerTest.kt b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/InstanceManagerTest.kt new file mode 100644 index 000000000000..d1b9b783e28b --- /dev/null +++ b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/InstanceManagerTest.kt @@ -0,0 +1,129 @@ +// 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 com.example.test_plugin + +import junit.framework.TestCase.assertEquals +import junit.framework.TestCase.assertFalse +import junit.framework.TestCase.assertNotNull +import junit.framework.TestCase.assertNull +import junit.framework.TestCase.assertTrue +import org.junit.Test + +class InstanceManagerTest { + @Test + fun addDartCreatedInstance() { + val instanceManager: PigeonInstanceManager = createInstanceManager() + val testObject = Any() + instanceManager.addDartCreatedInstance(testObject, 0) + + assertEquals(testObject, instanceManager.getInstance(0)) + assertEquals(0L, instanceManager.getIdentifierForStrongReference(testObject)) + assertTrue(instanceManager.containsInstance(testObject)) + + instanceManager.stopFinalizationListener() + } + + @Test + fun addHostCreatedInstance() { + val instanceManager: PigeonInstanceManager = createInstanceManager() + val testObject = Any() + val identifier: Long = instanceManager.addHostCreatedInstance(testObject) + + assertNotNull(instanceManager.getInstance(identifier)) + assertEquals(testObject, instanceManager.getInstance(identifier)) + assertTrue(instanceManager.containsInstance(testObject)) + + instanceManager.stopFinalizationListener() + } + + @Test + fun remove() { + val instanceManager: PigeonInstanceManager = createInstanceManager() + var testObject: Any? = Any() + instanceManager.addDartCreatedInstance(testObject!!, 0) + assertEquals(testObject, instanceManager.remove(0)) + + // To allow for object to be garbage collected. + @Suppress("UNUSED_VALUE") + testObject = null + Runtime.getRuntime().gc() + assertNull(instanceManager.getInstance(0)) + + instanceManager.stopFinalizationListener() + } + + @Test + fun clear() { + val instanceManager: PigeonInstanceManager = createInstanceManager() + val instance = Any() + instanceManager.addDartCreatedInstance(instance, 0) + + assertTrue(instanceManager.containsInstance(instance)) + instanceManager.clear() + assertFalse(instanceManager.containsInstance(instance)) + + instanceManager.stopFinalizationListener() + } + + @Test + fun canAddSameObjectWithAddDartCreatedInstance() { + val instanceManager: PigeonInstanceManager = createInstanceManager() + val instance = Any() + instanceManager.addDartCreatedInstance(instance, 0) + instanceManager.addDartCreatedInstance(instance, 1) + + assertTrue(instanceManager.containsInstance(instance)) + assertEquals(instanceManager.getInstance(0), instance) + assertEquals(instanceManager.getInstance(1), instance) + + instanceManager.stopFinalizationListener() + } + + @Test(expected = IllegalArgumentException::class) + fun cannotAddSameObjectsWithAddHostCreatedInstance() { + val instanceManager: PigeonInstanceManager = createInstanceManager() + val instance = Any() + instanceManager.addHostCreatedInstance(instance) + instanceManager.addHostCreatedInstance(instance) + + instanceManager.stopFinalizationListener() + } + + @Test(expected = IllegalArgumentException::class) + fun cannotUseIdentifierLessThanZero() { + val instanceManager: PigeonInstanceManager = createInstanceManager() + instanceManager.addDartCreatedInstance(Any(), -1) + instanceManager.stopFinalizationListener() + } + + @Test(expected = IllegalArgumentException::class) + fun identifiersMustBeUnique() { + val instanceManager: PigeonInstanceManager = createInstanceManager() + instanceManager.addDartCreatedInstance(Any(), 0) + instanceManager.addDartCreatedInstance(Any(), 0) + + instanceManager.stopFinalizationListener() + } + + @Test + fun managerIsUsableWhileListenerHasStopped() { + val instanceManager: PigeonInstanceManager = createInstanceManager() + instanceManager.stopFinalizationListener() + val instance = Any() + val identifier: Long = 0 + instanceManager.addDartCreatedInstance(instance, identifier) + + assertEquals(instanceManager.getInstance(identifier), instance) + assertEquals(instanceManager.getIdentifierForStrongReference(instance), identifier) + assertTrue(instanceManager.containsInstance(instance)) + } + + private fun createInstanceManager(): PigeonInstanceManager { + return PigeonInstanceManager.create( + object : PigeonInstanceManager.PigeonFinalizationListener { + override fun onFinalize(identifier: Long) {} + }) + } +} diff --git a/packages/pigeon/pubspec.yaml b/packages/pigeon/pubspec.yaml index d5b579405d45..fef2b8e8574b 100644 --- a/packages/pigeon/pubspec.yaml +++ b/packages/pigeon/pubspec.yaml @@ -2,7 +2,7 @@ name: pigeon description: Code generator tool to make communication between Flutter and the host platform type-safe and easier. repository: https://github.com/flutter/packages/tree/main/packages/pigeon issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pigeon%22 -version: 17.2.0 # This must match the version in lib/generator_tools.dart +version: 17.3.0 # This must match the version in lib/generator_tools.dart environment: sdk: ^3.1.0 @@ -13,6 +13,7 @@ dependencies: code_builder: ^4.10.0 collection: ^1.15.0 dart_style: ^2.3.4 + graphs: ^2.3.1 meta: ^1.9.0 path: ^1.8.0 yaml: ^3.1.1 diff --git a/script/configs/allowed_unpinned_deps.yaml b/script/configs/allowed_unpinned_deps.yaml index 84ff94a1101b..5aab97d9a251 100644 --- a/script/configs/allowed_unpinned_deps.yaml +++ b/script/configs/allowed_unpinned_deps.yaml @@ -33,6 +33,7 @@ - fake_async - ffi - gcloud +- graphs - html - http - intl From d64d2a21657e6ae171c1b271a5183eb7d324eb91 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 21 Mar 2024 15:07:36 -0400 Subject: [PATCH 02/77] add partial generator code --- packages/pigeon/lib/generator_tools.dart | 3 +- packages/pigeon/lib/kotlin_generator.dart | 209 +++++++++++++++++- .../pigeon/test/kotlin/proxy_api_test.dart | 110 +++++++++ 3 files changed, 319 insertions(+), 3 deletions(-) create mode 100644 packages/pigeon/test/kotlin/proxy_api_test.dart diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index 223ada1768b5..dd42f74a98d7 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -305,8 +305,7 @@ const String classNamePrefix = 'Pigeon'; /// /// Since ProxyApis are intended to wrap a class and will often share the name /// of said class, host APIs should prefix the API with this protected name. -// TODO: -> platformProxyApiPrefix -const String hostApiPrefix = '${classNamePrefix}Api'; +const String hostProxyApiPrefix = '${classNamePrefix}Api'; /// Name for the generated InstanceManager for ProxyApis. /// diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 39697fa3242d..8c2fb29ad5ba 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -2,10 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:graphs/graphs.dart'; + import 'ast.dart'; import 'functional.dart'; import 'generator.dart'; import 'generator_tools.dart'; +import 'kotlin/templates.dart'; import 'pigeon_lib.dart' show TaskQueueType; /// Documentation open symbol. @@ -80,6 +83,26 @@ class KotlinOptions { } } +/// Options that control how Kotlin code will be generated for a specific +/// ProxyApi. +class KotlinProxyApiOptions { + /// Construct a [KotlinProxyApiOptions]. + const KotlinProxyApiOptions({ + required this.fullClassName, + this.minAndroidApi, + }); + + /// The name of the full runtime Kotlin class name (including the package). + final String fullClassName; + + /// The minimum Android api version. + /// + /// This adds the [RequiresApi](https://developer.android.com/reference/androidx/annotation/RequiresApi) + /// annotations on top of any constructor, field, or method that references + /// this element. + final int? minAndroidApi; +} + /// Class that manages all Kotlin code generation. class KotlinGenerator extends StructuredGenerator { /// Instantiates a Kotlin Generator. @@ -463,6 +486,179 @@ class KotlinGenerator extends StructuredGenerator { }); } + @override + void writeInstanceManager( + KotlinOptions generatorOptions, + Root root, + Indent indent, { + required String dartPackageName, + }) { + indent.format(instanceManagerTemplate); + } + + @override + void writeInstanceManagerApi( + KotlinOptions generatorOptions, + Root root, + Indent indent, { + required String dartPackageName, + }) { + indent.format(instanceManagerApiTemplate( + dartPackageName: dartPackageName, + errorClassName: _getErrorClassName(generatorOptions), + )); + } + + @override + void writeProxyApiBaseCodec( + KotlinOptions generatorOptions, + Root root, + Indent indent, + ) { + const String codecName = '${classNamePrefix}ProxyApiBaseCodec'; + + final Iterable allProxyApis = + root.apis.whereType(); + + // Sort APIs where edges are an API's super class and interfaces. + // + // This sorts the apis to have child classes be listed before their parent + // classes. This prevents the scenario where a method might return the super + // class of the actual class, so the incorrect Dart class gets created + // because the 'value is ' was checked first in the codec. For + // example: + // + // class Shape {} + // class Circle extends Shape {} + // + // class SomeClass { + // Shape giveMeAShape() => Circle(); + // } + final List sortedApis = topologicalSort( + allProxyApis, + (AstProxyApi api) { + final List edges = [ + if (api.superClass?.associatedProxyApi != null) + api.superClass!.associatedProxyApi!, + ...api.interfaces.map( + (TypeDeclaration interface) => interface.associatedProxyApi!, + ), + ]; + return edges; + }, + ); + + indent.writeScoped( + 'abstract class $codecName(val binaryMessenger: BinaryMessenger, val instanceManager: $instanceManagerClassName) : StandardMessageCodec() {', + '}', + () { + for (final AstProxyApi api in sortedApis) { + _writeMethodDeclaration( + indent, + name: 'get$hostProxyApiPrefix${api.name}', + isAbstract: true, + documentationComments: [ + 'An implementation of [$hostProxyApiPrefix${api.name}] used to add a new Dart instance of', + '`${api.name}` to the Dart `InstanceManager`.' + ], + returnType: TypeDeclaration( + baseName: '$hostProxyApiPrefix${api.name}', + isNullable: false, + ), + parameters: [], + ); + indent.newln(); + } + + indent.writeScoped('fun setUpMessageHandlers() {', '}', () { + for (final AstProxyApi api in sortedApis) { + final bool hasHostMessageCalls = api.constructors.isNotEmpty || + api.attachedFields.isNotEmpty || + api.hostMethods.isNotEmpty; + if (hasHostMessageCalls) { + indent.writeln( + '$hostProxyApiPrefix${api.name}.setUpMessageHandlers(binaryMessenger, get$hostProxyApiPrefix${api.name}())', + ); + } + } + }); + + indent.format( + 'override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? {\n' + ' return when (type) {\n' + ' 128.toByte() -> {\n' + ' return instanceManager.getInstance(\n' + ' readValue(buffer).let { if (it is Int) it.toLong() else it as Long })\n' + ' }\n' + ' else -> super.readValueOfType(type, buffer)\n' + ' }\n' + '}', + ); + indent.newln(); + + indent.writeScoped( + 'override fun writeValue(stream: ByteArrayOutputStream, value: Any?) {', + '}', + () { + enumerate( + sortedApis, + (int index, AstProxyApi api) { + final String className = + api.kotlinOptions?.fullClassName ?? api.name; + + final int? minApi = api.kotlinOptions?.minAndroidApi; + final String versionCheck = minApi != null + ? 'android.os.Build.VERSION.SDK_INT >= $minApi && ' + : ''; + + indent.format( + '${index > 0 ? ' else ' : ''}if (${versionCheck}value is $className) {\n' + ' get$hostProxyApiPrefix${api.name}().${classMemberNamePrefix}newInstance(value) { }\n' + '}', + ); + }, + ); + indent.newln(); + + indent.format( + 'when {\n' + ' instanceManager.containsInstance(value) -> {\n' + ' stream.write(128)\n' + ' writeValue(stream, instanceManager.getIdentifierForStrongReference(value))\n' + ' }\n' + ' else -> super.writeValue(stream, value)\n' + '}', + ); + }, + ); + }, + ); + } + + @override + void writeProxyApi( + KotlinOptions generatorOptions, + Root root, + Indent indent, + AstProxyApi api, { + required String dartPackageName, + }) { + const String codecName = '${classNamePrefix}ProxyApiBaseCodec'; + final String kotlinApiName = '$hostProxyApiPrefix${api.name}'; + + addDocumentationComments( + indent, + api.documentationComments, + _docCommentSpec, + ); + indent.writeln('@Suppress("UNCHECKED_CAST")'); + indent.writeScoped( + 'abstract class $kotlinApiName(val codec: $codecName) {', + '}', + () {}, + ); + } + /// Writes the codec class that will be used by [api]. /// Example: /// private static class FooCodec extends StandardMessageCodec {...} @@ -953,8 +1149,19 @@ String? _kotlinTypeForBuiltinDartType(TypeDeclaration type) { } } +String? _kotlinTypeForProxyApiType(TypeDeclaration type) { + if (type.isProxyApi) { + return type.associatedProxyApi!.kotlinOptions?.fullClassName ?? + type.associatedProxyApi!.name; + } + + return null; +} + String _kotlinTypeForDartType(TypeDeclaration type) { - return _kotlinTypeForBuiltinDartType(type) ?? type.baseName; + return _kotlinTypeForBuiltinDartType(type) ?? + _kotlinTypeForProxyApiType(type) ?? + type.baseName; } String _nullSafeKotlinTypeForDartType(TypeDeclaration type) { diff --git a/packages/pigeon/test/kotlin/proxy_api_test.dart b/packages/pigeon/test/kotlin/proxy_api_test.dart new file mode 100644 index 000000000000..836f64a3a15f --- /dev/null +++ b/packages/pigeon/test/kotlin/proxy_api_test.dart @@ -0,0 +1,110 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:pigeon/ast.dart'; +import 'package:pigeon/kotlin_generator.dart'; +import 'package:test/test.dart'; + +const String DEFAULT_PACKAGE_NAME = 'test_package'; + +void main() { + group('ProxyApi', () { + test('one api', () { + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + kotlinOptions: const KotlinProxyApiOptions( + fullClassName: 'my.library.Api', + ), + constructors: [ + Constructor( + name: 'name', + parameters: [ + Parameter( + type: const TypeDeclaration( + baseName: 'Input', + isNullable: false, + ), + name: 'input', + ), + ], + ), + ], + fields: [ + ApiField( + name: 'someField', + type: const TypeDeclaration( + baseName: 'int', + isNullable: false, + ), + ) + ], + methods: [ + Method( + name: 'doSomething', + location: ApiLocation.host, + parameters: [ + Parameter( + type: const TypeDeclaration( + baseName: 'Input', + isNullable: false, + ), + name: 'input', + ) + ], + returnType: const TypeDeclaration( + baseName: 'String', + isNullable: false, + ), + ), + Method( + name: 'doSomethingElse', + location: ApiLocation.flutter, + isRequired: false, + parameters: [ + Parameter( + type: const TypeDeclaration( + baseName: 'Input', + isNullable: false, + ), + name: 'input', + ), + ], + returnType: const TypeDeclaration( + baseName: 'String', + isNullable: false, + ), + ), + ], + ) + ], + classes: [], + enums: [], + ); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + + // Instance Manager + expect(code, contains(r'class PigeonInstanceManager')); + expect(code, contains(r'class PigeonInstanceManagerApi')); + + // Codec and class + expect(code, contains('class PigeonProxyApiBaseCodec')); + expect( + code, + contains( + r'abstract class PigeonApiApi(val codec: PigeonProxyApiBaseCodec)', + ), + ); + }); + }); +} From b64d723b1ac598b8d8f11cb80a4dc3152043437a Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 21 Mar 2024 15:08:43 -0400 Subject: [PATCH 03/77] add generated file --- .../example/test_plugin/ProxyApiTests.gen.kt | 430 ++++++++++++++++++ 1 file changed, 430 insertions(+) create mode 100644 packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt new file mode 100644 index 000000000000..2012b83adcf8 --- /dev/null +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -0,0 +1,430 @@ +// 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, do not edit directly. +// See also: https://pub.dev/packages/pigeon + +package com.example.test_plugin + +import android.util.Log +import io.flutter.plugin.common.BasicMessageChannel +import io.flutter.plugin.common.BinaryMessenger +import io.flutter.plugin.common.MessageCodec +import io.flutter.plugin.common.StandardMessageCodec +import java.io.ByteArrayOutputStream +import java.nio.ByteBuffer + +/** + * Error class for passing custom error details to Flutter via a thrown PlatformException. + * + * @property code The error code. + * @property message The error message. + * @property details The error details. Must be a datatype supported by the api codec. + */ +class ProxyApiTestsError( + val code: String, + override val message: String? = null, + val details: Any? = null +) : Throwable() +/** + * Maintains instances used to communicate with the corresponding objects in Dart. + * + *

Objects stored in this container are represented by an object in Dart that is also stored in + * an InstanceManager with the same identifier. + * + *

When an instance is added with an identifier, either can be used to retrieve the other. + * + *

Added instances are added as a weak reference and a strong reference. When the strong + * reference is removed with [remove] and the weak reference is deallocated, the + * `finalizationListener` is made with the instance's identifier. However, if the strong reference + * is removed and then the identifier is retrieved with the intention to pass the identifier to Dart + * (e.g. calling [getIdentifierForStrongReference]), the strong reference to the instance is + * recreated. The strong reference will then need to be removed manually again. + */ +@Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate", "unused") +class PigeonInstanceManager(private val finalizationListener: PigeonFinalizationListener) { + /** Interface for listening when a weak reference of an instance is removed from the manager. */ + interface PigeonFinalizationListener { + fun onFinalize(identifier: Long) + } + + private val identifiers = java.util.WeakHashMap() + private val weakInstances = HashMap>() + private val strongInstances = HashMap() + private val referenceQueue = java.lang.ref.ReferenceQueue() + private val weakReferencesToIdentifiers = HashMap, Long>() + private val handler = android.os.Handler(android.os.Looper.getMainLooper()) + private var nextIdentifier: Long = minHostCreatedIdentifier + private var hasFinalizationListenerStopped = false + + init { + handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) + } + + companion object { + // Identifiers are locked to a specific range to avoid collisions with objects + // created simultaneously from Dart. + // Host uses identifiers >= 2^16 and Dart is expected to use values n where, + // 0 <= n < 2^16. + private const val minHostCreatedIdentifier: Long = 65536 + private const val clearFinalizedWeakReferencesInterval: Long = 3000 + private const val tag = "PigeonInstanceManager" + + /** + * Instantiate a new manager. + * + * When the manager is no longer needed, [stopFinalizationListener] must be called. + * + * @param finalizationListener the listener for garbage collected weak references. + * @return a new `PigeonInstanceManager`. + */ + fun create(finalizationListener: PigeonFinalizationListener): PigeonInstanceManager { + return PigeonInstanceManager(finalizationListener) + } + + /** + * Instantiate a new manager with an `PigeonInstanceManager`. + * + * @param api handles removing garbage collected weak references. + * @return a new `PigeonInstanceManager`. + */ + fun create(api: PigeonInstanceManagerApi): PigeonInstanceManager { + val instanceManager = + create( + object : PigeonFinalizationListener { + override fun onFinalize(identifier: Long) { + api.removeStrongReference(identifier) { + if (it.isFailure) { + Log.e( + tag, + "Failed to remove Dart strong reference with identifier: $identifier") + } + } + } + }) + PigeonInstanceManagerApi.setUpMessageHandlers(api.binaryMessenger, instanceManager) + return instanceManager + } + } + + /** + * Removes `identifier` and its associated strongly referenced instance, if present, from the + * manager. + * + * @param identifier the identifier paired to an instance. + * @param the expected return type. + * @return the removed instance if the manager contains the given identifier, otherwise `null` if + * the manager doesn't contain the value. + */ + fun remove(identifier: Long): T? { + logWarningIfFinalizationListenerHasStopped() + return strongInstances.remove(identifier) as T? + } + + /** + * Retrieves the identifier paired with an instance. + * + * If the manager contains a strong reference to `instance`, it will return the identifier + * associated with `instance`. If the manager contains only a weak reference to `instance`, a new + * strong reference to `instance` will be added and will need to be removed again with [remove]. + * + * If this method returns a nonnull identifier, this method also expects the Dart + * `PigeonInstanceManager` to have, or recreate, a weak reference to the Dart instance the + * identifier is associated with. + * + * @param instance an instance that may be stored in the manager. + * @return the identifier associated with `instance` if the manager contains the value, otherwise + * `null` if the manager doesn't contain the value. + */ + fun getIdentifierForStrongReference(instance: Any?): Long? { + logWarningIfFinalizationListenerHasStopped() + val identifier = identifiers[instance] + if (identifier != null) { + strongInstances[identifier] = instance!! + } + return identifier + } + + /** + * Adds a new instance that was instantiated from Dart. + * + * The same instance can be added multiple times, but each identifier must be unique. This allows + * two objects that are equivalent (e.g. the `equals` method returns true and their hashcodes are + * equal) to both be added. + * + * @param instance the instance to be stored. + * @param identifier the identifier to be paired with instance. This value must be >= 0 and + * unique. + */ + fun addDartCreatedInstance(instance: Any, identifier: Long) { + logWarningIfFinalizationListenerHasStopped() + addInstance(instance, identifier) + } + + /** + * Adds a new instance that was instantiated from the host platform. + * + * @param instance the instance to be stored. This must be unique to all other added instances. + * @return the unique identifier (>= 0) stored with instance. + */ + fun addHostCreatedInstance(instance: Any): Long { + logWarningIfFinalizationListenerHasStopped() + require(!containsInstance(instance)) { + "Instance of ${instance.javaClass} has already been added." + } + val identifier = nextIdentifier++ + addInstance(instance, identifier) + return identifier + } + + /** + * Retrieves the instance associated with identifier. + * + * @param identifier the identifier associated with an instance. + * @param the expected return type. + * @return the instance associated with `identifier` if the manager contains the value, otherwise + * `null` if the manager doesn't contain the value. + */ + fun getInstance(identifier: Long): T? { + logWarningIfFinalizationListenerHasStopped() + val instance = weakInstances[identifier] as java.lang.ref.WeakReference? + return instance?.get() + } + + /** + * Returns whether this manager contains the given `instance`. + * + * @param instance the instance whose presence in this manager is to be tested. + * @return whether this manager contains the given `instance`. + */ + fun containsInstance(instance: Any?): Boolean { + logWarningIfFinalizationListenerHasStopped() + return identifiers.containsKey(instance) + } + + /** + * Stop the periodic run of the [PigeonFinalizationListener] for instances that have been garbage + * collected. + * + * The InstanceManager can continue to be used, but the [PigeonFinalizationListener] will no + * longer be called and methods will log a warning. + */ + fun stopFinalizationListener() { + handler.removeCallbacks { this.releaseAllFinalizedInstances() } + hasFinalizationListenerStopped = true + } + + /** + * Removes all of the instances from this manager. + * + * The manager will be empty after this call returns. + */ + fun clear() { + identifiers.clear() + weakInstances.clear() + strongInstances.clear() + weakReferencesToIdentifiers.clear() + } + + /** + * Whether the [PigeonFinalizationListener] is still being called for instances that are garbage + * collected. + * + * See [stopFinalizationListener]. + */ + fun hasFinalizationListenerStopped(): Boolean { + return hasFinalizationListenerStopped + } + + private fun releaseAllFinalizedInstances() { + if (hasFinalizationListenerStopped()) { + return + } + var reference: java.lang.ref.WeakReference? + while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != + null) { + val identifier = weakReferencesToIdentifiers.remove(reference) + if (identifier != null) { + weakInstances.remove(identifier) + strongInstances.remove(identifier) + finalizationListener.onFinalize(identifier) + } + } + handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) + } + + private fun addInstance(instance: Any, identifier: Long) { + require(identifier >= 0) { "Identifier must be >= 0: $identifier" } + require(!weakInstances.containsKey(identifier)) { + "Identifier has already been added: $identifier" + } + val weakReference = java.lang.ref.WeakReference(instance, referenceQueue) + identifiers[instance] = identifier + weakInstances[identifier] = weakReference + weakReferencesToIdentifiers[weakReference] = identifier + strongInstances[identifier] = instance + } + + private fun logWarningIfFinalizationListenerHasStopped() { + if (hasFinalizationListenerStopped()) { + Log.w( + tag, + "The manager was used after calls to the PigeonFinalizationListener have been stopped.") + } + } +} + +/** Generated API for managing the Dart and native `PigeonInstanceManager`s. */ +class PigeonInstanceManagerApi(internal val binaryMessenger: BinaryMessenger) { + companion object { + /** The codec used by PigeonInstanceManagerApi. */ + private val codec: MessageCodec by lazy { StandardMessageCodec() } + + /** + * Sets up an instance of `PigeonInstanceManagerApi` to handle messages from the + * `binaryMessenger`. + */ + fun setUpMessageHandlers( + binaryMessenger: BinaryMessenger, + instanceManager: PigeonInstanceManager + ) { + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.removeStrongReference", + codec) + channel.setMessageHandler { message, reply -> + val identifier = message as Number + val wrapped: List = + try { + instanceManager.remove(identifier.toLong()) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.clear", + codec) + channel.setMessageHandler { _, reply -> + val wrapped: List = + try { + instanceManager.clear() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } + } + } + + fun removeStrongReference(identifier: Long, callback: (Result) -> Unit) { + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.removeStrongReference" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(identifier) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(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 PigeonProxyApiBaseCodec( + val binaryMessenger: BinaryMessenger, + val instanceManager: PigeonInstanceManager +) : StandardMessageCodec() { + /** + * An implementation of [PigeonApiProxyApiTestClass] used to add a new Dart instance of + * `ProxyApiTestClass` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiProxyApiTestClass(): PigeonApiProxyApiTestClass + + /** + * An implementation of [PigeonApiProxyApiSuperClass] used to add a new Dart instance of + * `ProxyApiSuperClass` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass + + /** + * An implementation of [PigeonApiProxyApiInterface] used to add a new Dart instance of + * `ProxyApiInterface` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface + + fun setUpMessageHandlers() { + PigeonApiProxyApiTestClass.setUpMessageHandlers( + binaryMessenger, getPigeonApiProxyApiTestClass()) + PigeonApiProxyApiSuperClass.setUpMessageHandlers( + binaryMessenger, getPigeonApiProxyApiSuperClass()) + } + + override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { + return when (type) { + 128.toByte() -> { + return instanceManager.getInstance( + readValue(buffer).let { if (it is Int) it.toLong() else it as Long }) + } + else -> super.readValueOfType(type, buffer) + } + } + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + if (value is ProxyApiTestClass) { + getPigeonApiProxyApiTestClass().pigeon_newInstance(value) {} + } else if (value is ProxyApiSuperClass) { + getPigeonApiProxyApiSuperClass().pigeon_newInstance(value) {} + } else if (value is ProxyApiInterface) { + getPigeonApiProxyApiInterface().pigeon_newInstance(value) {} + } + + when { + instanceManager.containsInstance(value) -> { + stream.write(128) + writeValue(stream, instanceManager.getIdentifierForStrongReference(value)) + } + else -> super.writeValue(stream, value) + } + } +} + +enum class ProxyApiTestEnum(val raw: Int) { + ONE(0), + TWO(1), + THREE(2); + + companion object { + fun ofRaw(raw: Int): ProxyApiTestEnum? { + return values().firstOrNull { it.raw == raw } + } + } +} +/** + * The core ProxyApi test class that each supported host language must implement in platform_tests + * integration tests. + */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) {} +/** ProxyApi to serve as a super class to the core ProxyApi class. */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiProxyApiSuperClass(val codec: PigeonProxyApiBaseCodec) {} +/** ProxyApi to serve as an interface to the core ProxyApi class. */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiProxyApiInterface(val codec: PigeonProxyApiBaseCodec) {} From 89d3c927ceedd4f1166460836645bdbbfe107d8c Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 21 Mar 2024 15:23:42 -0400 Subject: [PATCH 04/77] finish additions --- packages/pigeon/lib/kotlin_generator.dart | 134 +++++++++++++++++- packages/pigeon/pigeons/proxy_api_tests.dart | 6 +- .../test_plugin/ProxyApiTestApiImpls.kt | 34 +++++ .../example/test_plugin/ProxyApiTests.gen.kt | 53 ++++++- 4 files changed, 219 insertions(+), 8 deletions(-) create mode 100644 packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 8c2fb29ad5ba..042ea9f586b7 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:math'; + import 'package:graphs/graphs.dart'; import 'ast.dart'; @@ -655,7 +657,43 @@ class KotlinGenerator extends StructuredGenerator { indent.writeScoped( 'abstract class $kotlinApiName(val codec: $codecName) {', '}', - () {}, + () { + final String fullKotlinClassName = + api.kotlinOptions?.fullClassName ?? api.name; + final TypeDeclaration apiAsTypeDeclaration = TypeDeclaration( + baseName: api.name, + isNullable: false, + associatedProxyApi: api, + ); + + if (api.constructors.isNotEmpty || + api.attachedFields.isNotEmpty || + api.hostMethods.isNotEmpty) { + indent.writeScoped('companion object {', '}', () { + _writeProxyApiMessageHandlerMethod( + indent, + api, + apiAsTypeDeclaration: apiAsTypeDeclaration, + kotlinApiName: kotlinApiName, + dartPackageName: dartPackageName, + fullKotlinClassName: fullKotlinClassName, + ); + }); + indent.newln(); + } + + const String newInstanceMethodName = + '${classMemberNamePrefix}newInstance'; + + _writeProxyApiNewInstanceMethod( + indent, + api, + generatorOptions: generatorOptions, + apiAsTypeDeclaration: apiAsTypeDeclaration, + newInstanceMethodName: newInstanceMethodName, + dartPackageName: dartPackageName, + ); + }, ); } @@ -784,12 +822,13 @@ class KotlinGenerator extends StructuredGenerator { final bool hasFlutterApi = root.apis .whereType() .any((Api api) => api.methods.isNotEmpty); + final bool hasProxyApi = root.apis.any((Api api) => api is AstProxyApi); - if (hasHostApi) { + if (hasHostApi || hasProxyApi) { _writeWrapResult(indent); _writeWrapError(generatorOptions, indent); } - if (hasFlutterApi) { + if (hasFlutterApi || hasProxyApi) { _writeCreateConnectionError(generatorOptions, indent); } if (generatorOptions.includeErrorClass) { @@ -1056,6 +1095,95 @@ class KotlinGenerator extends StructuredGenerator { }); }); } + + // Writes the `..setUpMessageHandler` method to ensure incoming messages are + // handled by the correct abstract host methods. + void _writeProxyApiMessageHandlerMethod( + Indent indent, + AstProxyApi api, { + required TypeDeclaration apiAsTypeDeclaration, + required String kotlinApiName, + required String dartPackageName, + required String fullKotlinClassName, + }) { + indent.writeln('@Suppress("LocalVariableName")'); + indent.writeScoped( + 'fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: $kotlinApiName?) {', + '}', + () {}, + ); + } + + // Writes the method that calls to Dart to instantiate a new Dart instance. + void _writeProxyApiNewInstanceMethod( + Indent indent, + AstProxyApi api, { + required KotlinOptions generatorOptions, + required TypeDeclaration apiAsTypeDeclaration, + required String newInstanceMethodName, + required String dartPackageName, + }) { + indent.writeln('@Suppress("LocalVariableName", "FunctionName")'); + _writeFlutterMethod( + indent, + generatorOptions: generatorOptions, + name: newInstanceMethodName, + returnType: const TypeDeclaration.voidDeclaration(), + documentationComments: [ + 'Creates a Dart instance of ${api.name} and attaches it to [${classMemberNamePrefix}instanceArg].', + ], + channelName: makeChannelNameWithStrings( + apiName: api.name, + methodName: newInstanceMethodName, + dartPackageName: dartPackageName, + ), + minApiRequirement: _typeWithHighestApiRequirement([ + apiAsTypeDeclaration, + ...api.unattachedFields.map((ApiField field) => field.type), + ])?.associatedProxyApi?.kotlinOptions?.minAndroidApi, + dartPackageName: dartPackageName, + parameters: [ + Parameter( + name: '${classMemberNamePrefix}instance', + type: TypeDeclaration( + baseName: api.name, + isNullable: false, + associatedProxyApi: api, + ), + ), + ], + onWriteBody: ( + Indent indent, { + required List parameters, + required TypeDeclaration returnType, + required String channelName, + required String errorClassName, + }) {}, + ); + indent.newln(); + } +} + +TypeDeclaration? _typeWithHighestApiRequirement( + Iterable types, +) { + int highestMin = 1; + TypeDeclaration? highestNamedType; + + for (final TypeDeclaration type in types) { + final int? typeMin = type.associatedProxyApi?.kotlinOptions?.minAndroidApi; + final int? typeArgumentMin = _typeWithHighestApiRequirement( + type.typeArguments, + )?.associatedProxyApi?.kotlinOptions?.minAndroidApi; + final int newMin = max(typeMin ?? 1, typeArgumentMin ?? 1); + + if (newMin > highestMin) { + highestMin = newMin; + highestNamedType = type; + } + } + + return highestMin == 1 ? null : highestNamedType; } HostDatatype _getHostDatatype(Root root, NamedType field) { diff --git a/packages/pigeon/pigeons/proxy_api_tests.dart b/packages/pigeon/pigeons/proxy_api_tests.dart index 699e5dfaed86..34407a63bb07 100644 --- a/packages/pigeon/pigeons/proxy_api_tests.dart +++ b/packages/pigeon/pigeons/proxy_api_tests.dart @@ -455,7 +455,11 @@ abstract class ProxyApiTestClass extends ProxyApiSuperClass } /// ProxyApi to serve as a super class to the core ProxyApi class. -@ProxyApi() +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions( + fullClassName: 'com.example.test_plugin.ProxyApiSuperClass', + ), +) abstract class ProxyApiSuperClass { ProxyApiSuperClass(); diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt new file mode 100644 index 000000000000..b42045ddd19b --- /dev/null +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt @@ -0,0 +1,34 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package com.example.test_plugin + +import io.flutter.plugin.common.BinaryMessenger + +class ProxyApiTestClass : ProxyApiSuperClass(), ProxyApiInterface + +open class ProxyApiSuperClass + +interface ProxyApiInterface + +class ProxyApiCodec(binaryMessenger: BinaryMessenger, instanceManager: PigeonInstanceManager) : + PigeonProxyApiBaseCodec(binaryMessenger, instanceManager) { + override fun getPigeonApiProxyApiTestClass(): PigeonApiProxyApiTestClass { + return ProxyApiTestClassApi(this) + } + + override fun getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass { + return ProxyApiSuperClassApi(this) + } + + override fun getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { + return ProxyApiInterfaceApi(this) + } +} + +class ProxyApiTestClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiTestClass(codec) + +class ProxyApiSuperClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiSuperClass(codec) + +class ProxyApiInterfaceApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiInterface(codec) diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 2012b83adcf8..63eb0c0f39bc 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -15,6 +15,26 @@ import io.flutter.plugin.common.StandardMessageCodec import java.io.ByteArrayOutputStream import java.nio.ByteBuffer +private fun wrapResult(result: Any?): List { + return listOf(result) +} + +private fun wrapError(exception: Throwable): List { + if (exception is ProxyApiTestsError) { + return listOf(exception.code, exception.message, exception.details) + } else { + return listOf( + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)) + } +} + +private fun createConnectionError(channelName: String): ProxyApiTestsError { + return ProxyApiTestsError( + "channel-error", "Unable to establish connection on channel: '$channelName'.", "") +} + /** * Error class for passing custom error details to Flutter via a thrown PlatformException. * @@ -389,7 +409,7 @@ abstract class PigeonProxyApiBaseCodec( override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { if (value is ProxyApiTestClass) { getPigeonApiProxyApiTestClass().pigeon_newInstance(value) {} - } else if (value is ProxyApiSuperClass) { + } else if (value is com.example.test_plugin.ProxyApiSuperClass) { getPigeonApiProxyApiSuperClass().pigeon_newInstance(value) {} } else if (value is ProxyApiInterface) { getPigeonApiProxyApiInterface().pigeon_newInstance(value) {} @@ -421,10 +441,35 @@ enum class ProxyApiTestEnum(val raw: Int) { * integration tests. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) {} +abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiTestClass?) {} + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of ProxyApiTestClass and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) {} +} /** ProxyApi to serve as a super class to the core ProxyApi class. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiSuperClass(val codec: PigeonProxyApiBaseCodec) {} +abstract class PigeonApiProxyApiSuperClass(val codec: PigeonProxyApiBaseCodec) { + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiSuperClass?) {} + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of ProxyApiSuperClass and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: com.example.test_plugin.ProxyApiSuperClass, + callback: (Result) -> Unit + ) {} +} /** ProxyApi to serve as an interface to the core ProxyApi class. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiInterface(val codec: PigeonProxyApiBaseCodec) {} +abstract class PigeonApiProxyApiInterface(val codec: PigeonProxyApiBaseCodec) { + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of ProxyApiInterface and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) {} +} From 1f7d0ad4d7e7805ead6b99dc1b2cc0a3dd5dafcd Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 21 Mar 2024 16:12:32 -0400 Subject: [PATCH 05/77] some fixes --- packages/pigeon/CHANGELOG.md | 2 +- packages/pigeon/lib/kotlin/templates.dart | 2 +- packages/pigeon/lib/kotlin_generator.dart | 9 ++++----- .../kotlin/com/example/test_plugin/ProxyApiTests.gen.kt | 8 ++++---- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md index 7e9c46e85a94..01c47c7084f7 100644 --- a/packages/pigeon/CHANGELOG.md +++ b/packages/pigeon/CHANGELOG.md @@ -1,6 +1,6 @@ ## 17.3.0 -* [kotlin] Adds implementation for `@ProxyApi`. +* [kotlin] Adds skeleton implementation for `@ProxyApi`. ## 17.2.0 diff --git a/packages/pigeon/lib/kotlin/templates.dart b/packages/pigeon/lib/kotlin/templates.dart index 276ed9e284cc..c6ad81a6c159 100644 --- a/packages/pigeon/lib/kotlin/templates.dart +++ b/packages/pigeon/lib/kotlin/templates.dart @@ -256,7 +256,7 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization if (hasFinalizationListenerStopped()) { Log.w( tag, - "The manager was used after calls to the $_finalizationListenerClassName have been stopped." + "The manager was used after calls to the $_finalizationListenerClassName has been stopped." ) } } diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 042ea9f586b7..ae88ef035288 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -653,7 +653,9 @@ class KotlinGenerator extends StructuredGenerator { api.documentationComments, _docCommentSpec, ); - indent.writeln('@Suppress("UNCHECKED_CAST")'); + // TODO(bparrishMines): Remove "UNUSED_PARAMETER" once the full class implementation + // is added. + indent.writeln('@Suppress("UNCHECKED_CAST", "UNUSED_PARAMETER")'); indent.writeScoped( 'abstract class $kotlinApiName(val codec: $codecName) {', '}', @@ -682,15 +684,12 @@ class KotlinGenerator extends StructuredGenerator { indent.newln(); } - const String newInstanceMethodName = - '${classMemberNamePrefix}newInstance'; - _writeProxyApiNewInstanceMethod( indent, api, generatorOptions: generatorOptions, apiAsTypeDeclaration: apiAsTypeDeclaration, - newInstanceMethodName: newInstanceMethodName, + newInstanceMethodName: '${classMemberNamePrefix}newInstance', dartPackageName: dartPackageName, ); }, diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 63eb0c0f39bc..aa5a34ff572e 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -290,7 +290,7 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization if (hasFinalizationListenerStopped()) { Log.w( tag, - "The manager was used after calls to the PigeonFinalizationListener have been stopped.") + "The manager was used after calls to the PigeonFinalizationListener has been stopped.") } } } @@ -440,7 +440,7 @@ enum class ProxyApiTestEnum(val raw: Int) { * The core ProxyApi test class that each supported host language must implement in platform_tests * integration tests. */ -@Suppress("UNCHECKED_CAST") +@Suppress("UNCHECKED_CAST", "UNUSED_PARAMETER") abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { companion object { @Suppress("LocalVariableName") @@ -452,7 +452,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { fun pigeon_newInstance(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) {} } /** ProxyApi to serve as a super class to the core ProxyApi class. */ -@Suppress("UNCHECKED_CAST") +@Suppress("UNCHECKED_CAST", "UNUSED_PARAMETER") abstract class PigeonApiProxyApiSuperClass(val codec: PigeonProxyApiBaseCodec) { companion object { @Suppress("LocalVariableName") @@ -467,7 +467,7 @@ abstract class PigeonApiProxyApiSuperClass(val codec: PigeonProxyApiBaseCodec) { ) {} } /** ProxyApi to serve as an interface to the core ProxyApi class. */ -@Suppress("UNCHECKED_CAST") +@Suppress("UNCHECKED_CAST", "UNUSED_PARAMETER") abstract class PigeonApiProxyApiInterface(val codec: PigeonProxyApiBaseCodec) { @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ProxyApiInterface and attaches it to [pigeon_instanceArg]. */ From 2665c222f571d299b2a7e1efb83199187bb963b9 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 11 Apr 2024 12:19:00 -0400 Subject: [PATCH 06/77] add onWriteBody --- packages/pigeon/lib/kotlin_generator.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 196081dbbcdf..b7e1e4624db2 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -1004,6 +1004,13 @@ class KotlinGenerator extends StructuredGenerator { required String dartPackageName, List documentationComments = const [], int? minApiRequirement, + void Function( + Indent indent, { + required List parameters, + required TypeDeclaration returnType, + required String channelName, + required String errorClassName, + }) onWriteBody = _writeFlutterMethodMessageCall, }) { _writeMethodDeclaration( indent, @@ -1018,7 +1025,7 @@ class KotlinGenerator extends StructuredGenerator { final String errorClassName = _getErrorClassName(generatorOptions); indent.addScoped('{', '}', () { - _writeFlutterMethodMessageCall( + onWriteBody( indent, parameters: parameters, returnType: returnType, From cadf14cbe4c84fdc1f663541d5aff88f6a8571e3 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 15 Apr 2024 13:09:51 -0400 Subject: [PATCH 07/77] use a common method for api math --- packages/pigeon/lib/generator_tools.dart | 43 +++++++++++++++++++++++ packages/pigeon/lib/kotlin_generator.dart | 32 ++++++----------- 2 files changed, 53 insertions(+), 22 deletions(-) diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index 405928c00e66..3a6886de47c2 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -494,6 +494,49 @@ Map> getReferencedTypes( return references.map; } +/// Find the [TypeDeclaration] that has the highest api requirement and its +/// version, [T]. +/// +/// [T] depends on the language. For example, Android uses an int while iOS uses +/// semantic versioning. +({TypeDeclaration type, T version})? + findHighestApiRequirement( + Iterable types, { + required T? Function(TypeDeclaration) onGetApiRequirement, + required Comparator onCompare, +}) { + Iterable addAllRecursive(TypeDeclaration type) sync* { + yield type; + if (type.typeArguments.isNotEmpty) { + for (final TypeDeclaration typeArg in type.typeArguments) { + yield* addAllRecursive(typeArg); + } + } + } + + final Iterable allReferencedTypes = + types.expand(addAllRecursive); + + if (allReferencedTypes.isEmpty) { + return null; + } + + final TypeDeclaration typeWithHighestRequirement = allReferencedTypes + .where((TypeDeclaration type) => onGetApiRequirement(type) != null) + .reduce( + (TypeDeclaration one, TypeDeclaration two) { + return onCompare(onGetApiRequirement(one)!, onGetApiRequirement(two)!) > 0 + ? one + : two; + }, + ); + + return ( + type: typeWithHighestRequirement, + version: onGetApiRequirement(typeWithHighestRequirement)!, + ); +} + /// Returns true if the concrete type cannot be determined at compile-time. bool _isConcreteTypeAmbiguous(TypeDeclaration type) { return (type.baseName == 'List' && type.typeArguments.isEmpty) || diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index b7e1e4624db2..a5801ffc5e14 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:math'; - import 'package:graphs/graphs.dart'; import 'ast.dart'; @@ -1140,10 +1138,10 @@ class KotlinGenerator extends StructuredGenerator { methodName: newInstanceMethodName, dartPackageName: dartPackageName, ), - minApiRequirement: _typeWithHighestApiRequirement([ + minApiRequirement: _findAndroidHighestApiRequirement([ apiAsTypeDeclaration, ...api.unattachedFields.map((ApiField field) => field.type), - ])?.associatedProxyApi?.kotlinOptions?.minAndroidApi, + ])?.version, dartPackageName: dartPackageName, parameters: [ Parameter( @@ -1167,26 +1165,16 @@ class KotlinGenerator extends StructuredGenerator { } } -TypeDeclaration? _typeWithHighestApiRequirement( +({TypeDeclaration type, int version})? _findAndroidHighestApiRequirement( Iterable types, ) { - int highestMin = 1; - TypeDeclaration? highestNamedType; - - for (final TypeDeclaration type in types) { - final int? typeMin = type.associatedProxyApi?.kotlinOptions?.minAndroidApi; - final int? typeArgumentMin = _typeWithHighestApiRequirement( - type.typeArguments, - )?.associatedProxyApi?.kotlinOptions?.minAndroidApi; - final int newMin = max(typeMin ?? 1, typeArgumentMin ?? 1); - - if (newMin > highestMin) { - highestMin = newMin; - highestNamedType = type; - } - } - - return highestMin == 1 ? null : highestNamedType; + return findHighestApiRequirement( + types, + onGetApiRequirement: (TypeDeclaration type) { + return type.associatedProxyApi?.kotlinOptions?.minAndroidApi; + }, + onCompare: (int first, int second) => first.compareTo(second), + ); } HostDatatype _getHostDatatype(Root root, NamedType field) { From 6437fc9a5e4343cf3e20765e088bcfcbcc19cd6f Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 15 Apr 2024 13:33:38 -0400 Subject: [PATCH 08/77] add all stuff back --- packages/pigeon/lib/generator_tools.dart | 5 +- packages/pigeon/lib/kotlin_generator.dart | 475 ++- .../lib/integration_tests.dart | 729 ++++ .../test_plugin/ProxyApiTestApiImpls.kt | 656 +++- .../example/test_plugin/ProxyApiTests.gen.kt | 3482 ++++++++++++++++- .../pigeon/test/kotlin/proxy_api_test.dart | 821 ++++ 6 files changed, 6148 insertions(+), 20 deletions(-) diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index 3a6886de47c2..464a973a5631 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -514,8 +514,9 @@ Map> getReferencedTypes( } } - final Iterable allReferencedTypes = - types.expand(addAllRecursive); + final Iterable allReferencedTypes = types + .expand(addAllRecursive) + .where((TypeDeclaration type) => onGetApiRequirement(type) != null); if (allReferencedTypes.isEmpty) { return null; diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index a5801ffc5e14..2ac682b2ade9 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -653,21 +653,46 @@ class KotlinGenerator extends StructuredGenerator { api.documentationComments, _docCommentSpec, ); - // TODO(bparrishMines): Remove "UNUSED_PARAMETER" once the full class implementation - // is added. - indent.writeln('@Suppress("UNCHECKED_CAST", "UNUSED_PARAMETER")'); + indent.writeln('@Suppress("UNCHECKED_CAST")'); indent.writeScoped( 'abstract class $kotlinApiName(val codec: $codecName) {', '}', () { final String fullKotlinClassName = api.kotlinOptions?.fullClassName ?? api.name; + final TypeDeclaration apiAsTypeDeclaration = TypeDeclaration( baseName: api.name, isNullable: false, associatedProxyApi: api, ); + _writeProxyApiConstructorAbstractMethods( + indent, + api, + apiAsTypeDeclaration: apiAsTypeDeclaration, + ); + + _writeProxyApiAttachedFieldAbstractMethods( + indent, + api, + apiAsTypeDeclaration: apiAsTypeDeclaration, + ); + + if (api.hasCallbackConstructor()) { + _writeProxyApiUnattachedFieldAbstractMethods( + indent, + api, + apiAsTypeDeclaration: apiAsTypeDeclaration, + ); + } + + _writeProxyApiHostMethodAbstractMethods( + indent, + api, + apiAsTypeDeclaration: apiAsTypeDeclaration, + ); + if (api.constructors.isNotEmpty || api.attachedFields.isNotEmpty || api.hostMethods.isNotEmpty) { @@ -692,6 +717,16 @@ class KotlinGenerator extends StructuredGenerator { newInstanceMethodName: '${classMemberNamePrefix}newInstance', dartPackageName: dartPackageName, ); + + _writeProxyApiFlutterMethods( + indent, + api, + generatorOptions: generatorOptions, + apiAsTypeDeclaration: apiAsTypeDeclaration, + dartPackageName: dartPackageName, + ); + + _writeProxyApiInheritedApiMethods(indent, api); }, ); } @@ -1097,6 +1132,131 @@ class KotlinGenerator extends StructuredGenerator { }); } + // Writes the abstract method that instantiates a new instance of the Kotlin + // class. + void _writeProxyApiConstructorAbstractMethods( + Indent indent, + AstProxyApi api, { + required TypeDeclaration apiAsTypeDeclaration, + }) { + for (final Constructor constructor in api.constructors) { + _writeMethodDeclaration( + indent, + name: constructor.name.isNotEmpty + ? constructor.name + : '${classMemberNamePrefix}defaultConstructor', + returnType: apiAsTypeDeclaration, + documentationComments: constructor.documentationComments, + minApiRequirement: _findAndroidHighestApiRequirement([ + apiAsTypeDeclaration, + ...constructor.parameters.map( + (Parameter parameter) => parameter.type, + ), + ])?.version, + isAbstract: true, + parameters: [ + ...api.unattachedFields.map((ApiField field) { + return Parameter(name: field.name, type: field.type); + }), + ...constructor.parameters + ], + ); + indent.newln(); + } + } + + // Writes the abstract method that handles instantiating an attached field. + void _writeProxyApiAttachedFieldAbstractMethods( + Indent indent, + AstProxyApi api, { + required TypeDeclaration apiAsTypeDeclaration, + }) { + for (final ApiField field in api.attachedFields) { + _writeMethodDeclaration( + indent, + name: field.name, + documentationComments: field.documentationComments, + returnType: field.type, + isAbstract: true, + minApiRequirement: _findAndroidHighestApiRequirement([ + apiAsTypeDeclaration, + field.type, + ])?.version, + parameters: [ + if (!field.isStatic) + Parameter( + name: '${classMemberNamePrefix}instance', + type: apiAsTypeDeclaration, + ), + ], + ); + indent.newln(); + } + } + + // Writes the abstract method that handles accessing an unattached field. + void _writeProxyApiUnattachedFieldAbstractMethods( + Indent indent, + AstProxyApi api, { + required TypeDeclaration apiAsTypeDeclaration, + }) { + for (final ApiField field in api.unattachedFields) { + _writeMethodDeclaration( + indent, + name: field.name, + documentationComments: field.documentationComments, + returnType: field.type, + isAbstract: true, + minApiRequirement: _findAndroidHighestApiRequirement([ + apiAsTypeDeclaration, + field.type, + ])?.version, + parameters: [ + Parameter( + name: '${classMemberNamePrefix}instance', + type: apiAsTypeDeclaration, + ), + ], + ); + indent.newln(); + } + } + + // Writes the abstract method that handles making a call from for a host + // method. + void _writeProxyApiHostMethodAbstractMethods( + Indent indent, + AstProxyApi api, { + required TypeDeclaration apiAsTypeDeclaration, + }) { + for (final Method method in api.hostMethods) { + _writeMethodDeclaration( + indent, + name: method.name, + returnType: method.returnType, + documentationComments: method.documentationComments, + isAsynchronous: method.isAsynchronous, + isAbstract: true, + minApiRequirement: _findAndroidHighestApiRequirement( + [ + if (!method.isStatic) apiAsTypeDeclaration, + method.returnType, + ...method.parameters.map((Parameter p) => p.type), + ], + )?.version, + parameters: [ + if (!method.isStatic) + Parameter( + name: '${classMemberNamePrefix}instance', + type: apiAsTypeDeclaration, + ), + ...method.parameters, + ], + ); + indent.newln(); + } + } + // Writes the `..setUpMessageHandler` method to ensure incoming messages are // handled by the correct abstract host methods. void _writeProxyApiMessageHandlerMethod( @@ -1111,7 +1271,184 @@ class KotlinGenerator extends StructuredGenerator { indent.writeScoped( 'fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: $kotlinApiName?) {', '}', - () {}, + () { + indent.writeln( + 'val codec = api?.codec ?: StandardMessageCodec()', + ); + void writeWithApiCheckIfNecessary( + List types, { + required String channelName, + required void Function() onWrite, + }) { + final ({TypeDeclaration type, int version})? typeWithRequirement = + _findAndroidHighestApiRequirement(types); + if (typeWithRequirement != null) { + final int apiRequirement = typeWithRequirement.version; + indent.writeScoped( + 'if (android.os.Build.VERSION.SDK_INT >= $apiRequirement) {', + '}', + onWrite, + addTrailingNewline: false, + ); + indent.writeScoped(' else {', '}', () { + final String className = typeWithRequirement + .type.associatedProxyApi!.kotlinOptions?.fullClassName ?? + typeWithRequirement.type.baseName; + indent.format( + 'val channel = BasicMessageChannel(\n' + ' binaryMessenger,\n' + ' "$channelName",\n' + ' codec\n' + ')\n' + 'if (api != null) {\n' + ' channel.setMessageHandler { _, reply ->\n' + ' reply.reply(wrapError(\n' + ' UnsupportedOperationException(\n' + ' "Call references class `$className`, which requires api version $apiRequirement.")))\n' + ' }\n' + '} else {\n' + ' channel.setMessageHandler(null)\n' + '}', + ); + }); + } else { + onWrite(); + } + } + + for (final Constructor constructor in api.constructors) { + final String name = constructor.name.isNotEmpty + ? constructor.name + : '${classMemberNamePrefix}defaultConstructor'; + final String channelName = makeChannelNameWithStrings( + apiName: api.name, + methodName: name, + dartPackageName: dartPackageName, + ); + writeWithApiCheckIfNecessary( + [ + apiAsTypeDeclaration, + ...api.unattachedFields.map((ApiField f) => f.type), + ...constructor.parameters.map((Parameter p) => p.type), + ], + channelName: channelName, + onWrite: () { + _writeHostMethodMessageHandler( + indent, + api: api, + name: name, + channelName: channelName, + taskQueueType: TaskQueueType.serial, + returnType: const TypeDeclaration.voidDeclaration(), + onCreateCall: ( + List methodParameters, { + required String apiVarName, + }) { + return '$apiVarName.codec.instanceManager.addDartCreatedInstance(' + '$apiVarName.$name(${methodParameters.skip(1).join(',')}), ${methodParameters.first})'; + }, + parameters: [ + Parameter( + name: '${classMemberNamePrefix}identifier', + type: const TypeDeclaration( + baseName: 'int', + isNullable: false, + ), + ), + ...api.unattachedFields.map((ApiField field) { + return Parameter( + name: field.name, + type: field.type, + ); + }), + ...constructor.parameters, + ], + ); + }, + ); + } + + for (final ApiField field in api.attachedFields) { + final String channelName = makeChannelNameWithStrings( + apiName: api.name, + methodName: field.name, + dartPackageName: dartPackageName, + ); + writeWithApiCheckIfNecessary( + [apiAsTypeDeclaration, field.type], + channelName: channelName, + onWrite: () { + _writeHostMethodMessageHandler( + indent, + api: api, + name: field.name, + channelName: channelName, + taskQueueType: TaskQueueType.serial, + returnType: const TypeDeclaration.voidDeclaration(), + onCreateCall: ( + List methodParameters, { + required String apiVarName, + }) { + final String param = + methodParameters.length > 1 ? methodParameters.first : ''; + return '$apiVarName.codec.instanceManager.addDartCreatedInstance(' + '$apiVarName.${field.name}($param), ${methodParameters.last})'; + }, + parameters: [ + if (!field.isStatic) + Parameter( + name: '${classMemberNamePrefix}instance', + type: apiAsTypeDeclaration, + ), + Parameter( + name: '${classMemberNamePrefix}identifier', + type: const TypeDeclaration( + baseName: 'int', + isNullable: false, + ), + ), + ], + ); + }, + ); + } + + for (final Method method in api.hostMethods) { + final String channelName = + makeChannelName(api, method, dartPackageName); + writeWithApiCheckIfNecessary( + [ + if (!method.isStatic) apiAsTypeDeclaration, + method.returnType, + ...method.parameters.map((Parameter p) => p.type), + ], + channelName: channelName, + onWrite: () { + _writeHostMethodMessageHandler( + indent, + api: api, + name: method.name, + channelName: makeChannelName(api, method, dartPackageName), + taskQueueType: method.taskQueueType, + returnType: method.returnType, + isAsynchronous: method.isAsynchronous, + parameters: [ + if (!method.isStatic) + Parameter( + name: '${classMemberNamePrefix}instance', + type: TypeDeclaration( + baseName: fullKotlinClassName, + isNullable: false, + associatedProxyApi: api, + ), + ), + ...method.parameters, + ], + ); + }, + ); + } + }, ); } @@ -1159,10 +1496,138 @@ class KotlinGenerator extends StructuredGenerator { required TypeDeclaration returnType, required String channelName, required String errorClassName, - }) {}, + }) { + indent.writeScoped( + 'if (codec.instanceManager.containsInstance(${classMemberNamePrefix}instanceArg)) {', + '}', + () { + indent.writeln('Result.success(Unit)'); + indent.writeln('return'); + }, + ); + if (api.hasCallbackConstructor()) { + indent.writeln( + 'val ${classMemberNamePrefix}identifierArg = codec.instanceManager.addHostCreatedInstance(${classMemberNamePrefix}instanceArg)', + ); + enumerate(api.unattachedFields, (int index, ApiField field) { + final String argName = _getSafeArgumentName(index, field); + indent.writeln( + 'val $argName = ${field.name}(${classMemberNamePrefix}instanceArg)', + ); + }); + + indent.writeln('val binaryMessenger = codec.binaryMessenger'); + _writeFlutterMethodMessageCall( + indent, + returnType: returnType, + channelName: channelName, + errorClassName: errorClassName, + parameters: [ + Parameter( + name: '${classMemberNamePrefix}identifier', + type: const TypeDeclaration( + baseName: 'int', + isNullable: false, + ), + ), + ...api.unattachedFields.map( + (ApiField field) { + return Parameter(name: field.name, type: field.type); + }, + ), + ], + ); + } else { + indent.writeln( + 'throw IllegalStateException("Attempting to create a new Dart instance of ${api.name}, but the class has a nonnull callback method.")', + ); + } + }, ); indent.newln(); } + + // Writes the Flutter methods that call back to Dart. + void _writeProxyApiFlutterMethods( + Indent indent, + AstProxyApi api, { + required KotlinOptions generatorOptions, + required TypeDeclaration apiAsTypeDeclaration, + required String dartPackageName, + }) { + for (final Method method in api.flutterMethods) { + _writeFlutterMethod( + indent, + generatorOptions: generatorOptions, + name: method.name, + returnType: method.returnType, + channelName: makeChannelName(api, method, dartPackageName), + dartPackageName: dartPackageName, + documentationComments: method.documentationComments, + minApiRequirement: _findAndroidHighestApiRequirement([ + apiAsTypeDeclaration, + method.returnType, + ...method.parameters.map((Parameter parameter) => parameter.type), + ])?.version, + parameters: [ + Parameter( + name: '${classMemberNamePrefix}instance', + type: TypeDeclaration( + baseName: api.name, + isNullable: false, + associatedProxyApi: api, + ), + ), + ...method.parameters, + ], + onWriteBody: ( + Indent indent, { + required List parameters, + required TypeDeclaration returnType, + required String channelName, + required String errorClassName, + }) { + indent.writeln('val binaryMessenger = codec.binaryMessenger'); + _writeFlutterMethodMessageCall( + indent, + returnType: returnType, + channelName: channelName, + errorClassName: errorClassName, + parameters: parameters, + ); + }, + ); + indent.newln(); + } + } + + // Writes the getters for accessing the implementation of other ProxyApis. + // + // These are used for inherited Flutter methods. + void _writeProxyApiInheritedApiMethods(Indent indent, AstProxyApi api) { + final Set inheritedApiNames = { + if (api.superClass != null) api.superClass!.baseName, + ...api.interfaces.map((TypeDeclaration type) => type.baseName), + }; + for (final String name in inheritedApiNames) { + indent.writeln('@Suppress("FunctionName")'); + final String apiName = '$hostProxyApiPrefix$name'; + _writeMethodDeclaration( + indent, + name: '${classMemberNamePrefix}get$apiName', + documentationComments: [ + 'An implementation of [$apiName] used to access callback methods', + ], + returnType: TypeDeclaration(baseName: apiName, isNullable: false), + parameters: [], + ); + + indent.writeScoped('{', '}', () { + indent.writeln('return codec.get$apiName()'); + }); + indent.newln(); + } + } } ({TypeDeclaration type, int version})? _findAndroidHighestApiRequirement( diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart index caa448cac366..4a44b8bb53ec 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart @@ -1779,6 +1779,596 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { }); }); + group('Proxy API Tests', () { + if (targetGenerator != TargetGenerator.kotlin) { + return; + } + + testWidgets('noop', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + await expectLater(api.noop(), completes); + }); + + testWidgets('throwError', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + await expectLater( + () => api.throwError(), + throwsA(isA()), + ); + }); + + testWidgets('throwErrorFromVoid', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + await expectLater( + () => api.throwErrorFromVoid(), + throwsA(isA()), + ); + }); + + testWidgets('throwFlutterError', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + await expectLater( + () => api.throwFlutterError(), + throwsA( + (dynamic e) { + return e is PlatformException && + e.code == 'code' && + e.message == 'message' && + e.details == 'details'; + }, + ), + ); + }); + + testWidgets('echoInt', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const int value = 0; + expect(await api.echoInt(value), value); + }); + + testWidgets('echoDouble', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const double value = 0.0; + expect(await api.echoDouble(value), value); + }); + + testWidgets('echoBool', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const bool value = true; + expect(await api.echoBool(value), value); + }); + + testWidgets('echoString', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const String value = 'string'; + expect(await api.echoString(value), value); + }); + + testWidgets('echoUint8List', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + final Uint8List value = Uint8List(0); + expect(await api.echoUint8List(value), value); + }); + + testWidgets('echoObject', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const Object value = 'apples'; + expect(await api.echoObject(value), value); + }); + + testWidgets('echoList', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const List value = [1, 2]; + expect(await api.echoList(value), value); + }); + + testWidgets('echoProxyApiList', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + final List value = [ + _createGenericProxyApiTestClass(), + _createGenericProxyApiTestClass(), + ]; + expect(await api.echoProxyApiList(value), value); + }); + + testWidgets('echoMap', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const Map value = {'apple': 'pie'}; + expect(await api.echoMap(value), value); + }); + + testWidgets('echoProxyApiMap', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + final Map value = + { + '42': _createGenericProxyApiTestClass(), + }; + expect(await api.echoProxyApiMap(value), value); + }); + + testWidgets('echoEnum', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const ProxyApiTestEnum value = ProxyApiTestEnum.three; + expect(await api.echoEnum(value), value); + }); + + testWidgets('echoProxyApi', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + final ProxyApiSuperClass value = ProxyApiSuperClass(); + expect(await api.echoProxyApi(value), value); + }); + + testWidgets('echoNullableInt', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableInt(null), null); + }); + + testWidgets('echoNullableDouble', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableDouble(null), null); + }); + + testWidgets('echoNullableBool', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableBool(null), null); + }); + + testWidgets('echoNullableString', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableString(null), null); + }); + + testWidgets('echoNullableUint8List', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableUint8List(null), null); + }); + + testWidgets('echoNullableObject', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableObject(null), null); + }); + + testWidgets('echoNullableList', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableList(null), null); + }); + + testWidgets('echoNullableMap', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableMap(null), null); + }); + + testWidgets('echoNullableEnum', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableEnum(null), null); + }); + + testWidgets('echoNullableProxyApi', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoNullableProxyApi(null), null); + }); + + testWidgets('noopAsync', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + await expectLater(api.noopAsync(), completes); + }); + + testWidgets('echoAsyncInt', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const int value = 0; + expect(await api.echoAsyncInt(value), value); + }); + + testWidgets('echoAsyncDouble', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const double value = 0.0; + expect(await api.echoAsyncDouble(value), value); + }); + + testWidgets('echoAsyncBool', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const bool value = false; + expect(await api.echoAsyncBool(value), value); + }); + + testWidgets('echoAsyncString', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const String value = 'ping'; + expect(await api.echoAsyncString(value), value); + }); + + testWidgets('echoAsyncUint8List', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + final Uint8List value = Uint8List(0); + expect(await api.echoAsyncUint8List(value), value); + }); + + testWidgets('echoAsyncObject', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const Object value = 0; + expect(await api.echoAsyncObject(value), value); + }); + + testWidgets('echoAsyncList', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const List value = ['apple', 'pie']; + expect(await api.echoAsyncList(value), value); + }); + + testWidgets('echoAsyncMap', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + final Map value = { + 'something': ProxyApiSuperClass(), + }; + expect(await api.echoAsyncMap(value), value); + }); + + testWidgets('echoAsyncEnum', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + const ProxyApiTestEnum value = ProxyApiTestEnum.two; + expect(await api.echoAsyncEnum(value), value); + }); + + testWidgets('throwAsyncError', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + await expectLater( + () => api.throwAsyncError(), + throwsA(isA()), + ); + }); + + testWidgets('throwAsyncErrorFromVoid', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + await expectLater( + () => api.throwAsyncErrorFromVoid(), + throwsA(isA()), + ); + }); + + testWidgets('throwAsyncFlutterError', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + + await expectLater( + () => api.throwAsyncFlutterError(), + throwsA( + (dynamic e) { + return e is PlatformException && + e.code == 'code' && + e.message == 'message' && + e.details == 'details'; + }, + ), + ); + }); + + testWidgets('echoAsyncNullableInt', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableInt(null), null); + }); + + testWidgets('echoAsyncNullableDouble', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableDouble(null), null); + }); + + testWidgets('echoAsyncNullableBool', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableBool(null), null); + }); + + testWidgets('echoAsyncNullableString', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableString(null), null); + }); + + testWidgets('echoAsyncNullableUint8List', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableUint8List(null), null); + }); + + testWidgets('echoAsyncNullableObject', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableObject(null), null); + }); + + testWidgets('echoAsyncNullableList', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableList(null), null); + }); + + testWidgets('echoAsyncNullableMap', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableMap(null), null); + }); + + testWidgets('echoAsyncNullableEnum', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass(); + expect(await api.echoAsyncNullableEnum(null), null); + }); + + testWidgets('staticNoop', (_) async { + await expectLater(ProxyApiTestClass.staticNoop(), completes); + }); + + testWidgets('echoStaticString', (_) async { + const String value = 'static string'; + expect(await ProxyApiTestClass.echoStaticString(value), value); + }); + + testWidgets('staticAsyncNoop', (_) async { + await expectLater(ProxyApiTestClass.staticAsyncNoop(), completes); + }); + + testWidgets('callFlutterNoop', (_) async { + bool called = false; + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterNoop: (ProxyApiTestClass instance) async { + called = true; + }, + ); + + await api.callFlutterNoop(); + expect(called, isTrue); + }); + + testWidgets('callFlutterThrowError', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterThrowError: (_) { + throw FlutterError('this is an error'); + }, + ); + + await expectLater( + api.callFlutterThrowError(), + throwsA( + isA().having( + (PlatformException exception) => exception.message, + 'message', + equals('this is an error'), + ), + ), + ); + }); + + testWidgets('callFlutterThrowErrorFromVoid', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterThrowErrorFromVoid: (_) { + throw FlutterError('this is an error'); + }, + ); + + await expectLater( + api.callFlutterThrowErrorFromVoid(), + throwsA( + isA().having( + (PlatformException exception) => exception.message, + 'message', + equals('this is an error'), + ), + ), + ); + }); + + testWidgets('callFlutterEchoBool', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoBool: (_, bool aBool) => aBool, + ); + + const bool value = true; + expect(await api.callFlutterEchoBool(value), value); + }); + + testWidgets('callFlutterEchoInt', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoInt: (_, int anInt) => anInt, + ); + + const int value = 0; + expect(await api.callFlutterEchoInt(value), value); + }); + + testWidgets('callFlutterEchoDouble', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoDouble: (_, double aDouble) => aDouble, + ); + + const double value = 0.0; + expect(await api.callFlutterEchoDouble(value), value); + }); + + testWidgets('callFlutterEchoString', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoString: (_, String aString) => aString, + ); + + const String value = 'a string'; + expect(await api.callFlutterEchoString(value), value); + }); + + testWidgets('callFlutterEchoUint8List', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoUint8List: (_, Uint8List aUint8List) => aUint8List, + ); + + final Uint8List value = Uint8List(0); + expect(await api.callFlutterEchoUint8List(value), value); + }); + + testWidgets('callFlutterEchoList', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoList: (_, List aList) => aList, + ); + + final List value = [0, 0.0, true, ProxyApiSuperClass()]; + expect(await api.callFlutterEchoList(value), value); + }); + + testWidgets('callFlutterEchoProxyApiList', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoProxyApiList: (_, List aList) => aList, + ); + + final List value = [ + _createGenericProxyApiTestClass(), + ]; + expect(await api.callFlutterEchoProxyApiList(value), value); + }); + + testWidgets('callFlutterEchoMap', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoMap: (_, Map aMap) => aMap, + ); + + final Map value = { + 'a String': 4, + }; + expect(await api.callFlutterEchoMap(value), value); + }); + + testWidgets('callFlutterEchoProxyApiMap', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoProxyApiMap: (_, Map aMap) => + aMap, + ); + + final Map value = + { + 'a String': _createGenericProxyApiTestClass(), + }; + expect(await api.callFlutterEchoProxyApiMap(value), value); + }); + + testWidgets('callFlutterEchoEnum', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoEnum: (_, ProxyApiTestEnum anEnum) => anEnum, + ); + + const ProxyApiTestEnum value = ProxyApiTestEnum.three; + expect(await api.callFlutterEchoEnum(value), value); + }); + + testWidgets('callFlutterEchoProxyApi', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoProxyApi: (_, ProxyApiSuperClass aProxyApi) => aProxyApi, + ); + + final ProxyApiSuperClass value = ProxyApiSuperClass(); + expect(await api.callFlutterEchoProxyApi(value), value); + }); + + testWidgets('callFlutterEchoNullableBool', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableBool: (_, bool? aBool) => aBool, + ); + expect(await api.callFlutterEchoNullableBool(null), null); + }); + + testWidgets('callFlutterEchoNullableInt', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableInt: (_, int? anInt) => anInt, + ); + expect(await api.callFlutterEchoNullableInt(null), null); + }); + + testWidgets('callFlutterEchoNullableDouble', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableDouble: (_, double? aDouble) => aDouble, + ); + expect(await api.callFlutterEchoNullableDouble(null), null); + }); + + testWidgets('callFlutterEchoNullableString', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableString: (_, String? aString) => aString, + ); + expect(await api.callFlutterEchoNullableString(null), null); + }); + + testWidgets('callFlutterEchoNullableUint8List', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableUint8List: (_, Uint8List? aUint8List) => aUint8List, + ); + expect(await api.callFlutterEchoNullableUint8List(null), null); + }); + + testWidgets('callFlutterEchoNullableList', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableList: (_, List? aList) => aList, + ); + expect(await api.callFlutterEchoNullableList(null), null); + }); + + testWidgets('callFlutterEchoNullableMap', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableMap: (_, Map? aMap) => aMap, + ); + expect(await api.callFlutterEchoNullableMap(null), null); + }); + + testWidgets('callFlutterEchoNullableEnum', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableEnum: (_, ProxyApiTestEnum? anEnum) => anEnum, + ); + expect(await api.callFlutterEchoNullableEnum(null), null); + }); + + testWidgets('callFlutterEchoNullableProxyApi', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoNullableProxyApi: (_, ProxyApiSuperClass? aProxyApi) => + aProxyApi, + ); + expect(await api.callFlutterEchoNullableProxyApi(null), null); + }); + + testWidgets('callFlutterNoopAsync', (_) async { + bool called = false; + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterNoopAsync: (ProxyApiTestClass instance) async { + called = true; + }, + ); + + await api.callFlutterNoopAsync(); + expect(called, isTrue); + }); + + testWidgets('callFlutterEchoAsyncString', (_) async { + final ProxyApiTestClass api = _createGenericProxyApiTestClass( + flutterEchoAsyncString: (_, String aString) async => aString, + ); + + const String value = 'a string'; + expect(await api.callFlutterEchoAsyncString(value), value); + }); + }); + group('Flutter API with suffix', () { setUp(() { FlutterSmallApi.setUp( @@ -1918,3 +2508,142 @@ class _SmallFlutterApi implements FlutterSmallApi { return msg; } } + +ProxyApiTestClass _createGenericProxyApiTestClass({ + void Function(ProxyApiTestClass instance)? flutterNoop, + Object? Function(ProxyApiTestClass instance)? flutterThrowError, + void Function( + ProxyApiTestClass instance, + )? flutterThrowErrorFromVoid, + bool Function( + ProxyApiTestClass instance, + bool aBool, + )? flutterEchoBool, + int Function( + ProxyApiTestClass instance, + int anInt, + )? flutterEchoInt, + double Function( + ProxyApiTestClass instance, + double aDouble, + )? flutterEchoDouble, + String Function( + ProxyApiTestClass instance, + String aString, + )? flutterEchoString, + Uint8List Function( + ProxyApiTestClass instance, + Uint8List aList, + )? flutterEchoUint8List, + List Function( + ProxyApiTestClass instance, + List aList, + )? flutterEchoList, + List Function( + ProxyApiTestClass instance, + List aList, + )? flutterEchoProxyApiList, + Map Function( + ProxyApiTestClass instance, + Map aMap, + )? flutterEchoMap, + Map Function( + ProxyApiTestClass instance, + Map aMap, + )? flutterEchoProxyApiMap, + ProxyApiTestEnum Function( + ProxyApiTestClass instance, + ProxyApiTestEnum anEnum, + )? flutterEchoEnum, + ProxyApiSuperClass Function( + ProxyApiTestClass instance, + ProxyApiSuperClass aProxyApi, + )? flutterEchoProxyApi, + bool? Function( + ProxyApiTestClass instance, + bool? aBool, + )? flutterEchoNullableBool, + int? Function( + ProxyApiTestClass instance, + int? anInt, + )? flutterEchoNullableInt, + double? Function( + ProxyApiTestClass instance, + double? aDouble, + )? flutterEchoNullableDouble, + String? Function( + ProxyApiTestClass instance, + String? aString, + )? flutterEchoNullableString, + Uint8List? Function( + ProxyApiTestClass instance, + Uint8List? aList, + )? flutterEchoNullableUint8List, + List? Function( + ProxyApiTestClass instance, + List? aList, + )? flutterEchoNullableList, + Map? Function( + ProxyApiTestClass instance, + Map? aMap, + )? flutterEchoNullableMap, + ProxyApiTestEnum? Function( + ProxyApiTestClass instance, + ProxyApiTestEnum? anEnum, + )? flutterEchoNullableEnum, + ProxyApiSuperClass? Function( + ProxyApiTestClass instance, + ProxyApiSuperClass? aProxyApi, + )? flutterEchoNullableProxyApi, + Future Function(ProxyApiTestClass instance)? flutterNoopAsync, + Future Function( + ProxyApiTestClass instance, + String aString, + )? flutterEchoAsyncString, +}) { + return ProxyApiTestClass( + aBool: true, + anInt: 0, + aDouble: 0.0, + aString: '', + aUint8List: Uint8List(0), + aList: const [], + aMap: const {}, + anEnum: ProxyApiTestEnum.one, + aProxyApi: ProxyApiSuperClass(), + boolParam: true, + intParam: 0, + doubleParam: 0.0, + stringParam: '', + aUint8ListParam: Uint8List(0), + listParam: const [], + mapParam: const {}, + enumParam: ProxyApiTestEnum.one, + proxyApiParam: ProxyApiSuperClass(), + flutterNoop: flutterNoop, + flutterThrowError: flutterThrowError, + flutterThrowErrorFromVoid: flutterThrowErrorFromVoid, + flutterEchoBool: flutterEchoBool, + flutterEchoInt: flutterEchoInt, + flutterEchoDouble: flutterEchoDouble, + flutterEchoString: flutterEchoString, + flutterEchoUint8List: flutterEchoUint8List, + flutterEchoList: flutterEchoList, + flutterEchoProxyApiList: flutterEchoProxyApiList, + flutterEchoMap: flutterEchoMap, + flutterEchoProxyApiMap: flutterEchoProxyApiMap, + flutterEchoEnum: flutterEchoEnum, + flutterEchoProxyApi: flutterEchoProxyApi, + flutterEchoNullableBool: flutterEchoNullableBool, + flutterEchoNullableInt: flutterEchoNullableInt, + flutterEchoNullableDouble: flutterEchoNullableDouble, + flutterEchoNullableString: flutterEchoNullableString, + flutterEchoNullableUint8List: flutterEchoNullableUint8List, + flutterEchoNullableList: flutterEchoNullableList, + flutterEchoNullableMap: flutterEchoNullableMap, + flutterEchoNullableEnum: flutterEchoNullableEnum, + flutterEchoNullableProxyApi: flutterEchoNullableProxyApi, + flutterNoopAsync: flutterNoopAsync, + flutterEchoAsyncString: flutterEchoAsyncString, + ); +} diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt index b42045ddd19b..f5ebd677313d 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt @@ -13,7 +13,7 @@ open class ProxyApiSuperClass interface ProxyApiInterface class ProxyApiCodec(binaryMessenger: BinaryMessenger, instanceManager: PigeonInstanceManager) : - PigeonProxyApiBaseCodec(binaryMessenger, instanceManager) { + PigeonProxyApiBaseCodec(binaryMessenger, instanceManager) { override fun getPigeonApiProxyApiTestClass(): PigeonApiProxyApiTestClass { return ProxyApiTestClassApi(this) } @@ -27,8 +27,658 @@ class ProxyApiCodec(binaryMessenger: BinaryMessenger, instanceManager: PigeonIns } } -class ProxyApiTestClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiTestClass(codec) +class ProxyApiTestClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiTestClass(codec) { -class ProxyApiSuperClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiSuperClass(codec) + override fun pigeon_defaultConstructor( + aBool: Boolean, + anInt: Long, + aDouble: Double, + aString: String, + aUint8List: ByteArray, + aList: List, + aMap: Map, + anEnum: ProxyApiTestEnum, + aProxyApi: ProxyApiSuperClass, + aNullableBool: Boolean?, + aNullableInt: Long?, + aNullableDouble: Double?, + aNullableString: String?, + aNullableUint8List: ByteArray?, + aNullableList: List?, + aNullableMap: Map?, + aNullableEnum: ProxyApiTestEnum?, + aNullableProxyApi: ProxyApiSuperClass?, + boolParam: Boolean, + intParam: Long, + doubleParam: Double, + stringParam: String, + aUint8ListParam: ByteArray, + listParam: List, + mapParam: Map, + enumParam: ProxyApiTestEnum, + proxyApiParam: ProxyApiSuperClass, + nullableBoolParam: Boolean?, + nullableIntParam: Long?, + nullableDoubleParam: Double?, + nullableStringParam: String?, + nullableUint8ListParam: ByteArray?, + nullableListParam: List?, + nullableMapParam: Map?, + nullableEnumParam: ProxyApiTestEnum?, + nullableProxyApiParam: ProxyApiSuperClass? + ): ProxyApiTestClass { + return ProxyApiTestClass() + } + + override fun attachedField(pigeon_instance: ProxyApiTestClass): ProxyApiSuperClass { + return ProxyApiSuperClass() + } + + override fun staticAttachedField(): ProxyApiSuperClass { + return ProxyApiSuperClass() + } + + override fun aBool(pigeon_instance: ProxyApiTestClass): Boolean { + return true + } + + override fun anInt(pigeon_instance: ProxyApiTestClass): Long { + return 0 + } + + override fun aDouble(pigeon_instance: ProxyApiTestClass): Double { + return 0.0 + } + + override fun aString(pigeon_instance: ProxyApiTestClass): String { + return "" + } + + override fun aUint8List(pigeon_instance: ProxyApiTestClass): ByteArray { + return byteArrayOf() + } + + override fun aList(pigeon_instance: ProxyApiTestClass): List { + return listOf() + } + + override fun aMap(pigeon_instance: ProxyApiTestClass): Map { + return mapOf() + } + + override fun anEnum(pigeon_instance: ProxyApiTestClass): ProxyApiTestEnum { + return ProxyApiTestEnum.ONE + } + + override fun aProxyApi(pigeon_instance: ProxyApiTestClass): ProxyApiSuperClass { + return ProxyApiSuperClass() + } + + override fun aNullableBool(pigeon_instance: ProxyApiTestClass): Boolean? { + return null + } + + override fun aNullableInt(pigeon_instance: ProxyApiTestClass): Long? { + return null + } + + override fun aNullableDouble(pigeon_instance: ProxyApiTestClass): Double? { + return null + } + + override fun aNullableString(pigeon_instance: ProxyApiTestClass): String? { + return null + } + + override fun aNullableUint8List(pigeon_instance: ProxyApiTestClass): ByteArray? { + return null + } + + override fun aNullableList(pigeon_instance: ProxyApiTestClass): List? { + return null + } + + override fun aNullableMap(pigeon_instance: ProxyApiTestClass): Map? { + return null + } + + override fun aNullableEnum(pigeon_instance: ProxyApiTestClass): ProxyApiTestEnum? { + return null + } + + override fun aNullableProxyApi(pigeon_instance: ProxyApiTestClass): ProxyApiSuperClass? { + return null + } + + override fun noop(pigeon_instance: ProxyApiTestClass) {} + + override fun throwError(pigeon_instance: ProxyApiTestClass): Any? { + throw Exception("message") + } + + override fun throwErrorFromVoid(pigeon_instance: ProxyApiTestClass) { + throw Exception("message") + } + + override fun throwFlutterError(pigeon_instance: ProxyApiTestClass): Any? { + throw ProxyApiTestsError("code", "message", "details") + } + + override fun echoInt(pigeon_instance: ProxyApiTestClass, anInt: Long): Long { + return anInt + } + + override fun echoDouble(pigeon_instance: ProxyApiTestClass, aDouble: Double): Double { + return aDouble + } + + override fun echoBool(pigeon_instance: ProxyApiTestClass, aBool: Boolean): Boolean { + return aBool + } + + override fun echoString(pigeon_instance: ProxyApiTestClass, aString: String): String { + return aString + } + + override fun echoUint8List(pigeon_instance: ProxyApiTestClass, aUint8List: ByteArray): ByteArray { + return aUint8List + } + + override fun echoObject(pigeon_instance: ProxyApiTestClass, anObject: Any): Any { + return anObject + } + + override fun echoList(pigeon_instance: ProxyApiTestClass, aList: List): List { + return aList + } + + override fun echoProxyApiList( + pigeon_instance: ProxyApiTestClass, + aList: List + ): List { + return aList + } + + override fun echoMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map + ): Map { + return aMap + } + + override fun echoProxyApiMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map + ): Map { + return aMap + } + + override fun echoEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum + ): ProxyApiTestEnum { + return anEnum + } + + override fun echoProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass + ): ProxyApiSuperClass { + return aProxyApi + } + + override fun echoNullableInt(pigeon_instance: ProxyApiTestClass, aNullableInt: Long?): Long? { + return aNullableInt + } + + override fun echoNullableDouble( + pigeon_instance: ProxyApiTestClass, + aNullableDouble: Double? + ): Double? { + return aNullableDouble + } + + override fun echoNullableBool( + pigeon_instance: ProxyApiTestClass, + aNullableBool: Boolean? + ): Boolean? { + return aNullableBool + } + + override fun echoNullableString( + pigeon_instance: ProxyApiTestClass, + aNullableString: String? + ): String? { + return aNullableString + } + + override fun echoNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aNullableUint8List: ByteArray? + ): ByteArray? { + return aNullableUint8List + } + + override fun echoNullableObject(pigeon_instance: ProxyApiTestClass, aNullableObject: Any?): Any? { + return aNullableObject + } + + override fun echoNullableList( + pigeon_instance: ProxyApiTestClass, + aNullableList: List? + ): List? { + return aNullableList + } + + override fun echoNullableMap( + pigeon_instance: ProxyApiTestClass, + aNullableMap: Map? + ): Map? { + return aNullableMap + } + + override fun echoNullableEnum( + pigeon_instance: ProxyApiTestClass, + aNullableEnum: ProxyApiTestEnum? + ): ProxyApiTestEnum? { + return aNullableEnum + } + + override fun echoNullableProxyApi( + pigeon_instance: ProxyApiTestClass, + aNullableProxyApi: ProxyApiSuperClass? + ): ProxyApiSuperClass? { + return aNullableProxyApi + } + + override fun noopAsync(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) { + callback(Result.success(Unit)) + } + + override fun echoAsyncInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long, + callback: (Result) -> Unit + ) { + callback(Result.success(anInt)) + } + + override fun echoAsyncDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double, + callback: (Result) -> Unit + ) { + callback(Result.success(aDouble)) + } + + override fun echoAsyncBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean, + callback: (Result) -> Unit + ) { + callback(Result.success(aBool)) + } + + override fun echoAsyncString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) { + callback(Result.success(aString)) + } + + override fun echoAsyncUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray, + callback: (Result) -> Unit + ) { + callback(Result.success(aUint8List)) + } + + override fun echoAsyncObject( + pigeon_instance: ProxyApiTestClass, + anObject: Any, + callback: (Result) -> Unit + ) { + callback(Result.success(anObject)) + } + + override fun echoAsyncList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) { + callback(Result.success(aList)) + } + + override fun echoAsyncMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) { + callback(Result.success(aMap)) + } + + override fun echoAsyncEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, + callback: (Result) -> Unit + ) { + callback(Result.success(anEnum)) + } + + override fun throwAsyncError( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + callback(Result.failure(Exception("message"))) + } + + override fun throwAsyncErrorFromVoid( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + callback(Result.failure(Exception("message"))) + } + + override fun throwAsyncFlutterError( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + callback(Result.failure(ProxyApiTestsError("code", "message", "details"))) + } + + override fun echoAsyncNullableInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long?, + callback: (Result) -> Unit + ) { + callback(Result.success(anInt)) + } + + override fun echoAsyncNullableDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double?, + callback: (Result) -> Unit + ) { + callback(Result.success(aDouble)) + } + + override fun echoAsyncNullableBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean?, + callback: (Result) -> Unit + ) { + callback(Result.success(aBool)) + } + + override fun echoAsyncNullableString( + pigeon_instance: ProxyApiTestClass, + aString: String?, + callback: (Result) -> Unit + ) { + callback(Result.success(aString)) + } + + override fun echoAsyncNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray?, + callback: (Result) -> Unit + ) { + callback(Result.success(aUint8List)) + } + + override fun echoAsyncNullableObject( + pigeon_instance: ProxyApiTestClass, + anObject: Any?, + callback: (Result) -> Unit + ) { + callback(Result.success(anObject)) + } + + override fun echoAsyncNullableList( + pigeon_instance: ProxyApiTestClass, + aList: List?, + callback: (Result?>) -> Unit + ) { + callback(Result.success(aList)) + } + + override fun echoAsyncNullableMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map?, + callback: (Result?>) -> Unit + ) { + callback(Result.success(aMap)) + } + + override fun echoAsyncNullableEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, + callback: (Result) -> Unit + ) { + callback(Result.success(anEnum)) + } + + override fun staticNoop() {} + + override fun echoStaticString(aString: String): String { + return aString + } + + override fun staticAsyncNoop(callback: (Result) -> Unit) { + callback(Result.success(Unit)) + } + + override fun callFlutterNoop( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + flutterNoop(pigeon_instance, callback) + } + + override fun callFlutterThrowError( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + flutterThrowError(pigeon_instance) { result -> + val exception = result.exceptionOrNull() + callback(Result.failure(exception!!)) + } + } + + override fun callFlutterThrowErrorFromVoid( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + flutterThrowErrorFromVoid(pigeon_instance) { result -> + val exception = result.exceptionOrNull() + callback(Result.failure(exception!!)) + } + } + + override fun callFlutterEchoBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean, + callback: (Result) -> Unit + ) { + flutterEchoBool(pigeon_instance, aBool, callback) + } + + override fun callFlutterEchoInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long, + callback: (Result) -> Unit + ) { + flutterEchoInt(pigeon_instance, anInt, callback) + } + + override fun callFlutterEchoDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double, + callback: (Result) -> Unit + ) { + flutterEchoDouble(pigeon_instance, aDouble, callback) + } + + override fun callFlutterEchoString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) { + flutterEchoString(pigeon_instance, aString, callback) + } + + override fun callFlutterEchoUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray, + callback: (Result) -> Unit + ) { + flutterEchoUint8List(pigeon_instance, aUint8List, callback) + } + + override fun callFlutterEchoList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) { + flutterEchoList(pigeon_instance, aList, callback) + } + + override fun callFlutterEchoProxyApiList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) { + flutterEchoProxyApiList(pigeon_instance, aList, callback) + } + + override fun callFlutterEchoMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) { + flutterEchoMap(pigeon_instance, aMap, callback) + } + + override fun callFlutterEchoProxyApiMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) { + flutterEchoProxyApiMap(pigeon_instance, aMap, callback) + } + + override fun callFlutterEchoEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, + callback: (Result) -> Unit + ) { + flutterEchoEnum(pigeon_instance, anEnum, callback) + } + + override fun callFlutterEchoProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass, + callback: (Result) -> Unit + ) { + flutterEchoProxyApi(pigeon_instance, aProxyApi, callback) + } + + override fun callFlutterEchoNullableBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean?, + callback: (Result) -> Unit + ) { + flutterEchoNullableBool(pigeon_instance, aBool, callback) + } + + override fun callFlutterEchoNullableInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long?, + callback: (Result) -> Unit + ) { + flutterEchoNullableInt(pigeon_instance, anInt, callback) + } + + override fun callFlutterEchoNullableDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double?, + callback: (Result) -> Unit + ) { + flutterEchoNullableDouble(pigeon_instance, aDouble, callback) + } + + override fun callFlutterEchoNullableString( + pigeon_instance: ProxyApiTestClass, + aString: String?, + callback: (Result) -> Unit + ) { + flutterEchoNullableString(pigeon_instance, aString, callback) + } + + override fun callFlutterEchoNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray?, + callback: (Result) -> Unit + ) { + flutterEchoNullableUint8List(pigeon_instance, aUint8List, callback) + } + + override fun callFlutterEchoNullableList( + pigeon_instance: ProxyApiTestClass, + aList: List?, + callback: (Result?>) -> Unit + ) { + flutterEchoNullableList(pigeon_instance, aList, callback) + } + + override fun callFlutterEchoNullableMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map?, + callback: (Result?>) -> Unit + ) { + flutterEchoNullableMap(pigeon_instance, aMap, callback) + } + + override fun callFlutterEchoNullableEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, + callback: (Result) -> Unit + ) { + flutterEchoNullableEnum(pigeon_instance, anEnum, callback) + } + + override fun callFlutterEchoNullableProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass?, + callback: (Result) -> Unit + ) { + flutterEchoNullableProxyApi(pigeon_instance, aProxyApi, callback) + } + + override fun callFlutterNoopAsync( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + flutterNoopAsync(pigeon_instance, callback) + } + + override fun callFlutterEchoAsyncString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) { + flutterEchoAsyncString(pigeon_instance, aString, callback) + } +} + +class ProxyApiSuperClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiSuperClass(codec) { + override fun pigeon_defaultConstructor(): ProxyApiSuperClass { + return ProxyApiSuperClass() + } + + override fun aSuperMethod(pigeon_instance: ProxyApiSuperClass) {} +} class ProxyApiInterfaceApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiInterface(codec) diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index aa5a34ff572e..25e1b349cdad 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -440,23 +440,3413 @@ enum class ProxyApiTestEnum(val raw: Int) { * The core ProxyApi test class that each supported host language must implement in platform_tests * integration tests. */ -@Suppress("UNCHECKED_CAST", "UNUSED_PARAMETER") +@Suppress("UNCHECKED_CAST") abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { + abstract fun pigeon_defaultConstructor( + aBool: Boolean, + anInt: Long, + aDouble: Double, + aString: String, + aUint8List: ByteArray, + aList: List, + aMap: Map, + anEnum: ProxyApiTestEnum, + aProxyApi: com.example.test_plugin.ProxyApiSuperClass, + aNullableBool: Boolean?, + aNullableInt: Long?, + aNullableDouble: Double?, + aNullableString: String?, + aNullableUint8List: ByteArray?, + aNullableList: List?, + aNullableMap: Map?, + aNullableEnum: ProxyApiTestEnum?, + aNullableProxyApi: com.example.test_plugin.ProxyApiSuperClass?, + boolParam: Boolean, + intParam: Long, + doubleParam: Double, + stringParam: String, + aUint8ListParam: ByteArray, + listParam: List, + mapParam: Map, + enumParam: ProxyApiTestEnum, + proxyApiParam: com.example.test_plugin.ProxyApiSuperClass, + nullableBoolParam: Boolean?, + nullableIntParam: Long?, + nullableDoubleParam: Double?, + nullableStringParam: String?, + nullableUint8ListParam: ByteArray?, + nullableListParam: List?, + nullableMapParam: Map?, + nullableEnumParam: ProxyApiTestEnum?, + nullableProxyApiParam: com.example.test_plugin.ProxyApiSuperClass? + ): ProxyApiTestClass + + abstract fun attachedField( + pigeon_instance: ProxyApiTestClass + ): com.example.test_plugin.ProxyApiSuperClass + + abstract fun staticAttachedField(): com.example.test_plugin.ProxyApiSuperClass + + abstract fun aBool(pigeon_instance: ProxyApiTestClass): Boolean + + abstract fun anInt(pigeon_instance: ProxyApiTestClass): Long + + abstract fun aDouble(pigeon_instance: ProxyApiTestClass): Double + + abstract fun aString(pigeon_instance: ProxyApiTestClass): String + + abstract fun aUint8List(pigeon_instance: ProxyApiTestClass): ByteArray + + abstract fun aList(pigeon_instance: ProxyApiTestClass): List + + abstract fun aMap(pigeon_instance: ProxyApiTestClass): Map + + abstract fun anEnum(pigeon_instance: ProxyApiTestClass): ProxyApiTestEnum + + abstract fun aProxyApi( + pigeon_instance: ProxyApiTestClass + ): com.example.test_plugin.ProxyApiSuperClass + + abstract fun aNullableBool(pigeon_instance: ProxyApiTestClass): Boolean? + + abstract fun aNullableInt(pigeon_instance: ProxyApiTestClass): Long? + + abstract fun aNullableDouble(pigeon_instance: ProxyApiTestClass): Double? + + abstract fun aNullableString(pigeon_instance: ProxyApiTestClass): String? + + abstract fun aNullableUint8List(pigeon_instance: ProxyApiTestClass): ByteArray? + + abstract fun aNullableList(pigeon_instance: ProxyApiTestClass): List? + + abstract fun aNullableMap(pigeon_instance: ProxyApiTestClass): Map? + + abstract fun aNullableEnum(pigeon_instance: ProxyApiTestClass): ProxyApiTestEnum? + + abstract fun aNullableProxyApi( + pigeon_instance: ProxyApiTestClass + ): com.example.test_plugin.ProxyApiSuperClass? + + /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ + abstract fun noop(pigeon_instance: ProxyApiTestClass) + + /** Returns an error, to test error handling. */ + abstract fun throwError(pigeon_instance: ProxyApiTestClass): Any? + + /** Returns an error from a void function, to test error handling. */ + abstract fun throwErrorFromVoid(pigeon_instance: ProxyApiTestClass) + + /** Returns a Flutter error, to test error handling. */ + abstract fun throwFlutterError(pigeon_instance: ProxyApiTestClass): Any? + + /** Returns passed in int. */ + abstract fun echoInt(pigeon_instance: ProxyApiTestClass, anInt: Long): Long + + /** Returns passed in double. */ + abstract fun echoDouble(pigeon_instance: ProxyApiTestClass, aDouble: Double): Double + + /** Returns the passed in boolean. */ + abstract fun echoBool(pigeon_instance: ProxyApiTestClass, aBool: Boolean): Boolean + + /** Returns the passed in string. */ + abstract fun echoString(pigeon_instance: ProxyApiTestClass, aString: String): String + + /** Returns the passed in Uint8List. */ + abstract fun echoUint8List(pigeon_instance: ProxyApiTestClass, aUint8List: ByteArray): ByteArray + + /** Returns the passed in generic Object. */ + abstract fun echoObject(pigeon_instance: ProxyApiTestClass, anObject: Any): Any + + /** Returns the passed list, to test serialization and deserialization. */ + abstract fun echoList(pigeon_instance: ProxyApiTestClass, aList: List): List + + /** Returns the passed list with ProxyApis, to test serialization and deserialization. */ + abstract fun echoProxyApiList( + pigeon_instance: ProxyApiTestClass, + aList: List + ): List + + /** Returns the passed map, to test serialization and deserialization. */ + abstract fun echoMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map + ): Map + + /** Returns the passed map with ProxyApis, to test serialization and deserialization. */ + abstract fun echoProxyApiMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map + ): Map + + /** Returns the passed enum to test serialization and deserialization. */ + abstract fun echoEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum + ): ProxyApiTestEnum + + /** Returns the passed ProxyApi to test serialization and deserialization. */ + abstract fun echoProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: com.example.test_plugin.ProxyApiSuperClass + ): com.example.test_plugin.ProxyApiSuperClass + + /** Returns passed in int. */ + abstract fun echoNullableInt(pigeon_instance: ProxyApiTestClass, aNullableInt: Long?): Long? + + /** Returns passed in double. */ + abstract fun echoNullableDouble( + pigeon_instance: ProxyApiTestClass, + aNullableDouble: Double? + ): Double? + + /** Returns the passed in boolean. */ + abstract fun echoNullableBool( + pigeon_instance: ProxyApiTestClass, + aNullableBool: Boolean? + ): Boolean? + + /** Returns the passed in string. */ + abstract fun echoNullableString( + pigeon_instance: ProxyApiTestClass, + aNullableString: String? + ): String? + + /** Returns the passed in Uint8List. */ + abstract fun echoNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aNullableUint8List: ByteArray? + ): ByteArray? + + /** Returns the passed in generic Object. */ + abstract fun echoNullableObject(pigeon_instance: ProxyApiTestClass, aNullableObject: Any?): Any? + + /** Returns the passed list, to test serialization and deserialization. */ + abstract fun echoNullableList( + pigeon_instance: ProxyApiTestClass, + aNullableList: List? + ): List? + + /** Returns the passed map, to test serialization and deserialization. */ + abstract fun echoNullableMap( + pigeon_instance: ProxyApiTestClass, + aNullableMap: Map? + ): Map? + + abstract fun echoNullableEnum( + pigeon_instance: ProxyApiTestClass, + aNullableEnum: ProxyApiTestEnum? + ): ProxyApiTestEnum? + + /** Returns the passed ProxyApi to test serialization and deserialization. */ + abstract fun echoNullableProxyApi( + pigeon_instance: ProxyApiTestClass, + aNullableProxyApi: com.example.test_plugin.ProxyApiSuperClass? + ): com.example.test_plugin.ProxyApiSuperClass? + + /** + * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous + * calling. + */ + abstract fun noopAsync(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) + + /** Returns passed in int asynchronously. */ + abstract fun echoAsyncInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long, + callback: (Result) -> Unit + ) + + /** Returns passed in double asynchronously. */ + abstract fun echoAsyncDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double, + callback: (Result) -> Unit + ) + + /** Returns the passed in boolean asynchronously. */ + abstract fun echoAsyncBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean, + callback: (Result) -> Unit + ) + + /** Returns the passed string asynchronously. */ + abstract fun echoAsyncString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) + + /** Returns the passed in Uint8List asynchronously. */ + abstract fun echoAsyncUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray, + callback: (Result) -> Unit + ) + + /** Returns the passed in generic Object asynchronously. */ + abstract fun echoAsyncObject( + pigeon_instance: ProxyApiTestClass, + anObject: Any, + callback: (Result) -> Unit + ) + + /** Returns the passed list, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) + + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) + + /** Returns the passed enum, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, + callback: (Result) -> Unit + ) + + /** Responds with an error from an async function returning a value. */ + abstract fun throwAsyncError(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) + + /** Responds with an error from an async void function. */ + abstract fun throwAsyncErrorFromVoid( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + /** Responds with a Flutter error from an async function returning a value. */ + abstract fun throwAsyncFlutterError( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + /** Returns passed in int asynchronously. */ + abstract fun echoAsyncNullableInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long?, + callback: (Result) -> Unit + ) + + /** Returns passed in double asynchronously. */ + abstract fun echoAsyncNullableDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double?, + callback: (Result) -> Unit + ) + + /** Returns the passed in boolean asynchronously. */ + abstract fun echoAsyncNullableBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean?, + callback: (Result) -> Unit + ) + + /** Returns the passed string asynchronously. */ + abstract fun echoAsyncNullableString( + pigeon_instance: ProxyApiTestClass, + aString: String?, + callback: (Result) -> Unit + ) + + /** Returns the passed in Uint8List asynchronously. */ + abstract fun echoAsyncNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray?, + callback: (Result) -> Unit + ) + + /** Returns the passed in generic Object asynchronously. */ + abstract fun echoAsyncNullableObject( + pigeon_instance: ProxyApiTestClass, + anObject: Any?, + callback: (Result) -> Unit + ) + + /** Returns the passed list, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncNullableList( + pigeon_instance: ProxyApiTestClass, + aList: List?, + callback: (Result?>) -> Unit + ) + + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncNullableMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map?, + callback: (Result?>) -> Unit + ) + + /** Returns the passed enum, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncNullableEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, + callback: (Result) -> Unit + ) + + abstract fun staticNoop() + + abstract fun echoStaticString(aString: String): String + + abstract fun staticAsyncNoop(callback: (Result) -> Unit) + + abstract fun callFlutterNoop(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) + + abstract fun callFlutterThrowError( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + abstract fun callFlutterThrowErrorFromVoid( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) + + abstract fun callFlutterEchoProxyApiList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) + + abstract fun callFlutterEchoMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) + + abstract fun callFlutterEchoProxyApiMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) + + abstract fun callFlutterEchoEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: com.example.test_plugin.ProxyApiSuperClass, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableString( + pigeon_instance: ProxyApiTestClass, + aString: String?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableList( + pigeon_instance: ProxyApiTestClass, + aList: List?, + callback: (Result?>) -> Unit + ) + + abstract fun callFlutterEchoNullableMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map?, + callback: (Result?>) -> Unit + ) + + abstract fun callFlutterEchoNullableEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: com.example.test_plugin.ProxyApiSuperClass?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterNoopAsync( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoAsyncString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) + companion object { @Suppress("LocalVariableName") - fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiTestClass?) {} + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiTestClass?) { + val codec = api?.codec ?: StandardMessageCodec() + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_defaultConstructor$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_identifierArg = args[0].let { if (it is Int) it.toLong() else it as Long } + val aBoolArg = args[1] as Boolean + val anIntArg = args[2].let { if (it is Int) it.toLong() else it as Long } + val aDoubleArg = args[3] as Double + val aStringArg = args[4] as String + val aUint8ListArg = args[5] as ByteArray + val aListArg = args[6] as List + val aMapArg = args[7] as Map + val anEnumArg = ProxyApiTestEnum.ofRaw(args[8] as Int)!! + val aProxyApiArg = args[9] as com.example.test_plugin.ProxyApiSuperClass + val aNullableBoolArg = args[10] as Boolean? + val aNullableIntArg = args[11].let { if (it is Int) it.toLong() else it as Long? } + val aNullableDoubleArg = args[12] as Double? + val aNullableStringArg = args[13] as String? + val aNullableUint8ListArg = args[14] as ByteArray? + val aNullableListArg = args[15] as List? + val aNullableMapArg = args[16] as Map? + val aNullableEnumArg = + if (args[17] == null) null else ProxyApiTestEnum.ofRaw(args[17] as Int) + val aNullableProxyApiArg = args[18] as com.example.test_plugin.ProxyApiSuperClass? + val boolParamArg = args[19] as Boolean + val intParamArg = args[20].let { if (it is Int) it.toLong() else it as Long } + val doubleParamArg = args[21] as Double + val stringParamArg = args[22] as String + val aUint8ListParamArg = args[23] as ByteArray + val listParamArg = args[24] as List + val mapParamArg = args[25] as Map + val enumParamArg = ProxyApiTestEnum.ofRaw(args[26] as Int)!! + val proxyApiParamArg = args[27] as com.example.test_plugin.ProxyApiSuperClass + val nullableBoolParamArg = args[28] as Boolean? + val nullableIntParamArg = args[29].let { if (it is Int) it.toLong() else it as Long? } + val nullableDoubleParamArg = args[30] as Double? + val nullableStringParamArg = args[31] as String? + val nullableUint8ListParamArg = args[32] as ByteArray? + val nullableListParamArg = args[33] as List? + val nullableMapParamArg = args[34] as Map? + val nullableEnumParamArg = + if (args[35] == null) null else ProxyApiTestEnum.ofRaw(args[35] as Int) + val nullableProxyApiParamArg = args[36] as com.example.test_plugin.ProxyApiSuperClass? + var wrapped: List + try { + api.codec.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor( + aBoolArg, + anIntArg, + aDoubleArg, + aStringArg, + aUint8ListArg, + aListArg, + aMapArg, + anEnumArg, + aProxyApiArg, + aNullableBoolArg, + aNullableIntArg, + aNullableDoubleArg, + aNullableStringArg, + aNullableUint8ListArg, + aNullableListArg, + aNullableMapArg, + aNullableEnumArg, + aNullableProxyApiArg, + boolParamArg, + intParamArg, + doubleParamArg, + stringParamArg, + aUint8ListParamArg, + listParamArg, + mapParamArg, + enumParamArg, + proxyApiParamArg, + nullableBoolParamArg, + nullableIntParamArg, + nullableDoubleParamArg, + nullableStringParamArg, + nullableUint8ListParamArg, + nullableListParamArg, + nullableMapParamArg, + nullableEnumParamArg, + nullableProxyApiParamArg), + pigeon_identifierArg) + wrapped = listOf(null) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.attachedField$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val pigeon_identifierArg = args[1].let { if (it is Int) it.toLong() else it as Long } + var wrapped: List + try { + api.codec.instanceManager.addDartCreatedInstance( + api.attachedField(pigeon_instanceArg), pigeon_identifierArg) + wrapped = listOf(null) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAttachedField$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_identifierArg = args[0].let { if (it is Int) it.toLong() else it as Long } + var wrapped: List + try { + api.codec.instanceManager.addDartCreatedInstance( + api.staticAttachedField(), pigeon_identifierArg) + wrapped = listOf(null) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noop$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + var wrapped: List + try { + api.noop(pigeon_instanceArg) + wrapped = listOf(null) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwError$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + var wrapped: List + try { + wrapped = listOf(api.throwError(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwErrorFromVoid$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + var wrapped: List + try { + api.throwErrorFromVoid(pigeon_instanceArg) + wrapped = listOf(null) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwFlutterError$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + var wrapped: List + try { + wrapped = listOf(api.throwFlutterError(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoInt$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anIntArg = args[1].let { if (it is Int) it.toLong() else it as Long } + var wrapped: List + try { + wrapped = listOf(api.echoInt(pigeon_instanceArg, anIntArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoDouble$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aDoubleArg = args[1] as Double + var wrapped: List + try { + wrapped = listOf(api.echoDouble(pigeon_instanceArg, aDoubleArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoBool$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aBoolArg = args[1] as Boolean + var wrapped: List + try { + wrapped = listOf(api.echoBool(pigeon_instanceArg, aBoolArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoString$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String + var wrapped: List + try { + wrapped = listOf(api.echoString(pigeon_instanceArg, aStringArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoUint8List$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aUint8ListArg = args[1] as ByteArray + var wrapped: List + try { + wrapped = listOf(api.echoUint8List(pigeon_instanceArg, aUint8ListArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoObject$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anObjectArg = args[1] as Any + var wrapped: List + try { + wrapped = listOf(api.echoObject(pigeon_instanceArg, anObjectArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List + var wrapped: List + try { + wrapped = listOf(api.echoList(pigeon_instanceArg, aListArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List + var wrapped: List + try { + wrapped = listOf(api.echoProxyApiList(pigeon_instanceArg, aListArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map + var wrapped: List + try { + wrapped = listOf(api.echoMap(pigeon_instanceArg, aMapArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map + var wrapped: List + try { + wrapped = listOf(api.echoProxyApiMap(pigeon_instanceArg, aMapArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoEnum$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anEnumArg = ProxyApiTestEnum.ofRaw(args[1] as Int)!! + var wrapped: List + try { + wrapped = listOf(api.echoEnum(pigeon_instanceArg, anEnumArg).raw) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApi$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass + var wrapped: List + try { + wrapped = listOf(api.echoProxyApi(pigeon_instanceArg, aProxyApiArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableInt$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableIntArg = args[1].let { if (it is Int) it.toLong() else it as Long? } + var wrapped: List + try { + wrapped = listOf(api.echoNullableInt(pigeon_instanceArg, aNullableIntArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableDouble$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableDoubleArg = args[1] as Double? + var wrapped: List + try { + wrapped = listOf(api.echoNullableDouble(pigeon_instanceArg, aNullableDoubleArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableBool$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableBoolArg = args[1] as Boolean? + var wrapped: List + try { + wrapped = listOf(api.echoNullableBool(pigeon_instanceArg, aNullableBoolArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableString$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableStringArg = args[1] as String? + var wrapped: List + try { + wrapped = listOf(api.echoNullableString(pigeon_instanceArg, aNullableStringArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableUint8List$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableUint8ListArg = args[1] as ByteArray? + var wrapped: List + try { + wrapped = + listOf(api.echoNullableUint8List(pigeon_instanceArg, aNullableUint8ListArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableObject$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableObjectArg = args[1] + var wrapped: List + try { + wrapped = listOf(api.echoNullableObject(pigeon_instanceArg, aNullableObjectArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableListArg = args[1] as List? + var wrapped: List + try { + wrapped = listOf(api.echoNullableList(pigeon_instanceArg, aNullableListArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableMapArg = args[1] as Map? + var wrapped: List + try { + wrapped = listOf(api.echoNullableMap(pigeon_instanceArg, aNullableMapArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableEnum$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableEnumArg = + if (args[1] == null) null else ProxyApiTestEnum.ofRaw(args[1] as Int) + var wrapped: List + try { + wrapped = + listOf(api.echoNullableEnum(pigeon_instanceArg, aNullableEnumArg)?.raw) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableProxyApi$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass? + var wrapped: List + try { + wrapped = + listOf(api.echoNullableProxyApi(pigeon_instanceArg, aNullableProxyApiArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noopAsync$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.noopAsync(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncInt$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anIntArg = args[1].let { if (it is Int) it.toLong() else it as Long } + api.echoAsyncInt(pigeon_instanceArg, anIntArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncDouble$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aDoubleArg = args[1] as Double + api.echoAsyncDouble(pigeon_instanceArg, aDoubleArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncBool$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aBoolArg = args[1] as Boolean + api.echoAsyncBool(pigeon_instanceArg, aBoolArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncString$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String + api.echoAsyncString(pigeon_instanceArg, aStringArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncUint8List$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aUint8ListArg = args[1] as ByteArray + api.echoAsyncUint8List(pigeon_instanceArg, aUint8ListArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncObject$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anObjectArg = args[1] as Any + api.echoAsyncObject(pigeon_instanceArg, anObjectArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List + api.echoAsyncList(pigeon_instanceArg, aListArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map + api.echoAsyncMap(pigeon_instanceArg, aMapArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncEnum$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anEnumArg = ProxyApiTestEnum.ofRaw(args[1] as Int)!! + api.echoAsyncEnum(pigeon_instanceArg, anEnumArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data!!.raw)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncError$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.throwAsyncError(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncErrorFromVoid$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.throwAsyncErrorFromVoid(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncFlutterError$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.throwAsyncFlutterError(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableInt$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anIntArg = args[1].let { if (it is Int) it.toLong() else it as Long? } + api.echoAsyncNullableInt(pigeon_instanceArg, anIntArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableDouble$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aDoubleArg = args[1] as Double? + api.echoAsyncNullableDouble(pigeon_instanceArg, aDoubleArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableBool$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aBoolArg = args[1] as Boolean? + api.echoAsyncNullableBool(pigeon_instanceArg, aBoolArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableString$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String? + api.echoAsyncNullableString(pigeon_instanceArg, aStringArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableUint8List$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aUint8ListArg = args[1] as ByteArray? + api.echoAsyncNullableUint8List(pigeon_instanceArg, aUint8ListArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableObject$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anObjectArg = args[1] + api.echoAsyncNullableObject(pigeon_instanceArg, anObjectArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List? + api.echoAsyncNullableList(pigeon_instanceArg, aListArg) { result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map? + api.echoAsyncNullableMap(pigeon_instanceArg, aMapArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableEnum$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anEnumArg = if (args[1] == null) null else ProxyApiTestEnum.ofRaw(args[1] as Int) + api.echoAsyncNullableEnum(pigeon_instanceArg, anEnumArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data?.raw)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticNoop$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + var wrapped: List + try { + api.staticNoop() + wrapped = listOf(null) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoStaticString$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val aStringArg = args[0] as String + var wrapped: List + try { + wrapped = listOf(api.echoStaticString(aStringArg)) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAsyncNoop$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + api.staticAsyncNoop() { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoop$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.callFlutterNoop(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowError$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.callFlutterThrowError(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowErrorFromVoid$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.callFlutterThrowErrorFromVoid(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoBool$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aBoolArg = args[1] as Boolean + api.callFlutterEchoBool(pigeon_instanceArg, aBoolArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoInt$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anIntArg = args[1].let { if (it is Int) it.toLong() else it as Long } + api.callFlutterEchoInt(pigeon_instanceArg, anIntArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoDouble$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aDoubleArg = args[1] as Double + api.callFlutterEchoDouble(pigeon_instanceArg, aDoubleArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoString$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String + api.callFlutterEchoString(pigeon_instanceArg, aStringArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoUint8List$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aUint8ListArg = args[1] as ByteArray + api.callFlutterEchoUint8List(pigeon_instanceArg, aUint8ListArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List + api.callFlutterEchoList(pigeon_instanceArg, aListArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List + api.callFlutterEchoProxyApiList(pigeon_instanceArg, aListArg) { + result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map + api.callFlutterEchoMap(pigeon_instanceArg, aMapArg) { result: Result> + -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map + api.callFlutterEchoProxyApiMap(pigeon_instanceArg, aMapArg) { + result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoEnum$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anEnumArg = ProxyApiTestEnum.ofRaw(args[1] as Int)!! + api.callFlutterEchoEnum(pigeon_instanceArg, anEnumArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data!!.raw)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApi$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass + api.callFlutterEchoProxyApi(pigeon_instanceArg, aProxyApiArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableBool$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aBoolArg = args[1] as Boolean? + api.callFlutterEchoNullableBool(pigeon_instanceArg, aBoolArg) { result: Result + -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableInt$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anIntArg = args[1].let { if (it is Int) it.toLong() else it as Long? } + api.callFlutterEchoNullableInt(pigeon_instanceArg, anIntArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableDouble$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aDoubleArg = args[1] as Double? + api.callFlutterEchoNullableDouble(pigeon_instanceArg, aDoubleArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableString$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String? + api.callFlutterEchoNullableString(pigeon_instanceArg, aStringArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableUint8List$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aUint8ListArg = args[1] as ByteArray? + api.callFlutterEchoNullableUint8List(pigeon_instanceArg, aUint8ListArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableList$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List? + api.callFlutterEchoNullableList(pigeon_instanceArg, aListArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map? + api.callFlutterEchoNullableMap(pigeon_instanceArg, aMapArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableEnum$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anEnumArg = if (args[1] == null) null else ProxyApiTestEnum.ofRaw(args[1] as Int) + api.callFlutterEchoNullableEnum(pigeon_instanceArg, anEnumArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data?.raw)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableProxyApi$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass? + api.callFlutterEchoNullableProxyApi(pigeon_instanceArg, aProxyApiArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoopAsync$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.callFlutterNoopAsync(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoAsyncString$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String + api.callFlutterEchoAsyncString(pigeon_instanceArg, aStringArg) { result: Result + -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of ProxyApiTestClass and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + if (codec.instanceManager.containsInstance(pigeon_instanceArg)) { + Result.success(Unit) + return + } + val pigeon_identifierArg = codec.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val aBoolArg = aBool(pigeon_instanceArg) + val anIntArg = anInt(pigeon_instanceArg) + val aDoubleArg = aDouble(pigeon_instanceArg) + val aStringArg = aString(pigeon_instanceArg) + val aUint8ListArg = aUint8List(pigeon_instanceArg) + val aListArg = aList(pigeon_instanceArg) + val aMapArg = aMap(pigeon_instanceArg) + val anEnumArg = anEnum(pigeon_instanceArg) + val aProxyApiArg = aProxyApi(pigeon_instanceArg) + val aNullableBoolArg = aNullableBool(pigeon_instanceArg) + val aNullableIntArg = aNullableInt(pigeon_instanceArg) + val aNullableDoubleArg = aNullableDouble(pigeon_instanceArg) + val aNullableStringArg = aNullableString(pigeon_instanceArg) + val aNullableUint8ListArg = aNullableUint8List(pigeon_instanceArg) + val aNullableListArg = aNullableList(pigeon_instanceArg) + val aNullableMapArg = aNullableMap(pigeon_instanceArg) + val aNullableEnumArg = aNullableEnum(pigeon_instanceArg) + val aNullableProxyApiArg = aNullableProxyApi(pigeon_instanceArg) + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_newInstance$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send( + listOf( + pigeon_identifierArg, + aBoolArg, + anIntArg, + aDoubleArg, + aStringArg, + aUint8ListArg, + aListArg, + aMapArg, + anEnumArg.raw, + aProxyApiArg, + aNullableBoolArg, + aNullableIntArg, + aNullableDoubleArg, + aNullableStringArg, + aNullableUint8ListArg, + aNullableListArg, + aNullableMapArg, + aNullableEnumArg?.raw, + aNullableProxyApiArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ + fun flutterNoop(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoop$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Responds with an error from an async function returning a value. */ + fun flutterThrowError(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowError$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Responds with an error from an async void function. */ + fun flutterThrowErrorFromVoid( + pigeon_instanceArg: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowErrorFromVoid$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed boolean, to test serialization and deserialization. */ + fun flutterEchoBool( + pigeon_instanceArg: ProxyApiTestClass, + aBoolArg: Boolean, + callback: (Result) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoBool$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aBoolArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Boolean + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed int, to test serialization and deserialization. */ + fun flutterEchoInt( + pigeon_instanceArg: ProxyApiTestClass, + anIntArg: Long, + callback: (Result) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoInt$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, anIntArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0].let { if (it is Int) it.toLong() else it as Long } + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed double, to test serialization and deserialization. */ + fun flutterEchoDouble( + pigeon_instanceArg: ProxyApiTestClass, + aDoubleArg: Double, + callback: (Result) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoDouble$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aDoubleArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Double + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed string, to test serialization and deserialization. */ + fun flutterEchoString( + pigeon_instanceArg: ProxyApiTestClass, + aStringArg: String, + callback: (Result) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoString$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aStringArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as String + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed byte list, to test serialization and deserialization. */ + fun flutterEchoUint8List( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: ByteArray, + callback: (Result) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoUint8List$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as ByteArray + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed list, to test serialization and deserialization. */ + fun flutterEchoList( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: List, + callback: (Result>) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoList$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as List + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed list with ProxyApis, to test serialization and deserialization. */ + fun flutterEchoProxyApiList( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: List, + callback: (Result>) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiList$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as List + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed map, to test serialization and deserialization. */ + fun flutterEchoMap( + pigeon_instanceArg: ProxyApiTestClass, + aMapArg: Map, + callback: (Result>) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoMap$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Map + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed map with ProxyApis, to test serialization and deserialization. */ + fun flutterEchoProxyApiMap( + pigeon_instanceArg: ProxyApiTestClass, + aMapArg: Map, + callback: (Result>) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiMap$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Map + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed enum to test serialization and deserialization. */ + fun flutterEchoEnum( + pigeon_instanceArg: ProxyApiTestClass, + anEnumArg: ProxyApiTestEnum, + callback: (Result) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoEnum$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, anEnumArg.raw)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = ProxyApiTestEnum.ofRaw(it[0] as Int)!! + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed ProxyApi to test serialization and deserialization. */ + fun flutterEchoProxyApi( + pigeon_instanceArg: ProxyApiTestClass, + aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass, + callback: (Result) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApi$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aProxyApiArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as com.example.test_plugin.ProxyApiSuperClass + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } } - @Suppress("LocalVariableName", "FunctionName") - /** Creates a Dart instance of ProxyApiTestClass and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) {} + /** Returns the passed boolean, to test serialization and deserialization. */ + fun flutterEchoNullableBool( + pigeon_instanceArg: ProxyApiTestClass, + aBoolArg: Boolean?, + callback: (Result) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableBool$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aBoolArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as Boolean? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed int, to test serialization and deserialization. */ + fun flutterEchoNullableInt( + pigeon_instanceArg: ProxyApiTestClass, + anIntArg: Long?, + callback: (Result) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableInt$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, anIntArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0].let { if (it is Int) it.toLong() else it as Long? } + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed double, to test serialization and deserialization. */ + fun flutterEchoNullableDouble( + pigeon_instanceArg: ProxyApiTestClass, + aDoubleArg: Double?, + callback: (Result) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableDouble$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aDoubleArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as Double? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed string, to test serialization and deserialization. */ + fun flutterEchoNullableString( + pigeon_instanceArg: ProxyApiTestClass, + aStringArg: String?, + callback: (Result) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableString$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aStringArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as String? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed byte list, to test serialization and deserialization. */ + fun flutterEchoNullableUint8List( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: ByteArray?, + callback: (Result) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableUint8List$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as ByteArray? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed list, to test serialization and deserialization. */ + fun flutterEchoNullableList( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: List?, + callback: (Result?>) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableList$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as List? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed map, to test serialization and deserialization. */ + fun flutterEchoNullableMap( + pigeon_instanceArg: ProxyApiTestClass, + aMapArg: Map?, + callback: (Result?>) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableMap$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as Map? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed enum to test serialization and deserialization. */ + fun flutterEchoNullableEnum( + pigeon_instanceArg: ProxyApiTestClass, + anEnumArg: ProxyApiTestEnum?, + callback: (Result) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableEnum$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, anEnumArg?.raw)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = (it[0] as Int?)?.let { ProxyApiTestEnum.ofRaw(it) } + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed ProxyApi to test serialization and deserialization. */ + fun flutterEchoNullableProxyApi( + pigeon_instanceArg: ProxyApiTestClass, + aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass?, + callback: (Result) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableProxyApi$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aProxyApiArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as com.example.test_plugin.ProxyApiSuperClass? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** + * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous + * calling. + */ + fun flutterNoopAsync(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoopAsync$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed in generic Object asynchronously. */ + fun flutterEchoAsyncString( + pigeon_instanceArg: ProxyApiTestClass, + aStringArg: String, + callback: (Result) -> Unit + ) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoAsyncString$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aStringArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as String + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + @Suppress("FunctionName") + /** An implementation of [PigeonApiProxyApiSuperClass] used to access callback methods */ + fun pigeon_getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass { + return codec.getPigeonApiProxyApiSuperClass() + } + + @Suppress("FunctionName") + /** An implementation of [PigeonApiProxyApiInterface] used to access callback methods */ + fun pigeon_getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { + return codec.getPigeonApiProxyApiInterface() + } } /** ProxyApi to serve as a super class to the core ProxyApi class. */ -@Suppress("UNCHECKED_CAST", "UNUSED_PARAMETER") +@Suppress("UNCHECKED_CAST") abstract class PigeonApiProxyApiSuperClass(val codec: PigeonProxyApiBaseCodec) { + abstract fun pigeon_defaultConstructor(): com.example.test_plugin.ProxyApiSuperClass + + abstract fun aSuperMethod(pigeon_instance: com.example.test_plugin.ProxyApiSuperClass) + companion object { @Suppress("LocalVariableName") - fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiSuperClass?) {} + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiSuperClass?) { + val codec = api?.codec ?: StandardMessageCodec() + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_defaultConstructor$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_identifierArg = args[0].let { if (it is Int) it.toLong() else it as Long } + var wrapped: List + try { + api.codec.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + wrapped = listOf(null) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.aSuperMethod$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as com.example.test_plugin.ProxyApiSuperClass + var wrapped: List + try { + api.aSuperMethod(pigeon_instanceArg) + wrapped = listOf(null) + } catch (exception: Throwable) { + wrapped = wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } } @Suppress("LocalVariableName", "FunctionName") @@ -464,12 +3854,84 @@ abstract class PigeonApiProxyApiSuperClass(val codec: PigeonProxyApiBaseCodec) { fun pigeon_newInstance( pigeon_instanceArg: com.example.test_plugin.ProxyApiSuperClass, callback: (Result) -> Unit - ) {} + ) { + if (codec.instanceManager.containsInstance(pigeon_instanceArg)) { + Result.success(Unit) + return + } + val pigeon_identifierArg = codec.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_newInstance$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } } /** ProxyApi to serve as an interface to the core ProxyApi class. */ -@Suppress("UNCHECKED_CAST", "UNUSED_PARAMETER") +@Suppress("UNCHECKED_CAST") abstract class PigeonApiProxyApiInterface(val codec: PigeonProxyApiBaseCodec) { @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ProxyApiInterface and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) {} + fun pigeon_newInstance(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { + if (codec.instanceManager.containsInstance(pigeon_instanceArg)) { + Result.success(Unit) + return + } + val pigeon_identifierArg = codec.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.pigeon_newInstance$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + fun anInterfaceMethod(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { + val binaryMessenger = codec.binaryMessenger + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.anInterfaceMethod$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } } diff --git a/packages/pigeon/test/kotlin/proxy_api_test.dart b/packages/pigeon/test/kotlin/proxy_api_test.dart index 836f64a3a15f..f4b6642c58cf 100644 --- a/packages/pigeon/test/kotlin/proxy_api_test.dart +++ b/packages/pigeon/test/kotlin/proxy_api_test.dart @@ -92,6 +92,7 @@ void main() { dartPackageName: DEFAULT_PACKAGE_NAME, ); final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); // Instance Manager expect(code, contains(r'class PigeonInstanceManager')); @@ -105,6 +106,826 @@ void main() { r'abstract class PigeonApiApi(val codec: PigeonProxyApiBaseCodec)', ), ); + + // Constructors + expect( + collapsedCode, + contains( + r'abstract fun name(someField: Long, input: Input)', + ), + ); + expect( + collapsedCode, + contains( + r'fun pigeon_newInstance(pigeon_instanceArg: my.library.Api, callback: (Result) -> Unit)', + ), + ); + + // Field + expect( + code, + contains( + 'abstract fun someField(pigeon_instance: my.library.Api): Long', + ), + ); + + // Dart -> Host method + expect( + collapsedCode, + contains('api.doSomething(pigeon_instanceArg, inputArg)'), + ); + + // Host -> Dart method + expect( + code, + contains( + r'fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiApi?)', + ), + ); + expect( + code, + contains( + 'fun doSomethingElse(pigeon_instanceArg: my.library.Api, inputArg: Input, callback: (Result) -> Unit)', + ), + ); + }); + + group('inheritance', () { + test('extends', () { + final AstProxyApi api2 = AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ); + final Root root = Root(apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [], + superClass: TypeDeclaration( + baseName: api2.name, + isNullable: false, + associatedProxyApi: api2, + ), + ), + api2, + ], classes: [], enums: []); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + collapsedCode, + contains('fun pigeon_getPigeonApiApi2(): PigeonApiApi2'), + ); + }); + + test('implements', () { + final AstProxyApi api2 = AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ); + final Root root = Root(apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [], + interfaces: { + TypeDeclaration( + baseName: api2.name, + isNullable: false, + associatedProxyApi: api2, + ) + }, + ), + api2, + ], classes: [], enums: []); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + expect(code, contains('fun pigeon_getPigeonApiApi2(): PigeonApiApi2')); + }); + + test('implements 2 ProxyApis', () { + final AstProxyApi api2 = AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ); + final AstProxyApi api3 = AstProxyApi( + name: 'Api3', + constructors: [], + fields: [], + methods: [], + ); + final Root root = Root(apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [], + interfaces: { + TypeDeclaration( + baseName: api2.name, + isNullable: false, + associatedProxyApi: api2, + ), + TypeDeclaration( + baseName: api3.name, + isNullable: false, + associatedProxyApi: api3, + ), + }, + ), + api2, + api3, + ], classes: [], enums: []); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + expect(code, contains('fun pigeon_getPigeonApiApi2(): PigeonApiApi2')); + expect(code, contains('fun pigeon_getPigeonApiApi3(): PigeonApiApi3')); + }); + }); + + group('Constructors', () { + test('empty name and no params constructor', () { + final Root root = Root( + apis: [ + AstProxyApi(name: 'Api', constructors: [ + Constructor( + name: '', + parameters: [], + ) + ], fields: [], methods: []), + ], + classes: [], + enums: [], + ); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + code, + contains( + 'abstract class PigeonApiApi(val codec: PigeonProxyApiBaseCodec) ', + ), + ); + expect( + collapsedCode, + contains('abstract fun pigeon_defaultConstructor(): Api'), + ); + expect( + collapsedCode, + contains( + r'val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.test_package.Api.pigeon_defaultConstructor"', + ), + ); + expect( + collapsedCode, + contains( + r'api.codec.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(', + ), + ); + }); + + test('multiple params constructor', () { + final Enum anEnum = Enum( + name: 'AnEnum', + members: [EnumMember(name: 'one')], + ); + final Root root = Root( + apis: [ + AstProxyApi(name: 'Api', constructors: [ + Constructor( + name: 'name', + parameters: [ + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'int', + ), + name: 'validType', + ), + Parameter( + type: TypeDeclaration( + isNullable: false, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'enumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'Api2', + ), + name: 'proxyApiType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'int', + ), + name: 'nullableValidType', + ), + Parameter( + type: TypeDeclaration( + isNullable: true, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'nullableEnumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'Api2', + ), + name: 'nullableProxyApiType', + ), + ], + ) + ], fields: [], methods: []), + AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ), + ], + classes: [], + enums: [anEnum], + ); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + code, + contains( + 'abstract class PigeonApiApi(val codec: PigeonProxyApiBaseCodec) ', + ), + ); + expect( + collapsedCode, + contains( + 'abstract fun name(validType: Long, enumType: AnEnum, ' + 'proxyApiType: Api2, nullableValidType: Long?, ' + 'nullableEnumType: AnEnum?, nullableProxyApiType: Api2?): Api', + ), + ); + expect( + collapsedCode, + contains( + r'api.codec.instanceManager.addDartCreatedInstance(api.name(' + r'validTypeArg,enumTypeArg,proxyApiTypeArg,nullableValidTypeArg,' + r'nullableEnumTypeArg,nullableProxyApiTypeArg), pigeon_identifierArg)', + ), + ); + }); + }); + + group('Fields', () { + test('constructor with fields', () { + final Enum anEnum = Enum( + name: 'AnEnum', + members: [EnumMember(name: 'one')], + ); + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + constructors: [ + Constructor( + name: 'name', + parameters: [], + ) + ], + fields: [ + ApiField( + type: const TypeDeclaration( + isNullable: false, + baseName: 'int', + ), + name: 'validType', + ), + ApiField( + type: TypeDeclaration( + isNullable: false, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'enumType', + ), + ApiField( + type: const TypeDeclaration( + isNullable: false, + baseName: 'Api2', + ), + name: 'proxyApiType', + ), + ApiField( + type: const TypeDeclaration( + isNullable: true, + baseName: 'int', + ), + name: 'nullableValidType', + ), + ApiField( + type: TypeDeclaration( + isNullable: true, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'nullableEnumType', + ), + ApiField( + type: const TypeDeclaration( + isNullable: true, + baseName: 'Api2', + ), + name: 'nullableProxyApiType', + ), + ], + methods: [], + ), + AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ), + ], + classes: [], + enums: [anEnum], + ); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + collapsedCode, + contains( + 'abstract fun name(validType: Long, enumType: AnEnum, ' + 'proxyApiType: Api2, nullableValidType: Long?, ' + 'nullableEnumType: AnEnum?, nullableProxyApiType: Api2?): Api', + ), + ); + expect( + collapsedCode, + contains( + r'api.codec.instanceManager.addDartCreatedInstance(api.name(' + r'validTypeArg,enumTypeArg,proxyApiTypeArg,nullableValidTypeArg,' + r'nullableEnumTypeArg,nullableProxyApiTypeArg), pigeon_identifierArg)', + ), + ); + expect( + collapsedCode, + contains( + 'channel.send(listOf(pigeon_identifierArg, validTypeArg, ' + 'enumTypeArg.raw, proxyApiTypeArg, nullableValidTypeArg, ' + 'nullableEnumTypeArg?.raw, nullableProxyApiTypeArg))', + ), + ); + expect( + code, + contains(r'abstract fun validType(pigeon_instance: Api): Long'), + ); + expect( + code, + contains(r'abstract fun enumType(pigeon_instance: Api): AnEnum'), + ); + expect( + code, + contains(r'abstract fun proxyApiType(pigeon_instance: Api): Api2'), + ); + expect( + code, + contains( + r'abstract fun nullableValidType(pigeon_instance: Api): Long?', + ), + ); + expect( + code, + contains( + r'abstract fun nullableEnumType(pigeon_instance: Api): AnEnum?', + ), + ); + expect( + code, + contains( + r'abstract fun nullableProxyApiType(pigeon_instance: Api): Api2?', + ), + ); + }); + + test('attached field', () { + final AstProxyApi api2 = AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ); + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [ + ApiField( + name: 'aField', + isAttached: true, + type: TypeDeclaration( + baseName: 'Api2', + isNullable: false, + associatedProxyApi: api2, + ), + ), + ], + methods: [], + ), + api2, + ], + classes: [], + enums: [], + ); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + expect( + code, + contains(r'abstract fun aField(pigeon_instance: Api): Api2'), + ); + expect( + code, + contains( + r'api.codec.instanceManager.addDartCreatedInstance(api.aField(pigeon_instanceArg), pigeon_identifierArg)', + ), + ); + }); + + test('static attached field', () { + final AstProxyApi api2 = AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ); + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [ + ApiField( + name: 'aField', + isStatic: true, + isAttached: true, + type: TypeDeclaration( + baseName: 'Api2', + isNullable: false, + associatedProxyApi: api2, + ), + ), + ], + methods: [], + ), + api2, + ], + classes: [], + enums: [], + ); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + expect( + code, + contains(r'abstract fun aField(): Api2'), + ); + expect( + code, + contains( + r'api.codec.instanceManager.addDartCreatedInstance(api.aField(), pigeon_identifierArg)', + ), + ); + }); + }); + + group('Host methods', () { + test('multiple params method', () { + final Enum anEnum = Enum( + name: 'AnEnum', + members: [EnumMember(name: 'one')], + ); + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [ + Method( + name: 'doSomething', + location: ApiLocation.host, + parameters: [ + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'int', + ), + name: 'validType', + ), + Parameter( + type: TypeDeclaration( + isNullable: false, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'enumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'Api2', + ), + name: 'proxyApiType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'int', + ), + name: 'nullableValidType', + ), + Parameter( + type: TypeDeclaration( + isNullable: true, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'nullableEnumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'Api2', + ), + name: 'nullableProxyApiType', + ), + ], + returnType: const TypeDeclaration.voidDeclaration(), + ), + ], + ), + AstProxyApi( + name: 'Api2', + constructors: [], + fields: [], + methods: [], + ), + ], + classes: [], + enums: [anEnum], + ); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + collapsedCode, + contains( + 'abstract fun doSomething(pigeon_instance: Api, validType: Long, ' + 'enumType: AnEnum, proxyApiType: Api2, nullableValidType: Long?, ' + 'nullableEnumType: AnEnum?, nullableProxyApiType: Api2?)', + ), + ); + expect( + collapsedCode, + contains( + r'api.doSomething(pigeon_instanceArg, validTypeArg, enumTypeArg, ' + r'proxyApiTypeArg, nullableValidTypeArg, nullableEnumTypeArg, ' + r'nullableProxyApiTypeArg)', + ), + ); + }); + + test('static method', () { + final Root root = Root( + apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [ + Method( + name: 'doSomething', + location: ApiLocation.host, + isStatic: true, + parameters: [], + returnType: const TypeDeclaration.voidDeclaration(), + ), + ], + ), + ], + classes: [], + enums: [], + ); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect(collapsedCode, contains('abstract fun doSomething()')); + expect(collapsedCode, contains(r'api.doSomething()')); + }); + }); + + group('Flutter methods', () { + test('multiple params flutter method', () { + final Enum anEnum = Enum( + name: 'AnEnum', + members: [EnumMember(name: 'one')], + ); + final Root root = Root(apis: [ + AstProxyApi( + name: 'Api', + constructors: [], + fields: [], + methods: [ + Method( + name: 'doSomething', + location: ApiLocation.flutter, + parameters: [ + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'int', + ), + name: 'validType', + ), + Parameter( + type: TypeDeclaration( + isNullable: false, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'enumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: false, + baseName: 'Api2', + ), + name: 'proxyApiType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'int', + ), + name: 'nullableValidType', + ), + Parameter( + type: TypeDeclaration( + isNullable: true, + baseName: 'AnEnum', + associatedEnum: anEnum, + ), + name: 'nullableEnumType', + ), + Parameter( + type: const TypeDeclaration( + isNullable: true, + baseName: 'Api2', + ), + name: 'nullableProxyApiType', + ), + ], + returnType: const TypeDeclaration.voidDeclaration(), + ) + ]) + ], classes: [], enums: [ + anEnum + ]); + final StringBuffer sink = StringBuffer(); + const KotlinGenerator generator = KotlinGenerator(); + generator.generate( + const KotlinOptions(), + root, + sink, + dartPackageName: DEFAULT_PACKAGE_NAME, + ); + final String code = sink.toString(); + final String collapsedCode = _collapseNewlineAndIndentation(code); + expect( + collapsedCode, + contains( + 'fun doSomething(pigeon_instanceArg: Api, validTypeArg: Long, ' + 'enumTypeArg: AnEnum, proxyApiTypeArg: Api2, nullableValidTypeArg: Long?, ' + 'nullableEnumTypeArg: AnEnum?, nullableProxyApiTypeArg: Api2?, ' + 'callback: (Result) -> Unit)', + ), + ); + expect( + collapsedCode, + contains( + r'channel.send(listOf(pigeon_instanceArg, validTypeArg, enumTypeArg.raw, ' + r'proxyApiTypeArg, nullableValidTypeArg, nullableEnumTypeArg?.raw, ' + r'nullableProxyApiTypeArg))', + ), + ); + }); }); }); } + +/// Replaces a new line and the indentation with a single white space +/// +/// This +/// +/// ```dart +/// void method( +/// int param1, +/// int param2, +/// ) +/// ``` +/// +/// converts to +/// +/// ```dart +/// void method( int param1, int param2, ) +/// ``` +String _collapseNewlineAndIndentation(String string) { + final StringBuffer result = StringBuffer(); + for (final String line in string.split('\n')) { + result.write('${line.trimLeft()} '); + } + return result.toString().trim(); +} From aea71cd99c72615a741444cd797461d9f7ce760e Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 15 Apr 2024 13:34:21 -0400 Subject: [PATCH 09/77] changelogg --- packages/pigeon/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md index 2e94772f618e..c869aea22e6c 100644 --- a/packages/pigeon/CHANGELOG.md +++ b/packages/pigeon/CHANGELOG.md @@ -1,6 +1,6 @@ ## 18.1.0 -* [kotlin] Adds skeleton implementation for `@ProxyApi`. +* [kotlin] Adds implementation for `@ProxyApi`. ## 18.0.0 From 0c09e9182e40e38bf2e5a2962d11b9cbeffdd7f3 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 15 Apr 2024 20:25:32 -0400 Subject: [PATCH 10/77] formatting --- .../test_plugin/ProxyApiTestApiImpls.kt | 388 +++++++++--------- 1 file changed, 194 insertions(+), 194 deletions(-) diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt index f5ebd677313d..0843e4aac794 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt @@ -13,7 +13,7 @@ open class ProxyApiSuperClass interface ProxyApiInterface class ProxyApiCodec(binaryMessenger: BinaryMessenger, instanceManager: PigeonInstanceManager) : - PigeonProxyApiBaseCodec(binaryMessenger, instanceManager) { + PigeonProxyApiBaseCodec(binaryMessenger, instanceManager) { override fun getPigeonApiProxyApiTestClass(): PigeonApiProxyApiTestClass { return ProxyApiTestClassApi(this) } @@ -30,42 +30,42 @@ class ProxyApiCodec(binaryMessenger: BinaryMessenger, instanceManager: PigeonIns class ProxyApiTestClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiTestClass(codec) { override fun pigeon_defaultConstructor( - aBool: Boolean, - anInt: Long, - aDouble: Double, - aString: String, - aUint8List: ByteArray, - aList: List, - aMap: Map, - anEnum: ProxyApiTestEnum, - aProxyApi: ProxyApiSuperClass, - aNullableBool: Boolean?, - aNullableInt: Long?, - aNullableDouble: Double?, - aNullableString: String?, - aNullableUint8List: ByteArray?, - aNullableList: List?, - aNullableMap: Map?, - aNullableEnum: ProxyApiTestEnum?, - aNullableProxyApi: ProxyApiSuperClass?, - boolParam: Boolean, - intParam: Long, - doubleParam: Double, - stringParam: String, - aUint8ListParam: ByteArray, - listParam: List, - mapParam: Map, - enumParam: ProxyApiTestEnum, - proxyApiParam: ProxyApiSuperClass, - nullableBoolParam: Boolean?, - nullableIntParam: Long?, - nullableDoubleParam: Double?, - nullableStringParam: String?, - nullableUint8ListParam: ByteArray?, - nullableListParam: List?, - nullableMapParam: Map?, - nullableEnumParam: ProxyApiTestEnum?, - nullableProxyApiParam: ProxyApiSuperClass? + aBool: Boolean, + anInt: Long, + aDouble: Double, + aString: String, + aUint8List: ByteArray, + aList: List, + aMap: Map, + anEnum: ProxyApiTestEnum, + aProxyApi: ProxyApiSuperClass, + aNullableBool: Boolean?, + aNullableInt: Long?, + aNullableDouble: Double?, + aNullableString: String?, + aNullableUint8List: ByteArray?, + aNullableList: List?, + aNullableMap: Map?, + aNullableEnum: ProxyApiTestEnum?, + aNullableProxyApi: ProxyApiSuperClass?, + boolParam: Boolean, + intParam: Long, + doubleParam: Double, + stringParam: String, + aUint8ListParam: ByteArray, + listParam: List, + mapParam: Map, + enumParam: ProxyApiTestEnum, + proxyApiParam: ProxyApiSuperClass, + nullableBoolParam: Boolean?, + nullableIntParam: Long?, + nullableDoubleParam: Double?, + nullableStringParam: String?, + nullableUint8ListParam: ByteArray?, + nullableListParam: List?, + nullableMapParam: Map?, + nullableEnumParam: ProxyApiTestEnum?, + nullableProxyApiParam: ProxyApiSuperClass? ): ProxyApiTestClass { return ProxyApiTestClass() } @@ -193,36 +193,36 @@ class ProxyApiTestClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiTe } override fun echoProxyApiList( - pigeon_instance: ProxyApiTestClass, - aList: List + pigeon_instance: ProxyApiTestClass, + aList: List ): List { return aList } override fun echoMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map + pigeon_instance: ProxyApiTestClass, + aMap: Map ): Map { return aMap } override fun echoProxyApiMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map + pigeon_instance: ProxyApiTestClass, + aMap: Map ): Map { return aMap } override fun echoEnum( - pigeon_instance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum ): ProxyApiTestEnum { return anEnum } override fun echoProxyApi( - pigeon_instance: ProxyApiTestClass, - aProxyApi: ProxyApiSuperClass + pigeon_instance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass ): ProxyApiSuperClass { return aProxyApi } @@ -232,29 +232,29 @@ class ProxyApiTestClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiTe } override fun echoNullableDouble( - pigeon_instance: ProxyApiTestClass, - aNullableDouble: Double? + pigeon_instance: ProxyApiTestClass, + aNullableDouble: Double? ): Double? { return aNullableDouble } override fun echoNullableBool( - pigeon_instance: ProxyApiTestClass, - aNullableBool: Boolean? + pigeon_instance: ProxyApiTestClass, + aNullableBool: Boolean? ): Boolean? { return aNullableBool } override fun echoNullableString( - pigeon_instance: ProxyApiTestClass, - aNullableString: String? + pigeon_instance: ProxyApiTestClass, + aNullableString: String? ): String? { return aNullableString } override fun echoNullableUint8List( - pigeon_instance: ProxyApiTestClass, - aNullableUint8List: ByteArray? + pigeon_instance: ProxyApiTestClass, + aNullableUint8List: ByteArray? ): ByteArray? { return aNullableUint8List } @@ -264,29 +264,29 @@ class ProxyApiTestClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiTe } override fun echoNullableList( - pigeon_instance: ProxyApiTestClass, - aNullableList: List? + pigeon_instance: ProxyApiTestClass, + aNullableList: List? ): List? { return aNullableList } override fun echoNullableMap( - pigeon_instance: ProxyApiTestClass, - aNullableMap: Map? + pigeon_instance: ProxyApiTestClass, + aNullableMap: Map? ): Map? { return aNullableMap } override fun echoNullableEnum( - pigeon_instance: ProxyApiTestClass, - aNullableEnum: ProxyApiTestEnum? + pigeon_instance: ProxyApiTestClass, + aNullableEnum: ProxyApiTestEnum? ): ProxyApiTestEnum? { return aNullableEnum } override fun echoNullableProxyApi( - pigeon_instance: ProxyApiTestClass, - aNullableProxyApi: ProxyApiSuperClass? + pigeon_instance: ProxyApiTestClass, + aNullableProxyApi: ProxyApiSuperClass? ): ProxyApiSuperClass? { return aNullableProxyApi } @@ -296,166 +296,166 @@ class ProxyApiTestClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiTe } override fun echoAsyncInt( - pigeon_instance: ProxyApiTestClass, - anInt: Long, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + anInt: Long, + callback: (Result) -> Unit ) { callback(Result.success(anInt)) } override fun echoAsyncDouble( - pigeon_instance: ProxyApiTestClass, - aDouble: Double, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aDouble: Double, + callback: (Result) -> Unit ) { callback(Result.success(aDouble)) } override fun echoAsyncBool( - pigeon_instance: ProxyApiTestClass, - aBool: Boolean, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aBool: Boolean, + callback: (Result) -> Unit ) { callback(Result.success(aBool)) } override fun echoAsyncString( - pigeon_instance: ProxyApiTestClass, - aString: String, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit ) { callback(Result.success(aString)) } override fun echoAsyncUint8List( - pigeon_instance: ProxyApiTestClass, - aUint8List: ByteArray, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray, + callback: (Result) -> Unit ) { callback(Result.success(aUint8List)) } override fun echoAsyncObject( - pigeon_instance: ProxyApiTestClass, - anObject: Any, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + anObject: Any, + callback: (Result) -> Unit ) { callback(Result.success(anObject)) } override fun echoAsyncList( - pigeon_instance: ProxyApiTestClass, - aList: List, - callback: (Result>) -> Unit + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit ) { callback(Result.success(aList)) } override fun echoAsyncMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map, - callback: (Result>) -> Unit + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit ) { callback(Result.success(aMap)) } override fun echoAsyncEnum( - pigeon_instance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, + callback: (Result) -> Unit ) { callback(Result.success(anEnum)) } override fun throwAsyncError( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit ) { callback(Result.failure(Exception("message"))) } override fun throwAsyncErrorFromVoid( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit ) { callback(Result.failure(Exception("message"))) } override fun throwAsyncFlutterError( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit ) { callback(Result.failure(ProxyApiTestsError("code", "message", "details"))) } override fun echoAsyncNullableInt( - pigeon_instance: ProxyApiTestClass, - anInt: Long?, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + anInt: Long?, + callback: (Result) -> Unit ) { callback(Result.success(anInt)) } override fun echoAsyncNullableDouble( - pigeon_instance: ProxyApiTestClass, - aDouble: Double?, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aDouble: Double?, + callback: (Result) -> Unit ) { callback(Result.success(aDouble)) } override fun echoAsyncNullableBool( - pigeon_instance: ProxyApiTestClass, - aBool: Boolean?, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aBool: Boolean?, + callback: (Result) -> Unit ) { callback(Result.success(aBool)) } override fun echoAsyncNullableString( - pigeon_instance: ProxyApiTestClass, - aString: String?, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aString: String?, + callback: (Result) -> Unit ) { callback(Result.success(aString)) } override fun echoAsyncNullableUint8List( - pigeon_instance: ProxyApiTestClass, - aUint8List: ByteArray?, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray?, + callback: (Result) -> Unit ) { callback(Result.success(aUint8List)) } override fun echoAsyncNullableObject( - pigeon_instance: ProxyApiTestClass, - anObject: Any?, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + anObject: Any?, + callback: (Result) -> Unit ) { callback(Result.success(anObject)) } override fun echoAsyncNullableList( - pigeon_instance: ProxyApiTestClass, - aList: List?, - callback: (Result?>) -> Unit + pigeon_instance: ProxyApiTestClass, + aList: List?, + callback: (Result?>) -> Unit ) { callback(Result.success(aList)) } override fun echoAsyncNullableMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map?, - callback: (Result?>) -> Unit + pigeon_instance: ProxyApiTestClass, + aMap: Map?, + callback: (Result?>) -> Unit ) { callback(Result.success(aMap)) } override fun echoAsyncNullableEnum( - pigeon_instance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum?, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, + callback: (Result) -> Unit ) { callback(Result.success(anEnum)) } @@ -471,15 +471,15 @@ class ProxyApiTestClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiTe } override fun callFlutterNoop( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit ) { flutterNoop(pigeon_instance, callback) } override fun callFlutterThrowError( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit ) { flutterThrowError(pigeon_instance) { result -> val exception = result.exceptionOrNull() @@ -488,8 +488,8 @@ class ProxyApiTestClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiTe } override fun callFlutterThrowErrorFromVoid( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit ) { flutterThrowErrorFromVoid(pigeon_instance) { result -> val exception = result.exceptionOrNull() @@ -498,176 +498,176 @@ class ProxyApiTestClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiTe } override fun callFlutterEchoBool( - pigeon_instance: ProxyApiTestClass, - aBool: Boolean, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aBool: Boolean, + callback: (Result) -> Unit ) { flutterEchoBool(pigeon_instance, aBool, callback) } override fun callFlutterEchoInt( - pigeon_instance: ProxyApiTestClass, - anInt: Long, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + anInt: Long, + callback: (Result) -> Unit ) { flutterEchoInt(pigeon_instance, anInt, callback) } override fun callFlutterEchoDouble( - pigeon_instance: ProxyApiTestClass, - aDouble: Double, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aDouble: Double, + callback: (Result) -> Unit ) { flutterEchoDouble(pigeon_instance, aDouble, callback) } override fun callFlutterEchoString( - pigeon_instance: ProxyApiTestClass, - aString: String, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit ) { flutterEchoString(pigeon_instance, aString, callback) } override fun callFlutterEchoUint8List( - pigeon_instance: ProxyApiTestClass, - aUint8List: ByteArray, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray, + callback: (Result) -> Unit ) { flutterEchoUint8List(pigeon_instance, aUint8List, callback) } override fun callFlutterEchoList( - pigeon_instance: ProxyApiTestClass, - aList: List, - callback: (Result>) -> Unit + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit ) { flutterEchoList(pigeon_instance, aList, callback) } override fun callFlutterEchoProxyApiList( - pigeon_instance: ProxyApiTestClass, - aList: List, - callback: (Result>) -> Unit + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit ) { flutterEchoProxyApiList(pigeon_instance, aList, callback) } override fun callFlutterEchoMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map, - callback: (Result>) -> Unit + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit ) { flutterEchoMap(pigeon_instance, aMap, callback) } override fun callFlutterEchoProxyApiMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map, - callback: (Result>) -> Unit + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit ) { flutterEchoProxyApiMap(pigeon_instance, aMap, callback) } override fun callFlutterEchoEnum( - pigeon_instance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, + callback: (Result) -> Unit ) { flutterEchoEnum(pigeon_instance, anEnum, callback) } override fun callFlutterEchoProxyApi( - pigeon_instance: ProxyApiTestClass, - aProxyApi: ProxyApiSuperClass, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass, + callback: (Result) -> Unit ) { flutterEchoProxyApi(pigeon_instance, aProxyApi, callback) } override fun callFlutterEchoNullableBool( - pigeon_instance: ProxyApiTestClass, - aBool: Boolean?, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aBool: Boolean?, + callback: (Result) -> Unit ) { flutterEchoNullableBool(pigeon_instance, aBool, callback) } override fun callFlutterEchoNullableInt( - pigeon_instance: ProxyApiTestClass, - anInt: Long?, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + anInt: Long?, + callback: (Result) -> Unit ) { flutterEchoNullableInt(pigeon_instance, anInt, callback) } override fun callFlutterEchoNullableDouble( - pigeon_instance: ProxyApiTestClass, - aDouble: Double?, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aDouble: Double?, + callback: (Result) -> Unit ) { flutterEchoNullableDouble(pigeon_instance, aDouble, callback) } override fun callFlutterEchoNullableString( - pigeon_instance: ProxyApiTestClass, - aString: String?, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aString: String?, + callback: (Result) -> Unit ) { flutterEchoNullableString(pigeon_instance, aString, callback) } override fun callFlutterEchoNullableUint8List( - pigeon_instance: ProxyApiTestClass, - aUint8List: ByteArray?, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray?, + callback: (Result) -> Unit ) { flutterEchoNullableUint8List(pigeon_instance, aUint8List, callback) } override fun callFlutterEchoNullableList( - pigeon_instance: ProxyApiTestClass, - aList: List?, - callback: (Result?>) -> Unit + pigeon_instance: ProxyApiTestClass, + aList: List?, + callback: (Result?>) -> Unit ) { flutterEchoNullableList(pigeon_instance, aList, callback) } override fun callFlutterEchoNullableMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map?, - callback: (Result?>) -> Unit + pigeon_instance: ProxyApiTestClass, + aMap: Map?, + callback: (Result?>) -> Unit ) { flutterEchoNullableMap(pigeon_instance, aMap, callback) } override fun callFlutterEchoNullableEnum( - pigeon_instance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum?, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, + callback: (Result) -> Unit ) { flutterEchoNullableEnum(pigeon_instance, anEnum, callback) } override fun callFlutterEchoNullableProxyApi( - pigeon_instance: ProxyApiTestClass, - aProxyApi: ProxyApiSuperClass?, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aProxyApi: ProxyApiSuperClass?, + callback: (Result) -> Unit ) { flutterEchoNullableProxyApi(pigeon_instance, aProxyApi, callback) } override fun callFlutterNoopAsync( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit ) { flutterNoopAsync(pigeon_instance, callback) } override fun callFlutterEchoAsyncString( - pigeon_instance: ProxyApiTestClass, - aString: String, - callback: (Result) -> Unit + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit ) { flutterEchoAsyncString(pigeon_instance, aString, callback) } From d57ac0dba5050f9f236b8adc9bddcf75f0872db2 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 15 Apr 2024 20:59:41 -0400 Subject: [PATCH 11/77] fix proxy api separated suffix --- packages/pigeon/lib/kotlin_generator.dart | 35 ++- .../example/test_plugin/ProxyApiTests.gen.kt | 281 +++++++----------- 2 files changed, 134 insertions(+), 182 deletions(-) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 2ac682b2ade9..33dd37cd4e98 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -403,6 +403,24 @@ class KotlinGenerator extends StructuredGenerator { channelName: makeChannelName(api, method, dartPackageName), documentationComments: method.documentationComments, dartPackageName: dartPackageName, + onWriteBody: ( + Indent indent, { + required List parameters, + required TypeDeclaration returnType, + required String channelName, + required String errorClassName, + }) { + indent.writeln( + r'val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else ""', + ); + _writeFlutterMethodMessageCall( + indent, + parameters: parameters, + returnType: returnType, + channelName: '$channelName\$separatedMessageChannelSuffix', + errorClassName: errorClassName, + ); + }, ); } }); @@ -474,9 +492,9 @@ class KotlinGenerator extends StructuredGenerator { for (final Method method in api.methods) { _writeHostMethodMessageHandler( indent, - api: api, name: method.name, - channelName: makeChannelName(api, method, dartPackageName), + channelName: + '${makeChannelName(api, method, dartPackageName)}\$separatedMessageChannelSuffix', taskQueueType: method.taskQueueType, parameters: method.parameters, returnType: method.returnType, @@ -926,7 +944,6 @@ class KotlinGenerator extends StructuredGenerator { void _writeHostMethodMessageHandler( Indent indent, { - required Api api, required String name, required String channelName, required TaskQueueType taskQueueType, @@ -944,8 +961,10 @@ class KotlinGenerator extends StructuredGenerator { indent.writeln( 'val $taskQueue = binaryMessenger.makeBackgroundTaskQueue()'); } + indent.write( - 'val channel = BasicMessageChannel(binaryMessenger, "$channelName\$separatedMessageChannelSuffix", codec'); + 'val channel = BasicMessageChannel(binaryMessenger, "$channelName", codec', + ); if (taskQueue != null) { indent.addln(', $taskQueue)'); @@ -1088,10 +1107,7 @@ class KotlinGenerator extends StructuredGenerator { } const String channel = 'channel'; - indent.writeln( - r'val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else ""'); - indent.writeln( - 'val channelName = "$channelName\$separatedMessageChannelSuffix"'); + indent.writeln('val channelName = "$channelName"'); indent.writeln( 'val $channel = BasicMessageChannel(binaryMessenger, channelName, codec)'); indent.writeScoped('$channel.send($sendArgument) {', '}', () { @@ -1335,7 +1351,6 @@ class KotlinGenerator extends StructuredGenerator { onWrite: () { _writeHostMethodMessageHandler( indent, - api: api, name: name, channelName: channelName, taskQueueType: TaskQueueType.serial, @@ -1380,7 +1395,6 @@ class KotlinGenerator extends StructuredGenerator { onWrite: () { _writeHostMethodMessageHandler( indent, - api: api, name: field.name, channelName: channelName, taskQueueType: TaskQueueType.serial, @@ -1426,7 +1440,6 @@ class KotlinGenerator extends StructuredGenerator { onWrite: () { _writeHostMethodMessageHandler( indent, - api: api, name: method.name, channelName: makeChannelName(api, method, dartPackageName), taskQueueType: method.taskQueueType, diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 25e1b349cdad..f72ce7a71dd0 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -947,7 +947,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_defaultConstructor$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_defaultConstructor", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1046,7 +1046,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.attachedField$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.attachedField", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1071,7 +1071,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAttachedField$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAttachedField", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1095,7 +1095,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noop$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noop", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1118,7 +1118,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwError$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwError", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1140,7 +1140,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwErrorFromVoid$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwErrorFromVoid", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1163,7 +1163,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwFlutterError$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwFlutterError", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1185,7 +1185,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoInt$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoInt", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1208,7 +1208,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoDouble$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoDouble", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1231,7 +1231,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoBool$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoBool", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1254,7 +1254,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoString", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1277,7 +1277,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoUint8List$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoUint8List", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1300,7 +1300,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoObject$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoObject", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1323,7 +1323,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoList$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoList", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1346,7 +1346,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiList$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiList", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1369,7 +1369,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoMap$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoMap", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1392,7 +1392,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiMap$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiMap", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1415,7 +1415,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoEnum", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1438,7 +1438,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApi$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApi", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1461,7 +1461,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableInt$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableInt", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1484,7 +1484,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableDouble$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableDouble", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1507,7 +1507,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableBool$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableBool", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1530,7 +1530,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableString", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1553,7 +1553,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableUint8List$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableUint8List", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1577,7 +1577,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableObject$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableObject", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1600,7 +1600,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableList$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableList", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1623,7 +1623,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableMap$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableMap", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1646,7 +1646,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableEnum", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1671,7 +1671,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableProxyApi$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableProxyApi", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1695,7 +1695,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noopAsync$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noopAsync", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1718,7 +1718,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncInt$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncInt", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1743,7 +1743,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncDouble$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncDouble", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1768,7 +1768,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncBool$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncBool", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1793,7 +1793,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncString", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1818,7 +1818,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncUint8List$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncUint8List", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1843,7 +1843,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncObject$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncObject", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1868,7 +1868,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncList$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncList", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1893,7 +1893,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncMap$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncMap", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1918,7 +1918,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncEnum", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1943,7 +1943,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncError$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncError", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1967,7 +1967,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncErrorFromVoid$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncErrorFromVoid", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -1990,7 +1990,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncFlutterError$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncFlutterError", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2014,7 +2014,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableInt$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableInt", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2039,7 +2039,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableDouble$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableDouble", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2064,7 +2064,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableBool$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableBool", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2089,7 +2089,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableString", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2114,7 +2114,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableUint8List$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableUint8List", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2140,7 +2140,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableObject$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableObject", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2165,7 +2165,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableList$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableList", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2190,7 +2190,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableMap$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableMap", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2216,7 +2216,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableEnum", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2242,7 +2242,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticNoop$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticNoop", codec) if (api != null) { channel.setMessageHandler { _, reply -> @@ -2263,7 +2263,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoStaticString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoStaticString", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2285,7 +2285,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAsyncNoop$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAsyncNoop", codec) if (api != null) { channel.setMessageHandler { _, reply -> @@ -2306,7 +2306,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoop$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoop", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2329,7 +2329,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowError$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowError", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2353,7 +2353,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowErrorFromVoid$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowErrorFromVoid", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2376,7 +2376,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoBool$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoBool", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2401,7 +2401,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoInt$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoInt", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2426,7 +2426,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoDouble$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoDouble", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2451,7 +2451,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoString", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2476,7 +2476,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoUint8List$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoUint8List", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2502,7 +2502,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoList$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoList", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2527,7 +2527,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiList$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiList", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2553,7 +2553,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoMap$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoMap", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2579,7 +2579,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiMap$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiMap", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2605,7 +2605,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoEnum", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2631,7 +2631,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApi$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApi", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2657,7 +2657,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableBool$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableBool", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2683,7 +2683,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableInt$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableInt", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2708,7 +2708,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableDouble$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableDouble", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2734,7 +2734,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableString", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2760,7 +2760,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableUint8List$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableUint8List", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2786,7 +2786,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableList$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableList", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2812,7 +2812,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableMap$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableMap", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2838,7 +2838,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableEnum$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableEnum", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2864,7 +2864,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableProxyApi$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableProxyApi", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2890,7 +2890,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoopAsync$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoopAsync", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2913,7 +2913,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoAsyncString$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoAsyncString", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -2965,10 +2965,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val aNullableEnumArg = aNullableEnum(pigeon_instanceArg) val aNullableProxyApiArg = aNullableProxyApi(pigeon_instanceArg) val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_newInstance$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send( listOf( @@ -3008,10 +3006,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ fun flutterNoop(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoop$separatedMessageChannelSuffix" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoop" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { @@ -3031,10 +3026,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { /** Responds with an error from an async function returning a value. */ fun flutterThrowError(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowError$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowError" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { @@ -3058,10 +3051,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowErrorFromVoid$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowErrorFromVoid" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { @@ -3085,10 +3076,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoBool$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoBool" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aBoolArg)) { if (it is List<*>) { @@ -3120,10 +3109,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoInt$separatedMessageChannelSuffix" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoInt" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, anIntArg)) { if (it is List<*>) { @@ -3155,10 +3141,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoDouble$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoDouble" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aDoubleArg)) { if (it is List<*>) { @@ -3190,10 +3174,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoString$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoString" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aStringArg)) { if (it is List<*>) { @@ -3225,10 +3207,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoUint8List$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoUint8List" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aListArg)) { if (it is List<*>) { @@ -3260,10 +3240,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result>) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoList$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoList" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aListArg)) { if (it is List<*>) { @@ -3295,10 +3273,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result>) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiList$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiList" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aListArg)) { if (it is List<*>) { @@ -3330,10 +3306,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result>) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoMap$separatedMessageChannelSuffix" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoMap" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aMapArg)) { if (it is List<*>) { @@ -3365,10 +3338,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result>) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiMap$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiMap" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aMapArg)) { if (it is List<*>) { @@ -3400,10 +3371,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoEnum$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoEnum" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, anEnumArg.raw)) { if (it is List<*>) { @@ -3435,10 +3404,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApi$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApi" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aProxyApiArg)) { if (it is List<*>) { @@ -3470,10 +3437,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableBool$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableBool" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aBoolArg)) { if (it is List<*>) { @@ -3498,10 +3463,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableInt$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableInt" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, anIntArg)) { if (it is List<*>) { @@ -3526,10 +3489,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableDouble$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableDouble" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aDoubleArg)) { if (it is List<*>) { @@ -3554,10 +3515,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableString$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableString" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aStringArg)) { if (it is List<*>) { @@ -3582,10 +3541,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableUint8List$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableUint8List" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aListArg)) { if (it is List<*>) { @@ -3610,10 +3567,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result?>) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableList$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableList" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aListArg)) { if (it is List<*>) { @@ -3638,10 +3593,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result?>) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableMap$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableMap" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aMapArg)) { if (it is List<*>) { @@ -3666,10 +3619,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableEnum$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableEnum" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, anEnumArg?.raw)) { if (it is List<*>) { @@ -3694,10 +3645,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableProxyApi$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableProxyApi" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aProxyApiArg)) { if (it is List<*>) { @@ -3721,10 +3670,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { */ fun flutterNoopAsync(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoopAsync$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoopAsync" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { @@ -3748,10 +3695,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { callback: (Result) -> Unit ) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoAsyncString$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoAsyncString" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aStringArg)) { if (it is List<*>) { @@ -3803,7 +3748,7 @@ abstract class PigeonApiProxyApiSuperClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_defaultConstructor$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_defaultConstructor", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -3827,7 +3772,7 @@ abstract class PigeonApiProxyApiSuperClass(val codec: PigeonProxyApiBaseCodec) { val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.aSuperMethod$separatedMessageChannelSuffix", + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.aSuperMethod", codec) if (api != null) { channel.setMessageHandler { message, reply -> @@ -3861,10 +3806,8 @@ abstract class PigeonApiProxyApiSuperClass(val codec: PigeonProxyApiBaseCodec) { } val pigeon_identifierArg = codec.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_newInstance$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { @@ -3893,10 +3836,8 @@ abstract class PigeonApiProxyApiInterface(val codec: PigeonProxyApiBaseCodec) { } val pigeon_identifierArg = codec.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.pigeon_newInstance$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { @@ -3915,10 +3856,8 @@ abstract class PigeonApiProxyApiInterface(val codec: PigeonProxyApiBaseCodec) { fun anInterfaceMethod(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { val binaryMessenger = codec.binaryMessenger - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.anInterfaceMethod$separatedMessageChannelSuffix" + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.anInterfaceMethod" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { From ff1e2106d629b0617e74513a89262aae226cf8f1 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 16 Apr 2024 14:14:28 -0400 Subject: [PATCH 12/77] switch to a registrar --- packages/pigeon/lib/kotlin/templates.dart | 65 ++--- packages/pigeon/lib/kotlin_generator.dart | 163 +++++++---- .../test_plugin/ProxyApiTestApiImpls.kt | 13 +- .../example/test_plugin/ProxyApiTests.gen.kt | 254 +++++++++++------- .../com/example/test_plugin/TestPlugin.kt | 13 +- 5 files changed, 307 insertions(+), 201 deletions(-) diff --git a/packages/pigeon/lib/kotlin/templates.dart b/packages/pigeon/lib/kotlin/templates.dart index c6ad81a6c159..09e4335aafc0 100644 --- a/packages/pigeon/lib/kotlin/templates.dart +++ b/packages/pigeon/lib/kotlin/templates.dart @@ -65,27 +65,6 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization fun create(finalizationListener: $_finalizationListenerClassName): $instanceManagerClassName { return $instanceManagerClassName(finalizationListener) } - - /** - * Instantiate a new manager with an `$instanceManagerClassName`. - * - * @param api handles removing garbage collected weak references. - * @return a new `$instanceManagerClassName`. - */ - fun create(api: ${instanceManagerClassName}Api): $instanceManagerClassName { - val instanceManager = create( - object : $_finalizationListenerClassName { - override fun onFinalize(identifier: Long) { - api.removeStrongReference(identifier) { - if (it.isFailure) { - Log.e(tag, "Failed to remove Dart strong reference with identifier: \$identifier") - } - } - } - }) - $_instanceManagerApiName.setUpMessageHandlers(api.binaryMessenger, instanceManager) - return instanceManager - } } /** @@ -282,7 +261,7 @@ String instanceManagerApiTemplate({ /** * Generated API for managing the Dart and native `$instanceManagerClassName`s. */ -class $_instanceManagerApiName(internal val binaryMessenger: BinaryMessenger) { +private class $_instanceManagerApiName(val binaryMessenger: BinaryMessenger) { companion object { /** The codec used by $_instanceManagerApiName. */ private val codec: MessageCodec by lazy { @@ -293,30 +272,38 @@ class $_instanceManagerApiName(internal val binaryMessenger: BinaryMessenger) { * Sets up an instance of `$_instanceManagerApiName` to handle messages from the * `binaryMessenger`. */ - fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: $instanceManagerClassName) { + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: $instanceManagerClassName?) { run { val channel = BasicMessageChannel(binaryMessenger, "$removeStrongReferenceName", codec) - channel.setMessageHandler { message, reply -> - val identifier = message as Number - val wrapped: List = try { - instanceManager.remove(identifier.toLong()) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) + if (instanceManager != null) { + channel.setMessageHandler { message, reply -> + val identifier = message as Number + val wrapped: List = try { + instanceManager.remove(identifier.toLong()) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } - reply.reply(wrapped) - } + } else { + channel.setMessageHandler(null) + } } run { val channel = BasicMessageChannel(binaryMessenger, "$clearName", codec) - channel.setMessageHandler { _, reply -> - val wrapped: List = try { - instanceManager.clear() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) + if (instanceManager != null) { + channel.setMessageHandler { _, reply -> + val wrapped: List = try { + instanceManager.clear() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) } - reply.reply(wrapped) + } else { + channel.setMessageHandler(null) } } } diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 33dd37cd4e98..d59ff45dcc73 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -535,11 +535,13 @@ class KotlinGenerator extends StructuredGenerator { Root root, Indent indent, ) { - const String codecName = '${classNamePrefix}ProxyApiBaseCodec'; - final Iterable allProxyApis = root.apis.whereType(); + _writeProxyApiRegistrar(indent, allProxyApis: allProxyApis); + + const String codecName = '${classNamePrefix}ProxyApiBaseCodec'; + // Sort APIs where edges are an API's super class and interfaces. // // This sorts the apis to have child classes be listed before their parent @@ -569,45 +571,14 @@ class KotlinGenerator extends StructuredGenerator { ); indent.writeScoped( - 'abstract class $codecName(val binaryMessenger: BinaryMessenger, val instanceManager: $instanceManagerClassName) : StandardMessageCodec() {', + 'private class $codecName(val registrar: PigeonProxyApiRegistrar) : StandardMessageCodec() {', '}', () { - for (final AstProxyApi api in sortedApis) { - _writeMethodDeclaration( - indent, - name: 'get$hostProxyApiPrefix${api.name}', - isAbstract: true, - documentationComments: [ - 'An implementation of [$hostProxyApiPrefix${api.name}] used to add a new Dart instance of', - '`${api.name}` to the Dart `InstanceManager`.' - ], - returnType: TypeDeclaration( - baseName: '$hostProxyApiPrefix${api.name}', - isNullable: false, - ), - parameters: [], - ); - indent.newln(); - } - - indent.writeScoped('fun setUpMessageHandlers() {', '}', () { - for (final AstProxyApi api in sortedApis) { - final bool hasHostMessageCalls = api.constructors.isNotEmpty || - api.attachedFields.isNotEmpty || - api.hostMethods.isNotEmpty; - if (hasHostMessageCalls) { - indent.writeln( - '$hostProxyApiPrefix${api.name}.setUpMessageHandlers(binaryMessenger, get$hostProxyApiPrefix${api.name}())', - ); - } - } - }); - indent.format( 'override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? {\n' ' return when (type) {\n' ' 128.toByte() -> {\n' - ' return instanceManager.getInstance(\n' + ' return registrar.instanceManager.getInstance(\n' ' readValue(buffer).let { if (it is Int) it.toLong() else it as Long })\n' ' }\n' ' else -> super.readValueOfType(type, buffer)\n' @@ -633,7 +604,7 @@ class KotlinGenerator extends StructuredGenerator { indent.format( '${index > 0 ? ' else ' : ''}if (${versionCheck}value is $className) {\n' - ' get$hostProxyApiPrefix${api.name}().${classMemberNamePrefix}newInstance(value) { }\n' + ' registrar.get$hostProxyApiPrefix${api.name}().${classMemberNamePrefix}newInstance(value) { }\n' '}', ); }, @@ -642,9 +613,9 @@ class KotlinGenerator extends StructuredGenerator { indent.format( 'when {\n' - ' instanceManager.containsInstance(value) -> {\n' + ' registrar.instanceManager.containsInstance(value) -> {\n' ' stream.write(128)\n' - ' writeValue(stream, instanceManager.getIdentifierForStrongReference(value))\n' + ' writeValue(stream, registrar.instanceManager.getIdentifierForStrongReference(value))\n' ' }\n' ' else -> super.writeValue(stream, value)\n' '}', @@ -663,7 +634,6 @@ class KotlinGenerator extends StructuredGenerator { AstProxyApi api, { required String dartPackageName, }) { - const String codecName = '${classNamePrefix}ProxyApiBaseCodec'; final String kotlinApiName = '$hostProxyApiPrefix${api.name}'; addDocumentationComments( @@ -673,7 +643,7 @@ class KotlinGenerator extends StructuredGenerator { ); indent.writeln('@Suppress("UNCHECKED_CAST")'); indent.writeScoped( - 'abstract class $kotlinApiName(val codec: $codecName) {', + 'abstract class $kotlinApiName(val pigeonRegistrar: ${classNamePrefix}ProxyApiRegistrar) {', '}', () { final String fullKotlinClassName = @@ -1148,6 +1118,99 @@ class KotlinGenerator extends StructuredGenerator { }); } + void _writeProxyApiRegistrar( + Indent indent, { + required Iterable allProxyApis, + }) { + const String registrarName = '${classNamePrefix}ProxyApiRegistrar'; + + indent.writeScoped( + 'abstract class $registrarName(val binaryMessenger: BinaryMessenger) {', + '}', + () { + indent.writeln('val instanceManager: PigeonInstanceManager'); + indent.format( + 'private var _codec: StandardMessageCodec? = null\n' + 'val codec: StandardMessageCodec\n' + ' get() {\n' + ' if (_codec == null) {\n ' + ' _codec = PigeonProxyApiBaseCodec(this)\n' + ' }\n' + ' return _codec!!\n' + ' }\n', + ); + indent.format( + 'init {\n' + ' val api = PigeonInstanceManagerApi(binaryMessenger)\n' + ' instanceManager =\n' + ' PigeonInstanceManager.create(\n' + ' object : PigeonInstanceManager.PigeonFinalizationListener {\n' + ' override fun onFinalize(identifier: Long) {\n' + ' api.removeStrongReference(identifier) {\n' + ' if (it.isFailure) {\n' + ' Log.e(\n' + ' "$registrarName",\n' + ' "Failed to remove Dart strong reference with identifier: \$identifier"\n' + ' )\n' + ' }\n' + ' }\n' + ' }\n' + ' })\n' + '}\n', + ); + for (final AstProxyApi api in allProxyApis) { + _writeMethodDeclaration( + indent, + name: 'get$hostProxyApiPrefix${api.name}', + isAbstract: true, + documentationComments: [ + 'An implementation of [$hostProxyApiPrefix${api.name}] used to add a new Dart instance of', + '`${api.name}` to the Dart `InstanceManager`.' + ], + returnType: TypeDeclaration( + baseName: '$hostProxyApiPrefix${api.name}', + isNullable: false, + ), + parameters: [], + ); + indent.newln(); + } + + indent.writeScoped('fun setUp() {', '}', () { + indent.writeln( + 'PigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager)', + ); + for (final AstProxyApi api in allProxyApis) { + final bool hasHostMessageCalls = api.constructors.isNotEmpty || + api.attachedFields.isNotEmpty || + api.hostMethods.isNotEmpty; + if (hasHostMessageCalls) { + indent.writeln( + '$hostProxyApiPrefix${api.name}.setUpMessageHandlers(binaryMessenger, get$hostProxyApiPrefix${api.name}())', + ); + } + } + }); + + indent.writeScoped('fun tearDown() {', '}', () { + indent.writeln( + 'PigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null)', + ); + for (final AstProxyApi api in allProxyApis) { + final bool hasHostMessageCalls = api.constructors.isNotEmpty || + api.attachedFields.isNotEmpty || + api.hostMethods.isNotEmpty; + if (hasHostMessageCalls) { + indent.writeln( + '$hostProxyApiPrefix${api.name}.setUpMessageHandlers(binaryMessenger, null)', + ); + } + } + }); + }, + ); + } + // Writes the abstract method that instantiates a new instance of the Kotlin // class. void _writeProxyApiConstructorAbstractMethods( @@ -1289,7 +1352,7 @@ class KotlinGenerator extends StructuredGenerator { '}', () { indent.writeln( - 'val codec = api?.codec ?: StandardMessageCodec()', + 'val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec()', ); void writeWithApiCheckIfNecessary( List types, { @@ -1359,7 +1422,7 @@ class KotlinGenerator extends StructuredGenerator { List methodParameters, { required String apiVarName, }) { - return '$apiVarName.codec.instanceManager.addDartCreatedInstance(' + return '$apiVarName.pigeonRegistrar.instanceManager.addDartCreatedInstance(' '$apiVarName.$name(${methodParameters.skip(1).join(',')}), ${methodParameters.first})'; }, parameters: [ @@ -1405,7 +1468,7 @@ class KotlinGenerator extends StructuredGenerator { }) { final String param = methodParameters.length > 1 ? methodParameters.first : ''; - return '$apiVarName.codec.instanceManager.addDartCreatedInstance(' + return '$apiVarName.pigeonRegistrar.instanceManager.addDartCreatedInstance(' '$apiVarName.${field.name}($param), ${methodParameters.last})'; }, parameters: [ @@ -1511,7 +1574,7 @@ class KotlinGenerator extends StructuredGenerator { required String errorClassName, }) { indent.writeScoped( - 'if (codec.instanceManager.containsInstance(${classMemberNamePrefix}instanceArg)) {', + 'if (pigeonRegistrar.instanceManager.containsInstance(${classMemberNamePrefix}instanceArg)) {', '}', () { indent.writeln('Result.success(Unit)'); @@ -1520,7 +1583,7 @@ class KotlinGenerator extends StructuredGenerator { ); if (api.hasCallbackConstructor()) { indent.writeln( - 'val ${classMemberNamePrefix}identifierArg = codec.instanceManager.addHostCreatedInstance(${classMemberNamePrefix}instanceArg)', + 'val ${classMemberNamePrefix}identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(${classMemberNamePrefix}instanceArg)', ); enumerate(api.unattachedFields, (int index, ApiField field) { final String argName = _getSafeArgumentName(index, field); @@ -1529,7 +1592,9 @@ class KotlinGenerator extends StructuredGenerator { ); }); - indent.writeln('val binaryMessenger = codec.binaryMessenger'); + indent + .writeln('val binaryMessenger = pigeonRegistrar.binaryMessenger'); + indent.writeln('val codec = pigeonRegistrar.codec'); _writeFlutterMethodMessageCall( indent, returnType: returnType, @@ -1600,7 +1665,9 @@ class KotlinGenerator extends StructuredGenerator { required String channelName, required String errorClassName, }) { - indent.writeln('val binaryMessenger = codec.binaryMessenger'); + indent + .writeln('val binaryMessenger = pigeonRegistrar.binaryMessenger'); + indent.writeln('val codec = pigeonRegistrar.codec'); _writeFlutterMethodMessageCall( indent, returnType: returnType, @@ -1636,7 +1703,7 @@ class KotlinGenerator extends StructuredGenerator { ); indent.writeScoped('{', '}', () { - indent.writeln('return codec.get$apiName()'); + indent.writeln('return pigeonRegistrar.get$apiName()'); }); indent.newln(); } diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt index 0843e4aac794..835dc227c5a4 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt @@ -12,8 +12,8 @@ open class ProxyApiSuperClass interface ProxyApiInterface -class ProxyApiCodec(binaryMessenger: BinaryMessenger, instanceManager: PigeonInstanceManager) : - PigeonProxyApiBaseCodec(binaryMessenger, instanceManager) { +class ProxyApiRegistrar(binaryMessenger: BinaryMessenger) : + PigeonProxyApiRegistrar(binaryMessenger) { override fun getPigeonApiProxyApiTestClass(): PigeonApiProxyApiTestClass { return ProxyApiTestClassApi(this) } @@ -27,7 +27,8 @@ class ProxyApiCodec(binaryMessenger: BinaryMessenger, instanceManager: PigeonIns } } -class ProxyApiTestClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiTestClass(codec) { +class ProxyApiTestClassApi(pigeonRegistrar: ProxyApiRegistrar) : + PigeonApiProxyApiTestClass(pigeonRegistrar) { override fun pigeon_defaultConstructor( aBool: Boolean, @@ -673,7 +674,8 @@ class ProxyApiTestClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiTe } } -class ProxyApiSuperClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiSuperClass(codec) { +class ProxyApiSuperClassApi(pigeonRegistrar: ProxyApiRegistrar) : + PigeonApiProxyApiSuperClass(pigeonRegistrar) { override fun pigeon_defaultConstructor(): ProxyApiSuperClass { return ProxyApiSuperClass() } @@ -681,4 +683,5 @@ class ProxyApiSuperClassApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiS override fun aSuperMethod(pigeon_instance: ProxyApiSuperClass) {} } -class ProxyApiInterfaceApi(codec: PigeonProxyApiBaseCodec) : PigeonApiProxyApiInterface(codec) +class ProxyApiInterfaceApi(pigeonRegistrar: ProxyApiRegistrar) : + PigeonApiProxyApiInterface(pigeonRegistrar) diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index f72ce7a71dd0..5e5149dfa604 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -102,30 +102,6 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization fun create(finalizationListener: PigeonFinalizationListener): PigeonInstanceManager { return PigeonInstanceManager(finalizationListener) } - - /** - * Instantiate a new manager with an `PigeonInstanceManager`. - * - * @param api handles removing garbage collected weak references. - * @return a new `PigeonInstanceManager`. - */ - fun create(api: PigeonInstanceManagerApi): PigeonInstanceManager { - val instanceManager = - create( - object : PigeonFinalizationListener { - override fun onFinalize(identifier: Long) { - api.removeStrongReference(identifier) { - if (it.isFailure) { - Log.e( - tag, - "Failed to remove Dart strong reference with identifier: $identifier") - } - } - } - }) - PigeonInstanceManagerApi.setUpMessageHandlers(api.binaryMessenger, instanceManager) - return instanceManager - } } /** @@ -296,7 +272,7 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization } /** Generated API for managing the Dart and native `PigeonInstanceManager`s. */ -class PigeonInstanceManagerApi(internal val binaryMessenger: BinaryMessenger) { +private class PigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { companion object { /** The codec used by PigeonInstanceManagerApi. */ private val codec: MessageCodec by lazy { StandardMessageCodec() } @@ -307,7 +283,7 @@ class PigeonInstanceManagerApi(internal val binaryMessenger: BinaryMessenger) { */ fun setUpMessageHandlers( binaryMessenger: BinaryMessenger, - instanceManager: PigeonInstanceManager + instanceManager: PigeonInstanceManager? ) { run { val channel = @@ -315,16 +291,20 @@ class PigeonInstanceManagerApi(internal val binaryMessenger: BinaryMessenger) { binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.removeStrongReference", codec) - channel.setMessageHandler { message, reply -> - val identifier = message as Number - val wrapped: List = - try { - instanceManager.remove(identifier.toLong()) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) + if (instanceManager != null) { + channel.setMessageHandler { message, reply -> + val identifier = message as Number + val wrapped: List = + try { + instanceManager.remove(identifier.toLong()) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) } } run { @@ -333,15 +313,19 @@ class PigeonInstanceManagerApi(internal val binaryMessenger: BinaryMessenger) { binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.clear", codec) - channel.setMessageHandler { _, reply -> - val wrapped: List = - try { - instanceManager.clear() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) + if (instanceManager != null) { + channel.setMessageHandler { _, reply -> + val wrapped: List = + try { + instanceManager.clear() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) } } } @@ -367,10 +351,34 @@ class PigeonInstanceManagerApi(internal val binaryMessenger: BinaryMessenger) { } } -abstract class PigeonProxyApiBaseCodec( - val binaryMessenger: BinaryMessenger, - val instanceManager: PigeonInstanceManager -) : StandardMessageCodec() { +abstract class PigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { + val instanceManager: PigeonInstanceManager + private var _codec: StandardMessageCodec? = null + val codec: StandardMessageCodec + get() { + if (_codec == null) { + _codec = PigeonProxyApiBaseCodec(this) + } + return _codec!! + } + + init { + val api = PigeonInstanceManagerApi(binaryMessenger) + instanceManager = + PigeonInstanceManager.create( + object : PigeonInstanceManager.PigeonFinalizationListener { + override fun onFinalize(identifier: Long) { + api.removeStrongReference(identifier) { + if (it.isFailure) { + Log.e( + "PigeonProxyApiRegistrar", + "Failed to remove Dart strong reference with identifier: $identifier") + } + } + } + }) + } + /** * An implementation of [PigeonApiProxyApiTestClass] used to add a new Dart instance of * `ProxyApiTestClass` to the Dart `InstanceManager`. @@ -389,17 +397,27 @@ abstract class PigeonProxyApiBaseCodec( */ abstract fun getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface - fun setUpMessageHandlers() { + fun setUp() { + PigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager) PigeonApiProxyApiTestClass.setUpMessageHandlers( binaryMessenger, getPigeonApiProxyApiTestClass()) PigeonApiProxyApiSuperClass.setUpMessageHandlers( binaryMessenger, getPigeonApiProxyApiSuperClass()) } + fun tearDown() { + PigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null) + PigeonApiProxyApiTestClass.setUpMessageHandlers(binaryMessenger, null) + PigeonApiProxyApiSuperClass.setUpMessageHandlers(binaryMessenger, null) + } +} + +private class PigeonProxyApiBaseCodec(val registrar: PigeonProxyApiRegistrar) : + StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { - return instanceManager.getInstance( + return registrar.instanceManager.getInstance( readValue(buffer).let { if (it is Int) it.toLong() else it as Long }) } else -> super.readValueOfType(type, buffer) @@ -408,17 +426,17 @@ abstract class PigeonProxyApiBaseCodec( override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { if (value is ProxyApiTestClass) { - getPigeonApiProxyApiTestClass().pigeon_newInstance(value) {} + registrar.getPigeonApiProxyApiTestClass().pigeon_newInstance(value) {} } else if (value is com.example.test_plugin.ProxyApiSuperClass) { - getPigeonApiProxyApiSuperClass().pigeon_newInstance(value) {} + registrar.getPigeonApiProxyApiSuperClass().pigeon_newInstance(value) {} } else if (value is ProxyApiInterface) { - getPigeonApiProxyApiInterface().pigeon_newInstance(value) {} + registrar.getPigeonApiProxyApiInterface().pigeon_newInstance(value) {} } when { - instanceManager.containsInstance(value) -> { + registrar.instanceManager.containsInstance(value) -> { stream.write(128) - writeValue(stream, instanceManager.getIdentifierForStrongReference(value)) + writeValue(stream, registrar.instanceManager.getIdentifierForStrongReference(value)) } else -> super.writeValue(stream, value) } @@ -441,7 +459,7 @@ enum class ProxyApiTestEnum(val raw: Int) { * integration tests. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { +abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiRegistrar) { abstract fun pigeon_defaultConstructor( aBool: Boolean, anInt: Long, @@ -942,7 +960,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiTestClass?) { - val codec = api?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() run { val channel = BasicMessageChannel( @@ -993,7 +1011,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val nullableProxyApiParamArg = args[36] as com.example.test_plugin.ProxyApiSuperClass? var wrapped: List try { - api.codec.instanceManager.addDartCreatedInstance( + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( api.pigeon_defaultConstructor( aBoolArg, anIntArg, @@ -1055,7 +1073,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val pigeon_identifierArg = args[1].let { if (it is Int) it.toLong() else it as Long } var wrapped: List try { - api.codec.instanceManager.addDartCreatedInstance( + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( api.attachedField(pigeon_instanceArg), pigeon_identifierArg) wrapped = listOf(null) } catch (exception: Throwable) { @@ -1079,7 +1097,7 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val pigeon_identifierArg = args[0].let { if (it is Int) it.toLong() else it as Long } var wrapped: List try { - api.codec.instanceManager.addDartCreatedInstance( + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( api.staticAttachedField(), pigeon_identifierArg) wrapped = listOf(null) } catch (exception: Throwable) { @@ -2941,11 +2959,12 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ProxyApiTestClass and attaches it to [pigeon_instanceArg]. */ fun pigeon_newInstance(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { - if (codec.instanceManager.containsInstance(pigeon_instanceArg)) { + if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { Result.success(Unit) return } - val pigeon_identifierArg = codec.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val aBoolArg = aBool(pigeon_instanceArg) val anIntArg = anInt(pigeon_instanceArg) val aDoubleArg = aDouble(pigeon_instanceArg) @@ -2964,7 +2983,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { val aNullableMapArg = aNullableMap(pigeon_instanceArg) val aNullableEnumArg = aNullableEnum(pigeon_instanceArg) val aNullableProxyApiArg = aNullableProxyApi(pigeon_instanceArg) - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3005,7 +3025,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ fun flutterNoop(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoop" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { @@ -3025,7 +3046,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { /** Responds with an error from an async function returning a value. */ fun flutterThrowError(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowError" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3050,7 +3072,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowErrorFromVoid" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3075,7 +3098,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aBoolArg: Boolean, callback: (Result) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoBool" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3108,7 +3132,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { anIntArg: Long, callback: (Result) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoInt" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, anIntArg)) { @@ -3140,7 +3165,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aDoubleArg: Double, callback: (Result) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoDouble" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3173,7 +3199,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aStringArg: String, callback: (Result) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoString" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3206,7 +3233,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aListArg: ByteArray, callback: (Result) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoUint8List" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3239,7 +3267,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aListArg: List, callback: (Result>) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoList" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3272,7 +3301,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aListArg: List, callback: (Result>) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiList" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3305,7 +3335,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aMapArg: Map, callback: (Result>) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoMap" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aMapArg)) { @@ -3337,7 +3368,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aMapArg: Map, callback: (Result>) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiMap" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3370,7 +3402,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { anEnumArg: ProxyApiTestEnum, callback: (Result) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoEnum" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3403,7 +3436,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass, callback: (Result) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApi" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3436,7 +3470,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aBoolArg: Boolean?, callback: (Result) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableBool" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3462,7 +3497,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { anIntArg: Long?, callback: (Result) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableInt" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3488,7 +3524,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aDoubleArg: Double?, callback: (Result) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableDouble" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3514,7 +3551,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aStringArg: String?, callback: (Result) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableString" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3540,7 +3578,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aListArg: ByteArray?, callback: (Result) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableUint8List" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3566,7 +3605,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aListArg: List?, callback: (Result?>) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableList" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3592,7 +3632,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aMapArg: Map?, callback: (Result?>) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableMap" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3618,7 +3659,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { anEnumArg: ProxyApiTestEnum?, callback: (Result) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableEnum" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3644,7 +3686,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass?, callback: (Result) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableProxyApi" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3669,7 +3712,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { * calling. */ fun flutterNoopAsync(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoopAsync" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3694,7 +3738,8 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { aStringArg: String, callback: (Result) -> Unit ) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoAsyncString" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3724,18 +3769,18 @@ abstract class PigeonApiProxyApiTestClass(val codec: PigeonProxyApiBaseCodec) { @Suppress("FunctionName") /** An implementation of [PigeonApiProxyApiSuperClass] used to access callback methods */ fun pigeon_getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass { - return codec.getPigeonApiProxyApiSuperClass() + return pigeonRegistrar.getPigeonApiProxyApiSuperClass() } @Suppress("FunctionName") /** An implementation of [PigeonApiProxyApiInterface] used to access callback methods */ fun pigeon_getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { - return codec.getPigeonApiProxyApiInterface() + return pigeonRegistrar.getPigeonApiProxyApiInterface() } } /** ProxyApi to serve as a super class to the core ProxyApi class. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiSuperClass(val codec: PigeonProxyApiBaseCodec) { +abstract class PigeonApiProxyApiSuperClass(val pigeonRegistrar: PigeonProxyApiRegistrar) { abstract fun pigeon_defaultConstructor(): com.example.test_plugin.ProxyApiSuperClass abstract fun aSuperMethod(pigeon_instance: com.example.test_plugin.ProxyApiSuperClass) @@ -3743,7 +3788,7 @@ abstract class PigeonApiProxyApiSuperClass(val codec: PigeonProxyApiBaseCodec) { companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiSuperClass?) { - val codec = api?.codec ?: StandardMessageCodec() + val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() run { val channel = BasicMessageChannel( @@ -3756,7 +3801,7 @@ abstract class PigeonApiProxyApiSuperClass(val codec: PigeonProxyApiBaseCodec) { val pigeon_identifierArg = args[0].let { if (it is Int) it.toLong() else it as Long } var wrapped: List try { - api.codec.instanceManager.addDartCreatedInstance( + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( api.pigeon_defaultConstructor(), pigeon_identifierArg) wrapped = listOf(null) } catch (exception: Throwable) { @@ -3800,12 +3845,14 @@ abstract class PigeonApiProxyApiSuperClass(val codec: PigeonProxyApiBaseCodec) { pigeon_instanceArg: com.example.test_plugin.ProxyApiSuperClass, callback: (Result) -> Unit ) { - if (codec.instanceManager.containsInstance(pigeon_instanceArg)) { + if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { Result.success(Unit) return } - val pigeon_identifierArg = codec.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val binaryMessenger = codec.binaryMessenger + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3826,16 +3873,18 @@ abstract class PigeonApiProxyApiSuperClass(val codec: PigeonProxyApiBaseCodec) { } /** ProxyApi to serve as an interface to the core ProxyApi class. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiInterface(val codec: PigeonProxyApiBaseCodec) { +abstract class PigeonApiProxyApiInterface(val pigeonRegistrar: PigeonProxyApiRegistrar) { @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ProxyApiInterface and attaches it to [pigeon_instanceArg]. */ fun pigeon_newInstance(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { - if (codec.instanceManager.containsInstance(pigeon_instanceArg)) { + if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { Result.success(Unit) return } - val pigeon_identifierArg = codec.instanceManager.addHostCreatedInstance(pigeon_instanceArg) - val binaryMessenger = codec.binaryMessenger + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) @@ -3855,7 +3904,8 @@ abstract class PigeonApiProxyApiInterface(val codec: PigeonProxyApiBaseCodec) { } fun anInterfaceMethod(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { - val binaryMessenger = codec.binaryMessenger + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.anInterfaceMethod" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/TestPlugin.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/TestPlugin.kt index 5536c3715289..052c1311428e 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/TestPlugin.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/TestPlugin.kt @@ -12,7 +12,7 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { private var flutterApi: FlutterIntegrationCoreApi? = null private var flutterSmallApiOne: FlutterSmallApi? = null private var flutterSmallApiTwo: FlutterSmallApi? = null - private var instanceManager: PigeonInstanceManager? = null + private var proxyApiRegistrar: ProxyApiRegistrar? = null override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) { HostIntegrationCoreApi.setUp(binding.binaryMessenger, this) @@ -24,14 +24,13 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { flutterSmallApiOne = FlutterSmallApi(binding.binaryMessenger, "suffixOne") flutterSmallApiTwo = FlutterSmallApi(binding.binaryMessenger, "suffixTwo") - val instanceManagerApi = PigeonInstanceManagerApi(binding.binaryMessenger) - instanceManager = PigeonInstanceManager.create(instanceManagerApi) - - val codec = ProxyApiCodec(binding.binaryMessenger, instanceManager!!) - codec.setUpMessageHandlers() + proxyApiRegistrar = ProxyApiRegistrar(binding.binaryMessenger) + proxyApiRegistrar!!.setUp() } - override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {} + override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { + proxyApiRegistrar?.tearDown() + } // HostIntegrationCoreApi From 7e345ac0254435c91187b214dfbe8ebd9be791c3 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 16 Apr 2024 14:20:53 -0400 Subject: [PATCH 13/77] docs --- packages/pigeon/lib/kotlin_generator.dart | 6 ++++++ .../kotlin/com/example/test_plugin/ProxyApiTests.gen.kt | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index d59ff45dcc73..43dbb8bd9728 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -1124,6 +1124,12 @@ class KotlinGenerator extends StructuredGenerator { }) { const String registrarName = '${classNamePrefix}ProxyApiRegistrar'; + indent.format( + '/**\n' + ' * Provides implementations for each ProxyApi implementation and provides access to resources\n' + ' * needed by any implementation.\n' + ' */', + ); indent.writeScoped( 'abstract class $registrarName(val binaryMessenger: BinaryMessenger) {', '}', diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 5e5149dfa604..cf6cce8b7e56 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -351,6 +351,10 @@ private class PigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { } } +/** + * Provides implementations for each ProxyApi implementation and provides access to resources + * needed by any implementation. + */ abstract class PigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { val instanceManager: PigeonInstanceManager private var _codec: StandardMessageCodec? = null From db2a198f4236b23a43327ca1f13ee14aa400684f Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 16 Apr 2024 14:55:31 -0400 Subject: [PATCH 14/77] formatting --- .../main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index cf6cce8b7e56..b6c897a0f345 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -352,8 +352,8 @@ private class PigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { } /** - * Provides implementations for each ProxyApi implementation and provides access to resources - * needed by any implementation. + * Provides implementations for each ProxyApi implementation and provides access to resources needed + * by any implementation. */ abstract class PigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { val instanceManager: PigeonInstanceManager From 7af4343f08984b34d18e55f96d5e09f8090f3af5 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 16 Apr 2024 15:38:27 -0400 Subject: [PATCH 15/77] fix unit tests --- packages/pigeon/test/kotlin/proxy_api_test.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/pigeon/test/kotlin/proxy_api_test.dart b/packages/pigeon/test/kotlin/proxy_api_test.dart index f4b6642c58cf..30b844c61b6e 100644 --- a/packages/pigeon/test/kotlin/proxy_api_test.dart +++ b/packages/pigeon/test/kotlin/proxy_api_test.dart @@ -103,7 +103,7 @@ void main() { expect( code, contains( - r'abstract class PigeonApiApi(val codec: PigeonProxyApiBaseCodec)', + r'abstract class PigeonApiApi(val pigeonRegistrar: PigeonProxyApiRegistrar)', ), ); @@ -299,7 +299,7 @@ void main() { expect( code, contains( - 'abstract class PigeonApiApi(val codec: PigeonProxyApiBaseCodec) ', + 'abstract class PigeonApiApi(val pigeonRegistrar: PigeonProxyApiRegistrar) ', ), ); expect( @@ -315,7 +315,7 @@ void main() { expect( collapsedCode, contains( - r'api.codec.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(', + r'api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(', ), ); }); @@ -401,7 +401,7 @@ void main() { expect( code, contains( - 'abstract class PigeonApiApi(val codec: PigeonProxyApiBaseCodec) ', + 'abstract class PigeonApiApi(val pigeonRegistrar: PigeonProxyApiRegistrar) ', ), ); expect( @@ -415,7 +415,7 @@ void main() { expect( collapsedCode, contains( - r'api.codec.instanceManager.addDartCreatedInstance(api.name(' + r'api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.name(' r'validTypeArg,enumTypeArg,proxyApiTypeArg,nullableValidTypeArg,' r'nullableEnumTypeArg,nullableProxyApiTypeArg), pigeon_identifierArg)', ), @@ -518,7 +518,7 @@ void main() { expect( collapsedCode, contains( - r'api.codec.instanceManager.addDartCreatedInstance(api.name(' + r'api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.name(' r'validTypeArg,enumTypeArg,proxyApiTypeArg,nullableValidTypeArg,' r'nullableEnumTypeArg,nullableProxyApiTypeArg), pigeon_identifierArg)', ), @@ -609,7 +609,7 @@ void main() { expect( code, contains( - r'api.codec.instanceManager.addDartCreatedInstance(api.aField(pigeon_instanceArg), pigeon_identifierArg)', + r'api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.aField(pigeon_instanceArg), pigeon_identifierArg)', ), ); }); @@ -661,7 +661,7 @@ void main() { expect( code, contains( - r'api.codec.instanceManager.addDartCreatedInstance(api.aField(), pigeon_identifierArg)', + r'api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.aField(), pigeon_identifierArg)', ), ); }); From f2a1d5bdba8826c453b6fc28f82a822fd9bc8e1a Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Wed, 17 Apr 2024 16:07:57 -0400 Subject: [PATCH 16/77] improve helper method and add test --- packages/pigeon/lib/generator_tools.dart | 4 +- .../pigeon/test/generator_tools_test.dart | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index 464a973a5631..92b2ea107d5d 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -522,9 +522,7 @@ Map> getReferencedTypes( return null; } - final TypeDeclaration typeWithHighestRequirement = allReferencedTypes - .where((TypeDeclaration type) => onGetApiRequirement(type) != null) - .reduce( + final TypeDeclaration typeWithHighestRequirement = allReferencedTypes.reduce( (TypeDeclaration one, TypeDeclaration two) { return onCompare(onGetApiRequirement(one)!, onGetApiRequirement(two)!) > 0 ? one diff --git a/packages/pigeon/test/generator_tools_test.dart b/packages/pigeon/test/generator_tools_test.dart index e68bb96239c1..5de03fb77dd0 100644 --- a/packages/pigeon/test/generator_tools_test.dart +++ b/packages/pigeon/test/generator_tools_test.dart @@ -521,4 +521,61 @@ void main() { expect(() => a.apisOfInterfaces(), throwsArgumentError); }); + + test('findHighestApiRequirement', () { + final TypeDeclaration typeWithoutMinApi = TypeDeclaration( + baseName: 'TypeWithoutMinApi', + isNullable: false, + associatedProxyApi: AstProxyApi( + name: 'TypeWithoutMinApi', + methods: [], + constructors: [], + fields: [], + ), + ); + + final TypeDeclaration typeWithMinApi = TypeDeclaration( + baseName: 'TypeWithMinApi', + isNullable: false, + associatedProxyApi: AstProxyApi( + name: 'TypeWithMinApi', + methods: [], + constructors: [], + fields: [], + ), + ); + + final TypeDeclaration typeWithHighestMinApi = TypeDeclaration( + baseName: 'TypeWithHighestMinApi', + isNullable: false, + associatedProxyApi: AstProxyApi( + name: 'TypeWithHighestMinApi', + methods: [], + constructors: [], + fields: [], + ), + ); + + final ({TypeDeclaration type, int version})? result = + findHighestApiRequirement( + [ + typeWithoutMinApi, + typeWithMinApi, + typeWithHighestMinApi, + ], + onGetApiRequirement: (TypeDeclaration type) { + if (type == typeWithMinApi) { + return 1; + } else if (type == typeWithHighestMinApi) { + return 2; + } + + return null; + }, + onCompare: (int one, int two) => one.compareTo(two), + ); + + expect(result?.type, typeWithHighestMinApi); + expect(result?.version, 2); + }); } From f76265ec7e1e9970951e8af6ab3dca714de74979 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Wed, 17 Apr 2024 16:26:01 -0400 Subject: [PATCH 17/77] add a setter for clearFinalizedWeakReferencesInterval --- packages/pigeon/lib/kotlin/templates.dart | 12 +++++++++++- .../com/example/test_plugin/ProxyApiTests.gen.kt | 12 +++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/pigeon/lib/kotlin/templates.dart b/packages/pigeon/lib/kotlin/templates.dart index 09e4335aafc0..5af0e7b84154 100644 --- a/packages/pigeon/lib/kotlin/templates.dart +++ b/packages/pigeon/lib/kotlin/templates.dart @@ -37,6 +37,17 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization private var nextIdentifier: Long = minHostCreatedIdentifier private var hasFinalizationListenerStopped = false + /** + * Modifies the time interval used to define how often this instance removes garbage collected + * weak references to native Android objects that this instance was managing. + */ + var clearFinalizedWeakReferencesInterval: Long = 3000 + set(value) { + handler.removeCallbacks { this.releaseAllFinalizedInstances() } + field = value + releaseAllFinalizedInstances() + } + init { handler.postDelayed( { releaseAllFinalizedInstances() }, @@ -50,7 +61,6 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization // Host uses identifiers >= 2^16 and Dart is expected to use values n where, // 0 <= n < 2^16. private const val minHostCreatedIdentifier: Long = 65536 - private const val clearFinalizedWeakReferencesInterval: Long = 3000 private const val tag = "$instanceManagerClassName" /** diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index b6c897a0f345..5824c100ba80 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -78,6 +78,17 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization private var nextIdentifier: Long = minHostCreatedIdentifier private var hasFinalizationListenerStopped = false + /** + * Modifies the time interval used to define how often this instance removes garbage collected + * weak references to native Android objects that this instance was managing. + */ + var clearFinalizedWeakReferencesInterval: Long = 3000 + set(value) { + handler.removeCallbacks { this.releaseAllFinalizedInstances() } + field = value + releaseAllFinalizedInstances() + } + init { handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) } @@ -88,7 +99,6 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization // Host uses identifiers >= 2^16 and Dart is expected to use values n where, // 0 <= n < 2^16. private const val minHostCreatedIdentifier: Long = 65536 - private const val clearFinalizedWeakReferencesInterval: Long = 3000 private const val tag = "PigeonInstanceManager" /** From 3b3a91b95b9c8548459e3ccce1eb3e57e96deba5 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 7 May 2024 16:26:23 -0400 Subject: [PATCH 18/77] return empty list in removeStrongReference --- packages/pigeon/lib/dart/templates.dart | 2 +- .../lib/src/generated/proxy_api_tests.gen.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/pigeon/lib/dart/templates.dart b/packages/pigeon/lib/dart/templates.dart index ce986b888dbf..d00ac9a87ffb 100644 --- a/packages/pigeon/lib/dart/templates.dart +++ b/packages/pigeon/lib/dart/templates.dart @@ -268,7 +268,7 @@ class _$apiName { r'Argument for \$channelName, expected non-null int.', ); (instanceManager ?? $instanceManagerClassName.instance).remove(identifier!); - return; + return []; }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart index 762f65d5aad0..a9bed642e0b9 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart @@ -313,7 +313,7 @@ class _PigeonInstanceManagerApi { r'Argument for $channelName, expected non-null int.', ); (instanceManager ?? PigeonInstanceManager.instance).remove(identifier!); - return; + return []; }); } From 186fe47ee284dacc8f05f25688c0df97a2ae7d14 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Wed, 8 May 2024 21:17:12 -0400 Subject: [PATCH 19/77] update generated file --- .../example/test_plugin/ProxyApiTests.gen.kt | 539 +++++++++--------- 1 file changed, 272 insertions(+), 267 deletions(-) diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 5824c100ba80..cb2e365c5206 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -4,6 +4,7 @@ // // Autogenerated from Pigeon, do not edit directly. // See also: https://pub.dev/packages/pigeon +@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") package com.example.test_plugin @@ -20,10 +21,10 @@ private fun wrapResult(result: Any?): List { } private fun wrapError(exception: Throwable): List { - if (exception is ProxyApiTestsError) { - return listOf(exception.code, exception.message, exception.details) + return if (exception is ProxyApiTestsError) { + listOf(exception.code, exception.message, exception.details) } else { - return listOf( + listOf( exception.javaClass.simpleName, exception.toString(), "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)) @@ -984,9 +985,10 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = args[0].let { if (it is Int) it.toLong() else it as Long } + val pigeon_identifierArg = + args[0].let { num -> if (num is Int) num.toLong() else num as Long } val aBoolArg = args[1] as Boolean - val anIntArg = args[2].let { if (it is Int) it.toLong() else it as Long } + val anIntArg = args[2].let { num -> if (num is Int) num.toLong() else num as Long } val aDoubleArg = args[3] as Double val aStringArg = args[4] as String val aUint8ListArg = args[5] as ByteArray @@ -995,7 +997,8 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val anEnumArg = ProxyApiTestEnum.ofRaw(args[8] as Int)!! val aProxyApiArg = args[9] as com.example.test_plugin.ProxyApiSuperClass val aNullableBoolArg = args[10] as Boolean? - val aNullableIntArg = args[11].let { if (it is Int) it.toLong() else it as Long? } + val aNullableIntArg = + args[11].let { num -> if (num is Int) num.toLong() else num as Long? } val aNullableDoubleArg = args[12] as Double? val aNullableStringArg = args[13] as String? val aNullableUint8ListArg = args[14] as ByteArray? @@ -1005,7 +1008,7 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg if (args[17] == null) null else ProxyApiTestEnum.ofRaw(args[17] as Int) val aNullableProxyApiArg = args[18] as com.example.test_plugin.ProxyApiSuperClass? val boolParamArg = args[19] as Boolean - val intParamArg = args[20].let { if (it is Int) it.toLong() else it as Long } + val intParamArg = args[20].let { num -> if (num is Int) num.toLong() else num as Long } val doubleParamArg = args[21] as Double val stringParamArg = args[22] as String val aUint8ListParamArg = args[23] as ByteArray @@ -1014,7 +1017,8 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val enumParamArg = ProxyApiTestEnum.ofRaw(args[26] as Int)!! val proxyApiParamArg = args[27] as com.example.test_plugin.ProxyApiSuperClass val nullableBoolParamArg = args[28] as Boolean? - val nullableIntParamArg = args[29].let { if (it is Int) it.toLong() else it as Long? } + val nullableIntParamArg = + args[29].let { num -> if (num is Int) num.toLong() else num as Long? } val nullableDoubleParamArg = args[30] as Double? val nullableStringParamArg = args[31] as String? val nullableUint8ListParamArg = args[32] as ByteArray? @@ -1023,51 +1027,51 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val nullableEnumParamArg = if (args[35] == null) null else ProxyApiTestEnum.ofRaw(args[35] as Int) val nullableProxyApiParamArg = args[36] as com.example.test_plugin.ProxyApiSuperClass? - var wrapped: List - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.pigeon_defaultConstructor( - aBoolArg, - anIntArg, - aDoubleArg, - aStringArg, - aUint8ListArg, - aListArg, - aMapArg, - anEnumArg, - aProxyApiArg, - aNullableBoolArg, - aNullableIntArg, - aNullableDoubleArg, - aNullableStringArg, - aNullableUint8ListArg, - aNullableListArg, - aNullableMapArg, - aNullableEnumArg, - aNullableProxyApiArg, - boolParamArg, - intParamArg, - doubleParamArg, - stringParamArg, - aUint8ListParamArg, - listParamArg, - mapParamArg, - enumParamArg, - proxyApiParamArg, - nullableBoolParamArg, - nullableIntParamArg, - nullableDoubleParamArg, - nullableStringParamArg, - nullableUint8ListParamArg, - nullableListParamArg, - nullableMapParamArg, - nullableEnumParamArg, - nullableProxyApiParamArg), - pigeon_identifierArg) - wrapped = listOf(null) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor( + aBoolArg, + anIntArg, + aDoubleArg, + aStringArg, + aUint8ListArg, + aListArg, + aMapArg, + anEnumArg, + aProxyApiArg, + aNullableBoolArg, + aNullableIntArg, + aNullableDoubleArg, + aNullableStringArg, + aNullableUint8ListArg, + aNullableListArg, + aNullableMapArg, + aNullableEnumArg, + aNullableProxyApiArg, + boolParamArg, + intParamArg, + doubleParamArg, + stringParamArg, + aUint8ListParamArg, + listParamArg, + mapParamArg, + enumParamArg, + proxyApiParamArg, + nullableBoolParamArg, + nullableIntParamArg, + nullableDoubleParamArg, + nullableStringParamArg, + nullableUint8ListParamArg, + nullableListParamArg, + nullableMapParamArg, + nullableEnumParamArg, + nullableProxyApiParamArg), + pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1084,15 +1088,16 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val pigeon_identifierArg = args[1].let { if (it is Int) it.toLong() else it as Long } - var wrapped: List - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.attachedField(pigeon_instanceArg), pigeon_identifierArg) - wrapped = listOf(null) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val pigeon_identifierArg = + args[1].let { num -> if (num is Int) num.toLong() else num as Long } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.attachedField(pigeon_instanceArg), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1108,15 +1113,16 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = args[0].let { if (it is Int) it.toLong() else it as Long } - var wrapped: List - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.staticAttachedField(), pigeon_identifierArg) - wrapped = listOf(null) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val pigeon_identifierArg = + args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.staticAttachedField(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1133,13 +1139,13 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - var wrapped: List - try { - api.noop(pigeon_instanceArg) - wrapped = listOf(null) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + api.noop(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1156,12 +1162,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - var wrapped: List - try { - wrapped = listOf(api.throwError(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.throwError(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1178,13 +1184,13 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - var wrapped: List - try { - api.throwErrorFromVoid(pigeon_instanceArg) - wrapped = listOf(null) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + api.throwErrorFromVoid(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1201,12 +1207,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - var wrapped: List - try { - wrapped = listOf(api.throwFlutterError(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.throwFlutterError(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1223,13 +1229,13 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anIntArg = args[1].let { if (it is Int) it.toLong() else it as Long } - var wrapped: List - try { - wrapped = listOf(api.echoInt(pigeon_instanceArg, anIntArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val anIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } + val wrapped: List = + try { + listOf(api.echoInt(pigeon_instanceArg, anIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1247,12 +1253,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aDoubleArg = args[1] as Double - var wrapped: List - try { - wrapped = listOf(api.echoDouble(pigeon_instanceArg, aDoubleArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoDouble(pigeon_instanceArg, aDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1270,12 +1276,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aBoolArg = args[1] as Boolean - var wrapped: List - try { - wrapped = listOf(api.echoBool(pigeon_instanceArg, aBoolArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoBool(pigeon_instanceArg, aBoolArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1293,12 +1299,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aStringArg = args[1] as String - var wrapped: List - try { - wrapped = listOf(api.echoString(pigeon_instanceArg, aStringArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoString(pigeon_instanceArg, aStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1316,12 +1322,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aUint8ListArg = args[1] as ByteArray - var wrapped: List - try { - wrapped = listOf(api.echoUint8List(pigeon_instanceArg, aUint8ListArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoUint8List(pigeon_instanceArg, aUint8ListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1339,12 +1345,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val anObjectArg = args[1] as Any - var wrapped: List - try { - wrapped = listOf(api.echoObject(pigeon_instanceArg, anObjectArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoObject(pigeon_instanceArg, anObjectArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1362,12 +1368,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aListArg = args[1] as List - var wrapped: List - try { - wrapped = listOf(api.echoList(pigeon_instanceArg, aListArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoList(pigeon_instanceArg, aListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1385,12 +1391,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aListArg = args[1] as List - var wrapped: List - try { - wrapped = listOf(api.echoProxyApiList(pigeon_instanceArg, aListArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoProxyApiList(pigeon_instanceArg, aListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1408,12 +1414,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aMapArg = args[1] as Map - var wrapped: List - try { - wrapped = listOf(api.echoMap(pigeon_instanceArg, aMapArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoMap(pigeon_instanceArg, aMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1431,12 +1437,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aMapArg = args[1] as Map - var wrapped: List - try { - wrapped = listOf(api.echoProxyApiMap(pigeon_instanceArg, aMapArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoProxyApiMap(pigeon_instanceArg, aMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1454,12 +1460,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val anEnumArg = ProxyApiTestEnum.ofRaw(args[1] as Int)!! - var wrapped: List - try { - wrapped = listOf(api.echoEnum(pigeon_instanceArg, anEnumArg).raw) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoEnum(pigeon_instanceArg, anEnumArg).raw) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1477,12 +1483,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass - var wrapped: List - try { - wrapped = listOf(api.echoProxyApi(pigeon_instanceArg, aProxyApiArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoProxyApi(pigeon_instanceArg, aProxyApiArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1499,13 +1505,14 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aNullableIntArg = args[1].let { if (it is Int) it.toLong() else it as Long? } - var wrapped: List - try { - wrapped = listOf(api.echoNullableInt(pigeon_instanceArg, aNullableIntArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val aNullableIntArg = + args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val wrapped: List = + try { + listOf(api.echoNullableInt(pigeon_instanceArg, aNullableIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1523,12 +1530,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableDoubleArg = args[1] as Double? - var wrapped: List - try { - wrapped = listOf(api.echoNullableDouble(pigeon_instanceArg, aNullableDoubleArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableDouble(pigeon_instanceArg, aNullableDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1546,12 +1553,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableBoolArg = args[1] as Boolean? - var wrapped: List - try { - wrapped = listOf(api.echoNullableBool(pigeon_instanceArg, aNullableBoolArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableBool(pigeon_instanceArg, aNullableBoolArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1569,12 +1576,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableStringArg = args[1] as String? - var wrapped: List - try { - wrapped = listOf(api.echoNullableString(pigeon_instanceArg, aNullableStringArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableString(pigeon_instanceArg, aNullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1592,13 +1599,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableUint8ListArg = args[1] as ByteArray? - var wrapped: List - try { - wrapped = + val wrapped: List = + try { listOf(api.echoNullableUint8List(pigeon_instanceArg, aNullableUint8ListArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1616,12 +1622,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableObjectArg = args[1] - var wrapped: List - try { - wrapped = listOf(api.echoNullableObject(pigeon_instanceArg, aNullableObjectArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableObject(pigeon_instanceArg, aNullableObjectArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1639,12 +1645,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableListArg = args[1] as List? - var wrapped: List - try { - wrapped = listOf(api.echoNullableList(pigeon_instanceArg, aNullableListArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableList(pigeon_instanceArg, aNullableListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1662,12 +1668,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableMapArg = args[1] as Map? - var wrapped: List - try { - wrapped = listOf(api.echoNullableMap(pigeon_instanceArg, aNullableMapArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableMap(pigeon_instanceArg, aNullableMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1686,13 +1692,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableEnumArg = if (args[1] == null) null else ProxyApiTestEnum.ofRaw(args[1] as Int) - var wrapped: List - try { - wrapped = + val wrapped: List = + try { listOf(api.echoNullableEnum(pigeon_instanceArg, aNullableEnumArg)?.raw) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1710,13 +1715,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass? - var wrapped: List - try { - wrapped = + val wrapped: List = + try { listOf(api.echoNullableProxyApi(pigeon_instanceArg, aNullableProxyApiArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1756,7 +1760,7 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anIntArg = args[1].let { if (it is Int) it.toLong() else it as Long } + val anIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } api.echoAsyncInt(pigeon_instanceArg, anIntArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { @@ -2052,7 +2056,7 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anIntArg = args[1].let { if (it is Int) it.toLong() else it as Long? } + val anIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long? } api.echoAsyncNullableInt(pigeon_instanceArg, anIntArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { @@ -2278,13 +2282,13 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg codec) if (api != null) { channel.setMessageHandler { _, reply -> - var wrapped: List - try { - api.staticNoop() - wrapped = listOf(null) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + api.staticNoop() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2301,12 +2305,12 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg channel.setMessageHandler { message, reply -> val args = message as List val aStringArg = args[0] as String - var wrapped: List - try { - wrapped = listOf(api.echoStaticString(aStringArg)) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoStaticString(aStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2439,7 +2443,7 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anIntArg = args[1].let { if (it is Int) it.toLong() else it as Long } + val anIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } api.callFlutterEchoInt(pigeon_instanceArg, anIntArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { @@ -2721,7 +2725,7 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anIntArg = args[1].let { if (it is Int) it.toLong() else it as Long? } + val anIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long? } api.callFlutterEchoNullableInt(pigeon_instanceArg, anIntArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { @@ -3164,7 +3168,7 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg "Flutter api returned null value for non-null return value.", ""))) } else { - val output = it[0].let { if (it is Int) it.toLong() else it as Long } + val output = it[0].let { num -> if (num is Int) num.toLong() else num as Long } callback(Result.success(output)) } } else { @@ -3523,7 +3527,7 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg Result.failure( ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { - val output = it[0].let { if (it is Int) it.toLong() else it as Long? } + val output = it[0].let { num -> if (num is Int) num.toLong() else num as Long? } callback(Result.success(output)) } } else { @@ -3685,7 +3689,7 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg Result.failure( ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { - val output = (it[0] as Int?)?.let { ProxyApiTestEnum.ofRaw(it) } + val output = (it[0] as Int?)?.let { num -> ProxyApiTestEnum.ofRaw(num) } callback(Result.success(output)) } } else { @@ -3812,15 +3816,16 @@ abstract class PigeonApiProxyApiSuperClass(val pigeonRegistrar: PigeonProxyApiRe if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = args[0].let { if (it is Int) it.toLong() else it as Long } - var wrapped: List - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.pigeon_defaultConstructor(), pigeon_identifierArg) - wrapped = listOf(null) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val pigeon_identifierArg = + args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3837,13 +3842,13 @@ abstract class PigeonApiProxyApiSuperClass(val pigeonRegistrar: PigeonProxyApiRe channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as com.example.test_plugin.ProxyApiSuperClass - var wrapped: List - try { - api.aSuperMethod(pigeon_instanceArg) - wrapped = listOf(null) - } catch (exception: Throwable) { - wrapped = wrapError(exception) - } + val wrapped: List = + try { + api.aSuperMethod(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { From 118606abcdd34e61a097aede0887f9d70b80a7ac Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 20 May 2024 11:55:01 -0400 Subject: [PATCH 20/77] make private codec accessible and use open for pigeonRegistrar --- packages/pigeon/lib/kotlin/templates.dart | 2 +- packages/pigeon/lib/kotlin_generator.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/pigeon/lib/kotlin/templates.dart b/packages/pigeon/lib/kotlin/templates.dart index 5af0e7b84154..4f8dc130d675 100644 --- a/packages/pigeon/lib/kotlin/templates.dart +++ b/packages/pigeon/lib/kotlin/templates.dart @@ -274,7 +274,7 @@ String instanceManagerApiTemplate({ private class $_instanceManagerApiName(val binaryMessenger: BinaryMessenger) { companion object { /** The codec used by $_instanceManagerApiName. */ - private val codec: MessageCodec by lazy { + val codec: MessageCodec by lazy { StandardMessageCodec() } diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 181b5b64c3f7..5a9f32bd614b 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -630,7 +630,7 @@ class KotlinGenerator extends StructuredGenerator { ); indent.writeln('@Suppress("UNCHECKED_CAST")'); indent.writeScoped( - 'abstract class $kotlinApiName(val pigeonRegistrar: ${classNamePrefix}ProxyApiRegistrar) {', + 'abstract class $kotlinApiName(open val pigeonRegistrar: ${classNamePrefix}ProxyApiRegistrar) {', '}', () { final String fullKotlinClassName = From 4205418958d625f6b1a31081b591a4cbba5c8bf6 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 20 May 2024 12:00:29 -0400 Subject: [PATCH 21/77] nits --- packages/pigeon/lib/ast.dart | 2 +- packages/pigeon/lib/generator_tools.dart | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/pigeon/lib/ast.dart b/packages/pigeon/lib/ast.dart index 7b78434cfe68..aa3b5635eaab 100644 --- a/packages/pigeon/lib/ast.dart +++ b/packages/pigeon/lib/ast.dart @@ -4,7 +4,7 @@ import 'package:collection/collection.dart' show ListEquality; import 'package:meta/meta.dart'; -import 'kotlin_generator.dart'; +import 'kotlin_generator.dart' show KotlinProxyApiOptions; import 'pigeon_lib.dart'; typedef _ListEquals = bool Function(List, List); diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index 76990d3b7c7a..b6dfbb4847a3 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -307,7 +307,7 @@ const String seeAlsoWarning = 'See also: https://pub.dev/packages/pigeon'; /// parameters. const String classNamePrefix = 'Pigeon'; -/// Prefix for apis generated for ProxyApi. +/// Prefix for APIs generated for ProxyApi. /// /// Since ProxyApis are intended to wrap a class and will often share the name /// of said class, host APIs should prefix the API with this protected name. @@ -500,7 +500,7 @@ Map> getReferencedTypes( return references.map; } -/// Find the [TypeDeclaration] that has the highest api requirement and its +/// Find the [TypeDeclaration] that has the highest API requirement and its /// version, [T]. /// /// [T] depends on the language. For example, Android uses an int while iOS uses From 5070f6e4d64d94ae707fa2667f7b71a7e06c648f Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Wed, 29 May 2024 10:59:10 -0400 Subject: [PATCH 22/77] shared channel code for instancemanagerapi --- packages/pigeon/lib/kotlin/templates.dart | 88 --------------- packages/pigeon/lib/kotlin_generator.dart | 103 +++++++++++++++++- .../example/test_plugin/ProxyApiTests.gen.kt | 18 +-- 3 files changed, 108 insertions(+), 101 deletions(-) diff --git a/packages/pigeon/lib/kotlin/templates.dart b/packages/pigeon/lib/kotlin/templates.dart index 4f8dc130d675..a5d00240db63 100644 --- a/packages/pigeon/lib/kotlin/templates.dart +++ b/packages/pigeon/lib/kotlin/templates.dart @@ -252,93 +252,5 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization } '''; -/// Creates the `InstanceManagerApi` with the passed string values. -String instanceManagerApiTemplate({ - required String dartPackageName, - required String errorClassName, -}) { - final String removeStrongReferenceName = makeChannelNameWithStrings( - apiName: _instanceManagerApiName, - methodName: 'removeStrongReference', - dartPackageName: dartPackageName, - ); - final String clearName = makeChannelNameWithStrings( - apiName: _instanceManagerApiName, - methodName: 'clear', - dartPackageName: dartPackageName, - ); - return ''' -/** -* Generated API for managing the Dart and native `$instanceManagerClassName`s. -*/ -private class $_instanceManagerApiName(val binaryMessenger: BinaryMessenger) { - companion object { - /** The codec used by $_instanceManagerApiName. */ - val codec: MessageCodec by lazy { - StandardMessageCodec() - } - - /** - * Sets up an instance of `$_instanceManagerApiName` to handle messages from the - * `binaryMessenger`. - */ - fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: $instanceManagerClassName?) { - run { - val channel = BasicMessageChannel(binaryMessenger, "$removeStrongReferenceName", codec) - if (instanceManager != null) { - channel.setMessageHandler { message, reply -> - val identifier = message as Number - val wrapped: List = try { - instanceManager.remove(identifier.toLong()) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = BasicMessageChannel(binaryMessenger, "$clearName", codec) - if (instanceManager != null) { - channel.setMessageHandler { _, reply -> - val wrapped: List = try { - instanceManager.clear() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - } - } - - fun removeStrongReference(identifier: Long, callback: (Result) -> Unit) { - val channelName = "$removeStrongReferenceName" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(identifier) { - if (it is List<*>) { - if (it.size > 1) { - callback(Result.failure($errorClassName(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } -} -'''; -} - -const String _instanceManagerApiName = '${instanceManagerClassName}Api'; - const String _finalizationListenerClassName = '${classNamePrefix}FinalizationListener'; diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 5a9f32bd614b..5378f9f120f0 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -510,10 +510,104 @@ class KotlinGenerator extends StructuredGenerator { Indent indent, { required String dartPackageName, }) { - indent.format(instanceManagerApiTemplate( + const String instanceManagerApiName = '${instanceManagerClassName}Api'; + + final String removeStrongReferenceName = makeChannelNameWithStrings( + apiName: instanceManagerApiName, + methodName: 'removeStrongReference', + dartPackageName: dartPackageName, + ); + final String clearName = makeChannelNameWithStrings( + apiName: instanceManagerApiName, + methodName: 'clear', dartPackageName: dartPackageName, - errorClassName: _getErrorClassName(generatorOptions), - )); + ); + + indent.writeln('/**'); + indent.writeln( + '* Generated API for managing the Dart and native `$instanceManagerClassName`s.'); + indent.writeln('*/'); + indent.writeScoped( + 'private class $instanceManagerApiName(val binaryMessenger: BinaryMessenger) {', + '}', + () { + indent.writeScoped('companion object {', '}', () { + indent.writeln('/** The codec used by $instanceManagerApiName. */'); + indent.writeScoped('val codec: MessageCodec by lazy {', '}', + () { + indent.writeln('StandardMessageCodec()'); + }); + indent.newln(); + + indent.writeln('/**'); + indent.writeln( + '* Sets up an instance of `$instanceManagerApiName` to handle messages from the'); + indent.writeln('* `binaryMessenger`.'); + indent.writeln('*/'); + indent.writeScoped( + 'fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: $instanceManagerClassName?) {', + '}', + () { + const String setHandlerCondition = 'instanceManager != null'; + _writeHostMethodMessageHandler( + indent, + name: 'removeStrongReference', + channelName: removeStrongReferenceName, + taskQueueType: TaskQueueType.serial, + parameters: [ + Parameter( + name: 'identifier', + type: const TypeDeclaration( + baseName: 'int', + isNullable: false, + ), + ), + ], + returnType: const TypeDeclaration.voidDeclaration(), + setHandlerCondition: setHandlerCondition, + onCreateCall: ( + List safeArgNames, { + required String apiVarName, + }) { + return 'instanceManager.remove(${safeArgNames.single})'; + }, + ); + _writeHostMethodMessageHandler( + indent, + name: 'clear', + channelName: clearName, + taskQueueType: TaskQueueType.serial, + parameters: [], + returnType: const TypeDeclaration.voidDeclaration(), + setHandlerCondition: setHandlerCondition, + onCreateCall: ( + List safeArgNames, { + required String apiVarName, + }) { + return 'instanceManager.clear()'; + }, + ); + }, + ); + }); + indent.newln(); + + _writeFlutterMethod( + indent, + generatorOptions: generatorOptions, + name: 'removeStrongReference', + parameters: [ + Parameter( + name: 'identifier', + type: const TypeDeclaration(baseName: 'int', isNullable: false), + ) + ], + returnType: const TypeDeclaration.voidDeclaration(), + channelName: removeStrongReferenceName, + dartPackageName: dartPackageName, + ); + }, + ); } @override @@ -903,6 +997,7 @@ class KotlinGenerator extends StructuredGenerator { required TaskQueueType taskQueueType, required List parameters, required TypeDeclaration returnType, + String setHandlerCondition = 'api != null', bool isAsynchronous = false, String Function(List safeArgNames, {required String apiVarName})? onCreateCall, @@ -926,7 +1021,7 @@ class KotlinGenerator extends StructuredGenerator { indent.addln(')'); } - indent.write('if (api != null) '); + indent.write('if ($setHandlerCondition) '); indent.addScoped('{', '}', () { final String messageVarName = parameters.isNotEmpty ? 'message' : '_'; diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index cb2e365c5206..0e60b78ab6cd 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -286,7 +286,7 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization private class PigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { companion object { /** The codec used by PigeonInstanceManagerApi. */ - private val codec: MessageCodec by lazy { StandardMessageCodec() } + val codec: MessageCodec by lazy { StandardMessageCodec() } /** * Sets up an instance of `PigeonInstanceManagerApi` to handle messages from the @@ -304,10 +304,11 @@ private class PigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { codec) if (instanceManager != null) { channel.setMessageHandler { message, reply -> - val identifier = message as Number + val args = message as List + val identifierArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } val wrapped: List = try { - instanceManager.remove(identifier.toLong()) + instanceManager.remove(identifierArg) listOf(null) } catch (exception: Throwable) { wrapError(exception) @@ -342,11 +343,11 @@ private class PigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { } } - fun removeStrongReference(identifier: Long, callback: (Result) -> Unit) { + fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) { val channelName = "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.removeStrongReference" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(identifier) { + channel.send(listOf(identifierArg)) { if (it is List<*>) { if (it.size > 1) { callback( @@ -361,7 +362,6 @@ private class PigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { } } } - /** * Provides implementations for each ProxyApi implementation and provides access to resources needed * by any implementation. @@ -474,7 +474,7 @@ enum class ProxyApiTestEnum(val raw: Int) { * integration tests. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiRegistrar) { +abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: PigeonProxyApiRegistrar) { abstract fun pigeon_defaultConstructor( aBool: Boolean, anInt: Long, @@ -3798,7 +3798,7 @@ abstract class PigeonApiProxyApiTestClass(val pigeonRegistrar: PigeonProxyApiReg } /** ProxyApi to serve as a super class to the core ProxyApi class. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiSuperClass(val pigeonRegistrar: PigeonProxyApiRegistrar) { +abstract class PigeonApiProxyApiSuperClass(open val pigeonRegistrar: PigeonProxyApiRegistrar) { abstract fun pigeon_defaultConstructor(): com.example.test_plugin.ProxyApiSuperClass abstract fun aSuperMethod(pigeon_instance: com.example.test_plugin.ProxyApiSuperClass) @@ -3892,7 +3892,7 @@ abstract class PigeonApiProxyApiSuperClass(val pigeonRegistrar: PigeonProxyApiRe } /** ProxyApi to serve as an interface to the core ProxyApi class. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiInterface(val pigeonRegistrar: PigeonProxyApiRegistrar) { +abstract class PigeonApiProxyApiInterface(open val pigeonRegistrar: PigeonProxyApiRegistrar) { @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ProxyApiInterface and attaches it to [pigeon_instanceArg]. */ fun pigeon_newInstance(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { From 1b9dfc12763f53f9d3dc33f9774fc023fc4421f8 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 30 May 2024 13:09:17 -0400 Subject: [PATCH 23/77] make fullclassname nullable --- packages/pigeon/lib/kotlin_generator.dart | 7 ++----- packages/pigeon/lib/pigeon_lib.dart | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 5378f9f120f0..764e3c83bcfe 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -87,13 +87,10 @@ class KotlinOptions { /// ProxyApi. class KotlinProxyApiOptions { /// Construct a [KotlinProxyApiOptions]. - const KotlinProxyApiOptions({ - required this.fullClassName, - this.minAndroidApi, - }); + const KotlinProxyApiOptions({this.fullClassName, this.minAndroidApi}); /// The name of the full runtime Kotlin class name (including the package). - final String fullClassName; + final String? fullClassName; /// The minimum Android api version. /// diff --git a/packages/pigeon/lib/pigeon_lib.dart b/packages/pigeon/lib/pigeon_lib.dart index 756b3876a455..f4e2df99e3d3 100644 --- a/packages/pigeon/lib/pigeon_lib.dart +++ b/packages/pigeon/lib/pigeon_lib.dart @@ -1551,7 +1551,7 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor { annotationMap['kotlinOptions'] as Map?; if (kotlinOptionsMap != null) { kotlinOptions = KotlinProxyApiOptions( - fullClassName: kotlinOptionsMap['fullClassName']! as String, + fullClassName: kotlinOptionsMap['fullClassName'] as String?, minAndroidApi: kotlinOptionsMap['minAndroidApi'] as int?, ); } From f91a51fa87312a3ab88c2f21d266a016b8e5bf89 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 30 May 2024 13:28:53 -0400 Subject: [PATCH 24/77] use name constants and add a computation to the proxy api --- packages/pigeon/lib/ast.dart | 12 +++++++++++- packages/pigeon/lib/kotlin_generator.dart | 21 +++++++++------------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/packages/pigeon/lib/ast.dart b/packages/pigeon/lib/ast.dart index aa3b5635eaab..bd0ed7f336e2 100644 --- a/packages/pigeon/lib/ast.dart +++ b/packages/pigeon/lib/ast.dart @@ -258,7 +258,7 @@ class AstProxyApi extends Api { } } - /// Whether the api has a method that callbacks to Dart to add a new instance + /// Whether the API has a method that callbacks to Dart to add a new instance /// to the InstanceManager. /// /// This is possible as long as no callback methods are required to @@ -270,6 +270,16 @@ class AstProxyApi extends Api { .every((Method method) => !method.isRequired); } + /// Whether the API has any message calls from Dart to host. + bool hasAnyHostMessageCalls() => + constructors.isNotEmpty || + attachedFields.isNotEmpty || + hostMethods.isNotEmpty; + + /// Whether the API has any message calls from host to Dart. + bool hasAnyFlutterMessageCalls() => + hasCallbackConstructor() || flutterMethods.isNotEmpty; + // Recursively search for all the interfaces apis from a list of names of // interfaces. // diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 764e3c83bcfe..8727254e908b 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -637,14 +637,13 @@ class KotlinGenerator extends StructuredGenerator { final List sortedApis = topologicalSort( allProxyApis, (AstProxyApi api) { - final List edges = [ + return [ if (api.superClass?.associatedProxyApi != null) api.superClass!.associatedProxyApi!, ...api.interfaces.map( (TypeDeclaration interface) => interface.associatedProxyApi!, ), ]; - return edges; }, ); @@ -1197,6 +1196,7 @@ class KotlinGenerator extends StructuredGenerator { required Iterable allProxyApis, }) { const String registrarName = '${classNamePrefix}ProxyApiRegistrar'; + const String instanceManagerApiName = '${instanceManagerClassName}Api'; indent.format( '/**\n' @@ -1208,7 +1208,7 @@ class KotlinGenerator extends StructuredGenerator { 'abstract class $registrarName(val binaryMessenger: BinaryMessenger) {', '}', () { - indent.writeln('val instanceManager: PigeonInstanceManager'); + indent.writeln('val instanceManager: $instanceManagerClassName'); indent.format( 'private var _codec: StandardMessageCodec? = null\n' 'val codec: StandardMessageCodec\n' @@ -1221,10 +1221,10 @@ class KotlinGenerator extends StructuredGenerator { ); indent.format( 'init {\n' - ' val api = PigeonInstanceManagerApi(binaryMessenger)\n' + ' val api = $instanceManagerApiName(binaryMessenger)\n' ' instanceManager =\n' - ' PigeonInstanceManager.create(\n' - ' object : PigeonInstanceManager.PigeonFinalizationListener {\n' + ' $instanceManagerClassName.create(\n' + ' object : $instanceManagerClassName.PigeonFinalizationListener {\n' ' override fun onFinalize(identifier: Long) {\n' ' api.removeStrongReference(identifier) {\n' ' if (it.isFailure) {\n' @@ -1258,7 +1258,7 @@ class KotlinGenerator extends StructuredGenerator { indent.writeScoped('fun setUp() {', '}', () { indent.writeln( - 'PigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager)', + '$instanceManagerApiName.setUpMessageHandlers(binaryMessenger, instanceManager)', ); for (final AstProxyApi api in allProxyApis) { final bool hasHostMessageCalls = api.constructors.isNotEmpty || @@ -1274,13 +1274,10 @@ class KotlinGenerator extends StructuredGenerator { indent.writeScoped('fun tearDown() {', '}', () { indent.writeln( - 'PigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null)', + '$instanceManagerApiName.setUpMessageHandlers(binaryMessenger, null)', ); for (final AstProxyApi api in allProxyApis) { - final bool hasHostMessageCalls = api.constructors.isNotEmpty || - api.attachedFields.isNotEmpty || - api.hostMethods.isNotEmpty; - if (hasHostMessageCalls) { + if (api.hasAnyHostMessageCalls()) { indent.writeln( '$hostProxyApiPrefix${api.name}.setUpMessageHandlers(binaryMessenger, null)', ); From 84e0a0c7536bb05ea084d9483e08a081a95a2368 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 30 May 2024 14:46:57 -0400 Subject: [PATCH 25/77] fix unit tests --- packages/pigeon/test/kotlin/proxy_api_test.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/pigeon/test/kotlin/proxy_api_test.dart b/packages/pigeon/test/kotlin/proxy_api_test.dart index 30b844c61b6e..8096347e2478 100644 --- a/packages/pigeon/test/kotlin/proxy_api_test.dart +++ b/packages/pigeon/test/kotlin/proxy_api_test.dart @@ -103,7 +103,7 @@ void main() { expect( code, contains( - r'abstract class PigeonApiApi(val pigeonRegistrar: PigeonProxyApiRegistrar)', + r'abstract class PigeonApiApi(open val pigeonRegistrar: PigeonProxyApiRegistrar)', ), ); @@ -299,7 +299,7 @@ void main() { expect( code, contains( - 'abstract class PigeonApiApi(val pigeonRegistrar: PigeonProxyApiRegistrar) ', + 'abstract class PigeonApiApi(open val pigeonRegistrar: PigeonProxyApiRegistrar) ', ), ); expect( @@ -401,7 +401,7 @@ void main() { expect( code, contains( - 'abstract class PigeonApiApi(val pigeonRegistrar: PigeonProxyApiRegistrar) ', + 'abstract class PigeonApiApi(open val pigeonRegistrar: PigeonProxyApiRegistrar) ', ), ); expect( From bdf1aae1dfee48865f00964df207bb1293a25871 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 30 May 2024 14:50:54 -0400 Subject: [PATCH 26/77] test api registrar --- packages/pigeon/test/kotlin/proxy_api_test.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/pigeon/test/kotlin/proxy_api_test.dart b/packages/pigeon/test/kotlin/proxy_api_test.dart index 8096347e2478..bc7760c68e4a 100644 --- a/packages/pigeon/test/kotlin/proxy_api_test.dart +++ b/packages/pigeon/test/kotlin/proxy_api_test.dart @@ -98,6 +98,14 @@ void main() { expect(code, contains(r'class PigeonInstanceManager')); expect(code, contains(r'class PigeonInstanceManagerApi')); + // API registrar + expect( + code, + contains( + 'abstract class PigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger)', + ), + ); + // Codec and class expect(code, contains('class PigeonProxyApiBaseCodec')); expect( From 2ff907516aa9db031cf6369dd3454910a7bd5b6c Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 30 May 2024 16:20:42 -0400 Subject: [PATCH 27/77] support a default api implementation --- packages/pigeon/lib/kotlin_generator.dart | 32 ++++++++++++++++--- .../test_plugin/ProxyApiTestApiImpls.kt | 7 ---- .../example/test_plugin/ProxyApiTests.gen.kt | 6 ++-- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 8727254e908b..38606f9dc6ef 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -719,8 +719,13 @@ class KotlinGenerator extends StructuredGenerator { _docCommentSpec, ); indent.writeln('@Suppress("UNCHECKED_CAST")'); + // The API only needs to be abstract if there are methods to override. + final String classModifier = + api.hasAnyHostMessageCalls() || api.unattachedFields.isNotEmpty + ? 'abstract' + : 'open'; indent.writeScoped( - 'abstract class $kotlinApiName(open val pigeonRegistrar: ${classNamePrefix}ProxyApiRegistrar) {', + '$classModifier class $kotlinApiName(open val pigeonRegistrar: ${classNamePrefix}ProxyApiRegistrar) {', '}', () { final String fullKotlinClassName = @@ -940,6 +945,7 @@ class KotlinGenerator extends StructuredGenerator { List documentationComments = const [], int? minApiRequirement, bool isAsynchronous = false, + bool isOpen = false, bool isAbstract = false, String Function(int index, NamedType type) getArgumentName = _getArgumentName, @@ -972,16 +978,21 @@ class KotlinGenerator extends StructuredGenerator { ); } + final String openKeyword = isOpen ? 'open ' : ''; final String abstractKeyword = isAbstract ? 'abstract ' : ''; if (isAsynchronous) { argSignature.add('callback: (Result<$resultType>) -> Unit'); - indent.writeln('${abstractKeyword}fun $name(${argSignature.join(', ')})'); + indent.writeln( + '$openKeyword${abstractKeyword}fun $name(${argSignature.join(', ')})', + ); } else if (returnType.isVoid) { - indent.writeln('${abstractKeyword}fun $name(${argSignature.join(', ')})'); + indent.writeln( + '$openKeyword${abstractKeyword}fun $name(${argSignature.join(', ')})', + ); } else { indent.writeln( - '${abstractKeyword}fun $name(${argSignature.join(', ')}): $returnTypeString', + '$openKeyword${abstractKeyword}fun $name(${argSignature.join(', ')}): $returnTypeString', ); } } @@ -1242,7 +1253,10 @@ class KotlinGenerator extends StructuredGenerator { _writeMethodDeclaration( indent, name: 'get$hostProxyApiPrefix${api.name}', - isAbstract: true, + isAbstract: + api.hasAnyHostMessageCalls() || api.unattachedFields.isNotEmpty, + isOpen: + !api.hasAnyHostMessageCalls() && api.unattachedFields.isEmpty, documentationComments: [ 'An implementation of [$hostProxyApiPrefix${api.name}] used to add a new Dart instance of', '`${api.name}` to the Dart `InstanceManager`.' @@ -1253,6 +1267,14 @@ class KotlinGenerator extends StructuredGenerator { ), parameters: [], ); + + // Use the default API implementation if this API does not have any + // methods to implement. + if (!api.hasAnyHostMessageCalls() && api.unattachedFields.isEmpty) { + indent.writeScoped('{', '}', () { + indent.writeln('return $hostProxyApiPrefix${api.name}(this)'); + }); + } indent.newln(); } diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt index 835dc227c5a4..3ead9c94bd59 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt @@ -21,10 +21,6 @@ class ProxyApiRegistrar(binaryMessenger: BinaryMessenger) : override fun getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass { return ProxyApiSuperClassApi(this) } - - override fun getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { - return ProxyApiInterfaceApi(this) - } } class ProxyApiTestClassApi(pigeonRegistrar: ProxyApiRegistrar) : @@ -682,6 +678,3 @@ class ProxyApiSuperClassApi(pigeonRegistrar: ProxyApiRegistrar) : override fun aSuperMethod(pigeon_instance: ProxyApiSuperClass) {} } - -class ProxyApiInterfaceApi(pigeonRegistrar: ProxyApiRegistrar) : - PigeonApiProxyApiInterface(pigeonRegistrar) diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 0e60b78ab6cd..3938d988d252 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -410,7 +410,9 @@ abstract class PigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { * An implementation of [PigeonApiProxyApiInterface] used to add a new Dart instance of * `ProxyApiInterface` to the Dart `InstanceManager`. */ - abstract fun getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface + open fun getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { + return PigeonApiProxyApiInterface(this) + } fun setUp() { PigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager) @@ -3892,7 +3894,7 @@ abstract class PigeonApiProxyApiSuperClass(open val pigeonRegistrar: PigeonProxy } /** ProxyApi to serve as an interface to the core ProxyApi class. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiInterface(open val pigeonRegistrar: PigeonProxyApiRegistrar) { +open class PigeonApiProxyApiInterface(open val pigeonRegistrar: PigeonProxyApiRegistrar) { @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ProxyApiInterface and attaches it to [pigeon_instanceArg]. */ fun pigeon_newInstance(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { From b0569f514dea0626e650e635a0c009e21d76d4ee Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 3 Jun 2024 19:51:48 -0400 Subject: [PATCH 28/77] update instancemanager docs --- packages/pigeon/lib/kotlin/templates.dart | 63 +++++-------------- .../example/test_plugin/ProxyApiTests.gen.kt | 55 +++++----------- 2 files changed, 30 insertions(+), 88 deletions(-) diff --git a/packages/pigeon/lib/kotlin/templates.dart b/packages/pigeon/lib/kotlin/templates.dart index a5d00240db63..8eb38a166af6 100644 --- a/packages/pigeon/lib/kotlin/templates.dart +++ b/packages/pigeon/lib/kotlin/templates.dart @@ -16,12 +16,12 @@ const String instanceManagerTemplate = ''' * *

Added instances are added as a weak reference and a strong reference. When the strong * reference is removed with [remove] and the weak reference is deallocated, the - * `finalizationListener` is made with the instance's identifier. However, if the strong reference - * is removed and then the identifier is retrieved with the intention to pass the identifier to Dart - * (e.g. calling [getIdentifierForStrongReference]), the strong reference to the - * instance is recreated. The strong reference will then need to be removed manually again. + * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the strong + * reference is removed and then the identifier is retrieved with the intention to pass the identifier + * to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the instance + * is recreated. The strong reference will then need to be removed manually again. */ -@Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate", "unused") +@Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") class $instanceManagerClassName(private val finalizationListener: $_finalizationListenerClassName) { /** Interface for listening when a weak reference of an instance is removed from the manager. */ interface $_finalizationListenerClassName { @@ -64,13 +64,10 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization private const val tag = "$instanceManagerClassName" /** - * Instantiate a new manager. - * + * Instantiate a new manager with a listener for garbage collected weak + * references. * * When the manager is no longer needed, [stopFinalizationListener] must be called. - * - * @param finalizationListener the listener for garbage collected weak references. - * @return a new `$instanceManagerClassName`. */ fun create(finalizationListener: $_finalizationListenerClassName): $instanceManagerClassName { return $instanceManagerClassName(finalizationListener) @@ -78,21 +75,16 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization } /** - * Removes `identifier` and its associated strongly referenced instance, if present, from the - * manager. - * - * @param identifier the identifier paired to an instance. - * @param the expected return type. - * @return the removed instance if the manager contains the given identifier, otherwise `null` if - * the manager doesn't contain the value. - */ + * Removes `identifier` and return its associated strongly referenced instance, if present, + * from the manager. + */ fun remove(identifier: Long): T? { logWarningIfFinalizationListenerHasStopped() return strongInstances.remove(identifier) as T? } /** - * Retrieves the identifier paired with an instance. + * Retrieves the identifier paired with an instance, if present, otherwise `null`. * * * If the manager contains a strong reference to `instance`, it will return the identifier @@ -103,10 +95,6 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization * If this method returns a nonnull identifier, this method also expects the Dart * `$instanceManagerClassName` to have, or recreate, a weak reference to the Dart instance the * identifier is associated with. - * - * @param instance an instance that may be stored in the manager. - * @return the identifier associated with `instance` if the manager contains the value, otherwise - * `null` if the manager doesn't contain the value. */ fun getIdentifierForStrongReference(instance: Any?): Long? { logWarningIfFinalizationListenerHasStopped() @@ -120,14 +108,11 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization /** * Adds a new instance that was instantiated from Dart. * - * * The same instance can be added multiple times, but each identifier must be unique. This * allows two objects that are equivalent (e.g. the `equals` method returns true and their * hashcodes are equal) to both be added. * - * @param instance the instance to be stored. - * @param identifier the identifier to be paired with instance. This value must be >= 0 and - * unique. + * [identifier] must be >= 0 and unique. */ fun addDartCreatedInstance(instance: Any, identifier: Long) { logWarningIfFinalizationListenerHasStopped() @@ -135,10 +120,9 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization } /** - * Adds a new instance that was instantiated from the host platform. + * Adds a new unique instance that was instantiated from the host platform. * - * @param instance the instance to be stored. This must be unique to all other added instances. - * @return the unique identifier (>= 0) stored with instance. + * [identifier] must be >= 0 and unique. */ fun addHostCreatedInstance(instance: Any): Long { logWarningIfFinalizationListenerHasStopped() @@ -148,26 +132,14 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization return identifier } - /** - * Retrieves the instance associated with identifier. - * - * @param identifier the identifier associated with an instance. - * @param the expected return type. - * @return the instance associated with `identifier` if the manager contains the value, otherwise - * `null` if the manager doesn't contain the value. - */ + /** Retrieves the instance associated with identifier, if present, otherwise `null`. */ fun getInstance(identifier: Long): T? { logWarningIfFinalizationListenerHasStopped() val instance = weakInstances[identifier] as java.lang.ref.WeakReference? return instance?.get() } - /** - * Returns whether this manager contains the given `instance`. - * - * @param instance the instance whose presence in this manager is to be tested. - * @return whether this manager contains the given `instance`. - */ + /** Returns whether this manager contains the given `instance`. */ fun containsInstance(instance: Any?): Boolean { logWarningIfFinalizationListenerHasStopped() return identifiers.containsKey(instance) @@ -177,7 +149,6 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization * Stop the periodic run of the [$_finalizationListenerClassName] for instances that have been garbage * collected. * - * * The InstanceManager can continue to be used, but the [$_finalizationListenerClassName] will no * longer be called and methods will log a warning. */ @@ -189,7 +160,6 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization /** * Removes all of the instances from this manager. * - * * The manager will be empty after this call returns. */ fun clear() { @@ -203,7 +173,6 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization * Whether the [$_finalizationListenerClassName] is still being called for instances that are garbage * collected. * - * * See [stopFinalizationListener]. */ fun hasFinalizationListenerStopped(): Boolean { diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 3938d988d252..1104acf694a4 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -58,12 +58,12 @@ class ProxyApiTestsError( * *

Added instances are added as a weak reference and a strong reference. When the strong * reference is removed with [remove] and the weak reference is deallocated, the - * `finalizationListener` is made with the instance's identifier. However, if the strong reference - * is removed and then the identifier is retrieved with the intention to pass the identifier to Dart - * (e.g. calling [getIdentifierForStrongReference]), the strong reference to the instance is - * recreated. The strong reference will then need to be removed manually again. + * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the + * strong reference is removed and then the identifier is retrieved with the intention to pass the + * identifier to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the + * instance is recreated. The strong reference will then need to be removed manually again. */ -@Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate", "unused") +@Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") class PigeonInstanceManager(private val finalizationListener: PigeonFinalizationListener) { /** Interface for listening when a weak reference of an instance is removed from the manager. */ interface PigeonFinalizationListener { @@ -103,12 +103,9 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization private const val tag = "PigeonInstanceManager" /** - * Instantiate a new manager. + * Instantiate a new manager with a listener for garbage collected weak references. * * When the manager is no longer needed, [stopFinalizationListener] must be called. - * - * @param finalizationListener the listener for garbage collected weak references. - * @return a new `PigeonInstanceManager`. */ fun create(finalizationListener: PigeonFinalizationListener): PigeonInstanceManager { return PigeonInstanceManager(finalizationListener) @@ -116,13 +113,8 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization } /** - * Removes `identifier` and its associated strongly referenced instance, if present, from the - * manager. - * - * @param identifier the identifier paired to an instance. - * @param the expected return type. - * @return the removed instance if the manager contains the given identifier, otherwise `null` if - * the manager doesn't contain the value. + * Removes `identifier` and return its associated strongly referenced instance, if present, from + * the manager. */ fun remove(identifier: Long): T? { logWarningIfFinalizationListenerHasStopped() @@ -130,7 +122,7 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization } /** - * Retrieves the identifier paired with an instance. + * Retrieves the identifier paired with an instance, if present, otherwise `null`. * * If the manager contains a strong reference to `instance`, it will return the identifier * associated with `instance`. If the manager contains only a weak reference to `instance`, a new @@ -139,10 +131,6 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization * If this method returns a nonnull identifier, this method also expects the Dart * `PigeonInstanceManager` to have, or recreate, a weak reference to the Dart instance the * identifier is associated with. - * - * @param instance an instance that may be stored in the manager. - * @return the identifier associated with `instance` if the manager contains the value, otherwise - * `null` if the manager doesn't contain the value. */ fun getIdentifierForStrongReference(instance: Any?): Long? { logWarningIfFinalizationListenerHasStopped() @@ -160,9 +148,7 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization * two objects that are equivalent (e.g. the `equals` method returns true and their hashcodes are * equal) to both be added. * - * @param instance the instance to be stored. - * @param identifier the identifier to be paired with instance. This value must be >= 0 and - * unique. + * [identifier] must be >= 0 and unique. */ fun addDartCreatedInstance(instance: Any, identifier: Long) { logWarningIfFinalizationListenerHasStopped() @@ -170,10 +156,9 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization } /** - * Adds a new instance that was instantiated from the host platform. + * Adds a new unique instance that was instantiated from the host platform. * - * @param instance the instance to be stored. This must be unique to all other added instances. - * @return the unique identifier (>= 0) stored with instance. + * [identifier] must be >= 0 and unique. */ fun addHostCreatedInstance(instance: Any): Long { logWarningIfFinalizationListenerHasStopped() @@ -185,26 +170,14 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization return identifier } - /** - * Retrieves the instance associated with identifier. - * - * @param identifier the identifier associated with an instance. - * @param the expected return type. - * @return the instance associated with `identifier` if the manager contains the value, otherwise - * `null` if the manager doesn't contain the value. - */ + /** Retrieves the instance associated with identifier, if present, otherwise `null`. */ fun getInstance(identifier: Long): T? { logWarningIfFinalizationListenerHasStopped() val instance = weakInstances[identifier] as java.lang.ref.WeakReference? return instance?.get() } - /** - * Returns whether this manager contains the given `instance`. - * - * @param instance the instance whose presence in this manager is to be tested. - * @return whether this manager contains the given `instance`. - */ + /** Returns whether this manager contains the given `instance`. */ fun containsInstance(instance: Any?): Boolean { logWarningIfFinalizationListenerHasStopped() return identifiers.containsKey(instance) From 4f47756f0f939fed5a475a28c56116049e288150 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 3 Jun 2024 19:52:31 -0400 Subject: [PATCH 29/77] stops --- packages/pigeon/lib/kotlin/templates.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pigeon/lib/kotlin/templates.dart b/packages/pigeon/lib/kotlin/templates.dart index 8eb38a166af6..9e39830b2af1 100644 --- a/packages/pigeon/lib/kotlin/templates.dart +++ b/packages/pigeon/lib/kotlin/templates.dart @@ -146,7 +146,7 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization } /** - * Stop the periodic run of the [$_finalizationListenerClassName] for instances that have been garbage + * Stops the periodic run of the [$_finalizationListenerClassName] for instances that have been garbage * collected. * * The InstanceManager can continue to be used, but the [$_finalizationListenerClassName] will no From 03d1100aa602b380144bc6b48518cc7e5fc323e6 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 3 Jun 2024 20:02:05 -0400 Subject: [PATCH 30/77] switch to format --- packages/pigeon/lib/kotlin_generator.dart | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 38606f9dc6ef..6a92457745c5 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -520,10 +520,11 @@ class KotlinGenerator extends StructuredGenerator { dartPackageName: dartPackageName, ); - indent.writeln('/**'); - indent.writeln( - '* Generated API for managing the Dart and native `$instanceManagerClassName`s.'); - indent.writeln('*/'); + indent.format( + '/**\n' + ' * Generated API for managing the Dart and native `$instanceManagerClassName`s.\n' + ' */', + ); indent.writeScoped( 'private class $instanceManagerApiName(val binaryMessenger: BinaryMessenger) {', '}', @@ -536,11 +537,12 @@ class KotlinGenerator extends StructuredGenerator { }); indent.newln(); - indent.writeln('/**'); - indent.writeln( - '* Sets up an instance of `$instanceManagerApiName` to handle messages from the'); - indent.writeln('* `binaryMessenger`.'); - indent.writeln('*/'); + indent.format( + '/**\n' + ' * Sets up an instance of `$instanceManagerApiName` to handle messages from the\n' + ' * `binaryMessenger`.\n' + ' */', + ); indent.writeScoped( 'fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: $instanceManagerClassName?) {', '}', @@ -622,7 +624,7 @@ class KotlinGenerator extends StructuredGenerator { // Sort APIs where edges are an API's super class and interfaces. // - // This sorts the apis to have child classes be listed before their parent + // This sorts the APIs to have child classes be listed before their parent // classes. This prevents the scenario where a method might return the super // class of the actual class, so the incorrect Dart class gets created // because the 'value is ' was checked first in the codec. For From c49aff240d9e3f7e48f924add48dce8cde56a3f3 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 3 Jun 2024 20:36:14 -0400 Subject: [PATCH 31/77] regen and no ps --- packages/pigeon/lib/kotlin/templates.dart | 6 +++--- .../com/example/test_plugin/ProxyApiTests.gen.kt | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/pigeon/lib/kotlin/templates.dart b/packages/pigeon/lib/kotlin/templates.dart index 9e39830b2af1..720b9f36b612 100644 --- a/packages/pigeon/lib/kotlin/templates.dart +++ b/packages/pigeon/lib/kotlin/templates.dart @@ -9,12 +9,12 @@ const String instanceManagerTemplate = ''' /** * Maintains instances used to communicate with the corresponding objects in Dart. * - *

Objects stored in this container are represented by an object in Dart that is also stored in + * Objects stored in this container are represented by an object in Dart that is also stored in * an InstanceManager with the same identifier. * - *

When an instance is added with an identifier, either can be used to retrieve the other. + * When an instance is added with an identifier, either can be used to retrieve the other. * - *

Added instances are added as a weak reference and a strong reference. When the strong + * Added instances are added as a weak reference and a strong reference. When the strong * reference is removed with [remove] and the weak reference is deallocated, the * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the strong * reference is removed and then the identifier is retrieved with the intention to pass the identifier diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 1104acf694a4..0e1e04f5c984 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -51,13 +51,13 @@ class ProxyApiTestsError( /** * Maintains instances used to communicate with the corresponding objects in Dart. * - *

Objects stored in this container are represented by an object in Dart that is also stored in - * an InstanceManager with the same identifier. + * Objects stored in this container are represented by an object in Dart that is also stored in an + * InstanceManager with the same identifier. * - *

When an instance is added with an identifier, either can be used to retrieve the other. + * When an instance is added with an identifier, either can be used to retrieve the other. * - *

Added instances are added as a weak reference and a strong reference. When the strong - * reference is removed with [remove] and the weak reference is deallocated, the + * Added instances are added as a weak reference and a strong reference. When the strong reference + * is removed with [remove] and the weak reference is deallocated, the * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the * strong reference is removed and then the identifier is retrieved with the intention to pass the * identifier to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the @@ -184,7 +184,7 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization } /** - * Stop the periodic run of the [PigeonFinalizationListener] for instances that have been garbage + * Stops the periodic run of the [PigeonFinalizationListener] for instances that have been garbage * collected. * * The InstanceManager can continue to be used, but the [PigeonFinalizationListener] will no From c7e5ad0ff61550cbb38f43ada11dd4854b18fe7a Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 3 Jun 2024 20:41:55 -0400 Subject: [PATCH 32/77] use addDocumenetationCommetns instead --- packages/pigeon/lib/kotlin_generator.dart | 34 +++++++++++++---------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 6a92457745c5..8d60ba7d21a5 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -520,10 +520,12 @@ class KotlinGenerator extends StructuredGenerator { dartPackageName: dartPackageName, ); - indent.format( - '/**\n' - ' * Generated API for managing the Dart and native `$instanceManagerClassName`s.\n' - ' */', + addDocumentationComments( + indent, + [ + 'Generated API for managing the Dart and native `$instanceManagerClassName`s.', + ], + _docCommentSpec, ); indent.writeScoped( 'private class $instanceManagerApiName(val binaryMessenger: BinaryMessenger) {', @@ -537,11 +539,13 @@ class KotlinGenerator extends StructuredGenerator { }); indent.newln(); - indent.format( - '/**\n' - ' * Sets up an instance of `$instanceManagerApiName` to handle messages from the\n' - ' * `binaryMessenger`.\n' - ' */', + addDocumentationComments( + indent, + [ + 'Sets up an instance of `$instanceManagerApiName` to handle messages from the', + '`binaryMessenger`.', + ], + _docCommentSpec, ); indent.writeScoped( 'fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: $instanceManagerClassName?) {', @@ -1211,11 +1215,13 @@ class KotlinGenerator extends StructuredGenerator { const String registrarName = '${classNamePrefix}ProxyApiRegistrar'; const String instanceManagerApiName = '${instanceManagerClassName}Api'; - indent.format( - '/**\n' - ' * Provides implementations for each ProxyApi implementation and provides access to resources\n' - ' * needed by any implementation.\n' - ' */', + addDocumentationComments( + indent, + [ + 'Provides implementations for each ProxyApi implementation and provides access to resources', + 'needed by any implementation.', + ], + _docCommentSpec, ); indent.writeScoped( 'abstract class $registrarName(val binaryMessenger: BinaryMessenger) {', From 302543882e9d18b7591a26d5065b43cf1a921d7d Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 4 Jun 2024 10:22:40 -0400 Subject: [PATCH 33/77] use write scoped --- packages/pigeon/lib/kotlin_generator.dart | 63 ++++++++++--------- .../com/example/test_plugin/CoreTests.gen.kt | 3 + .../example/test_plugin/ProxyApiTests.gen.kt | 1 - 3 files changed, 37 insertions(+), 30 deletions(-) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 8bf7ad3d1b13..eb16fde9fe0b 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -1229,35 +1229,40 @@ class KotlinGenerator extends StructuredGenerator { '}', () { indent.writeln('val instanceManager: $instanceManagerClassName'); - indent.format( - 'private var _codec: StandardMessageCodec? = null\n' - 'val codec: StandardMessageCodec\n' - ' get() {\n' - ' if (_codec == null) {\n ' - ' _codec = PigeonProxyApiBaseCodec(this)\n' - ' }\n' - ' return _codec!!\n' - ' }\n', - ); - indent.format( - 'init {\n' - ' val api = $instanceManagerApiName(binaryMessenger)\n' - ' instanceManager =\n' - ' $instanceManagerClassName.create(\n' - ' object : $instanceManagerClassName.PigeonFinalizationListener {\n' - ' override fun onFinalize(identifier: Long) {\n' - ' api.removeStrongReference(identifier) {\n' - ' if (it.isFailure) {\n' - ' Log.e(\n' - ' "$registrarName",\n' - ' "Failed to remove Dart strong reference with identifier: \$identifier"\n' - ' )\n' - ' }\n' - ' }\n' - ' }\n' - ' })\n' - '}\n', - ); + indent.writeln('private var _codec: StandardMessageCodec? = null'); + indent.writeScoped('val codec: StandardMessageCodec', '', () { + indent.writeScoped('get() {', '}', () { + indent.writeScoped('if (_codec == null) {', '}', () { + indent.writeln('_codec = PigeonProxyApiBaseCodec(this)'); + }); + indent.writeln('return _codec!!'); + }); + }); + indent.writeScoped('init {', '}', () { + indent.writeln('val api = $instanceManagerApiName(binaryMessenger)'); + indent.writeScoped( + 'instanceManager = $instanceManagerClassName.create(', ')', () { + indent.writeScoped( + 'object : $instanceManagerClassName.PigeonFinalizationListener {', + '}', () { + indent.writeScoped( + 'override fun onFinalize(identifier: Long) {', '}', () { + indent.writeScoped( + 'api.removeStrongReference(identifier) {', '}', () { + indent.writeScoped('if (it.isFailure) {', '}', () { + indent.writeScoped('Log.e(', ')', () { + indent.writeln('"$registrarName",'); + indent.writeln( + r'"Failed to remove Dart strong reference with identifier: $identifier"', + ); + }); + }); + }); + }); + }); + }); + }); + indent.newln(); for (final AstProxyApi api in allProxyApis) { _writeMethodDeclaration( indent, diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt index 3668ec947384..a64e74880770 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt @@ -635,6 +635,7 @@ interface HostIntegrationCoreApi { * Sets up an instance of `HostIntegrationCoreApi` to handle messages through the * `binaryMessenger`. */ + @JvmOverloads fun setUp( binaryMessenger: BinaryMessenger, api: HostIntegrationCoreApi?, @@ -3327,6 +3328,7 @@ interface HostTrivialApi { /** The codec used by HostTrivialApi. */ val codec: MessageCodec by lazy { StandardMessageCodec() } /** Sets up an instance of `HostTrivialApi` to handle messages through the `binaryMessenger`. */ + @JvmOverloads fun setUp( binaryMessenger: BinaryMessenger, api: HostTrivialApi?, @@ -3372,6 +3374,7 @@ interface HostSmallApi { /** The codec used by HostSmallApi. */ val codec: MessageCodec by lazy { StandardMessageCodec() } /** Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. */ + @JvmOverloads fun setUp( binaryMessenger: BinaryMessenger, api: HostSmallApi?, diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 0e1e04f5c984..8751a5c70b74 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -366,7 +366,6 @@ abstract class PigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { } }) } - /** * An implementation of [PigeonApiProxyApiTestClass] used to add a new Dart instance of * `ProxyApiTestClass` to the Dart `InstanceManager`. From 9af2d08f514d66fa6ec70f6b91e9453be09aa2fd Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 4 Jun 2024 10:31:27 -0400 Subject: [PATCH 34/77] use indentscoped --- packages/pigeon/lib/kotlin_generator.dart | 42 ++++++++++++------- .../example/test_plugin/ProxyApiTests.gen.kt | 1 + 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index eb16fde9fe0b..0dfd3900a6d5 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -1486,22 +1486,32 @@ class KotlinGenerator extends StructuredGenerator { final String className = typeWithRequirement .type.associatedProxyApi!.kotlinOptions?.fullClassName ?? typeWithRequirement.type.baseName; - indent.format( - 'val channel = BasicMessageChannel(\n' - ' binaryMessenger,\n' - ' "$channelName",\n' - ' codec\n' - ')\n' - 'if (api != null) {\n' - ' channel.setMessageHandler { _, reply ->\n' - ' reply.reply(wrapError(\n' - ' UnsupportedOperationException(\n' - ' "Call references class `$className`, which requires api version $apiRequirement.")))\n' - ' }\n' - '} else {\n' - ' channel.setMessageHandler(null)\n' - '}', - ); + indent.writeScoped( + 'val channel = BasicMessageChannel(', ')', () { + indent.writeln('binaryMessenger,'); + indent.writeln('"$channelName",'); + indent.writeln('codec'); + }); + indent.writeScoped('if (api != null) {', '}', () { + indent.writeScoped( + 'channel.setMessageHandler { _, reply ->', '}', () { + indent.writeScoped( + 'reply.reply(wrapError(UnsupportedOperationException(', + ')))', + () { + indent.writeln( + '"Call references class `$className`, which requires api version $apiRequirement."', + ); + }, + ); + indent.writeln( + 'reply.reply(wrapError(UnsupportedOperationException(', + ); + }); + }); + indent.writeScoped('} else {', '}', () { + indent.writeln('channel.setMessageHandler(null)'); + }); }); } else { onWrite(); diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 8751a5c70b74..0e1e04f5c984 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -366,6 +366,7 @@ abstract class PigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { } }) } + /** * An implementation of [PigeonApiProxyApiTestClass] used to add a new Dart instance of * `ProxyApiTestClass` to the Dart `InstanceManager`. From 78128b8dee3001f49b8f4bedaa5ae5731e9e71c6 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:05:38 -0400 Subject: [PATCH 35/77] use format --- packages/pigeon/lib/generator_tools.dart | 33 +++- packages/pigeon/lib/kotlin_generator.dart | 160 +++++++++--------- .../example/test_plugin/ProxyApiTests.gen.kt | 1 - 3 files changed, 109 insertions(+), 85 deletions(-) diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index b6dfbb4847a3..35e1c43962ec 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -4,6 +4,7 @@ import 'dart:convert'; import 'dart:io'; +import 'dart:math'; import 'dart:mirrors'; import 'package:yaml/yaml.dart' as yaml; @@ -76,11 +77,37 @@ class Indent { } /// Replaces the newlines and tabs of input and adds it to the stream. - void format(String input, - {bool leadingSpace = true, bool trailingNewline = true}) { + /// + /// [trimIndentation] flag finds the line with the fewest leading empty + /// spaces and trims the beginning of all lines by this number. + void format( + String input, { + bool leadingSpace = true, + bool trailingNewline = true, + bool trimIndentation = false, + }) { final List lines = input.split('\n'); + + int? shortestIndentation; + if (trimIndentation) { + for (final String line in lines) { + if (line.trim().isNotEmpty) { + final int indentationLength = line.length - line.trimLeft().length; + shortestIndentation = shortestIndentation == null + ? indentationLength + : min(shortestIndentation, indentationLength); + } + } + } + for (int i = 0; i < lines.length; ++i) { - final String line = lines[i]; + late final String line; + if (trimIndentation && lines[i].trim().isNotEmpty) { + line = lines[i].substring(shortestIndentation!); + } else { + line = lines[i]; + } + if (i == 0 && !leadingSpace) { add(line.replaceAll('\t', tab)); } else if (line.isNotEmpty) { diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 0dfd3900a6d5..bd87691e85af 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -533,7 +533,11 @@ class KotlinGenerator extends StructuredGenerator { '}', () { indent.writeScoped('companion object {', '}', () { - indent.writeln('/** The codec used by $instanceManagerApiName. */'); + addDocumentationComments( + indent, + ['The codec used by $instanceManagerApiName.'], + _docCommentSpec, + ); indent.writeScoped('val codec: MessageCodec by lazy {', '}', () { indent.writeln('StandardMessageCodec()'); @@ -659,15 +663,17 @@ class KotlinGenerator extends StructuredGenerator { '}', () { indent.format( - 'override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? {\n' - ' return when (type) {\n' - ' 128.toByte() -> {\n' - ' return registrar.instanceManager.getInstance(\n' - ' readValue(buffer).let { if (it is Int) it.toLong() else it as Long })\n' - ' }\n' - ' else -> super.readValueOfType(type, buffer)\n' - ' }\n' - '}', + ''' + override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { + return when (type) { + 128.toByte() -> { + return registrar.instanceManager.getInstance( + readValue(buffer).let { if (it is Int) it.toLong() else it as Long }) + } + else -> super.readValueOfType(type, buffer) + } + }''', + trimIndentation: true, ); indent.newln(); @@ -687,22 +693,26 @@ class KotlinGenerator extends StructuredGenerator { : ''; indent.format( - '${index > 0 ? ' else ' : ''}if (${versionCheck}value is $className) {\n' - ' registrar.get$hostProxyApiPrefix${api.name}().${classMemberNamePrefix}newInstance(value) { }\n' - '}', + ''' + ${index > 0 ? ' else ' : ''}if (${versionCheck}value is $className) { + registrar.get$hostProxyApiPrefix${api.name}().${classMemberNamePrefix}newInstance(value) { } + }''', + trimIndentation: true, ); }, ); indent.newln(); indent.format( - 'when {\n' - ' registrar.instanceManager.containsInstance(value) -> {\n' - ' stream.write(128)\n' - ' writeValue(stream, registrar.instanceManager.getIdentifierForStrongReference(value))\n' - ' }\n' - ' else -> super.writeValue(stream, value)\n' - '}', + ''' + when { + registrar.instanceManager.containsInstance(value) -> { + stream.write(128) + writeValue(stream, registrar.instanceManager.getIdentifierForStrongReference(value)) + } + else -> super.writeValue(stream, value) + }''', + trimIndentation: true, ); }, ); @@ -1228,41 +1238,37 @@ class KotlinGenerator extends StructuredGenerator { 'abstract class $registrarName(val binaryMessenger: BinaryMessenger) {', '}', () { - indent.writeln('val instanceManager: $instanceManagerClassName'); - indent.writeln('private var _codec: StandardMessageCodec? = null'); - indent.writeScoped('val codec: StandardMessageCodec', '', () { - indent.writeScoped('get() {', '}', () { - indent.writeScoped('if (_codec == null) {', '}', () { - indent.writeln('_codec = PigeonProxyApiBaseCodec(this)'); - }); - indent.writeln('return _codec!!'); - }); - }); - indent.writeScoped('init {', '}', () { - indent.writeln('val api = $instanceManagerApiName(binaryMessenger)'); - indent.writeScoped( - 'instanceManager = $instanceManagerClassName.create(', ')', () { - indent.writeScoped( - 'object : $instanceManagerClassName.PigeonFinalizationListener {', - '}', () { - indent.writeScoped( - 'override fun onFinalize(identifier: Long) {', '}', () { - indent.writeScoped( - 'api.removeStrongReference(identifier) {', '}', () { - indent.writeScoped('if (it.isFailure) {', '}', () { - indent.writeScoped('Log.e(', ')', () { - indent.writeln('"$registrarName",'); - indent.writeln( - r'"Failed to remove Dart strong reference with identifier: $identifier"', - ); - }); - }); - }); - }); - }); - }); - }); - indent.newln(); + indent.format( + ''' + val instanceManager: $instanceManagerClassName + private var _codec: StandardMessageCodec? = null + val codec: StandardMessageCodec + get() { + if (_codec == null) { + _codec = PigeonProxyApiBaseCodec(this) + } + return _codec!! + } + + init { + val api = $instanceManagerApiName(binaryMessenger) + instanceManager = $instanceManagerClassName.create( + object : $instanceManagerClassName.PigeonFinalizationListener { + override fun onFinalize(identifier: Long) { + api.removeStrongReference(identifier) { + if (it.isFailure) { + Log.e( + "$registrarName", + "Failed to remove Dart strong reference with identifier: \$identifier" + ) + } + } + } + } + ) + }''', + trimIndentation: true, + ); for (final AstProxyApi api in allProxyApis) { _writeMethodDeclaration( indent, @@ -1486,32 +1492,24 @@ class KotlinGenerator extends StructuredGenerator { final String className = typeWithRequirement .type.associatedProxyApi!.kotlinOptions?.fullClassName ?? typeWithRequirement.type.baseName; - indent.writeScoped( - 'val channel = BasicMessageChannel(', ')', () { - indent.writeln('binaryMessenger,'); - indent.writeln('"$channelName",'); - indent.writeln('codec'); - }); - indent.writeScoped('if (api != null) {', '}', () { - indent.writeScoped( - 'channel.setMessageHandler { _, reply ->', '}', () { - indent.writeScoped( - 'reply.reply(wrapError(UnsupportedOperationException(', - ')))', - () { - indent.writeln( - '"Call references class `$className`, which requires api version $apiRequirement."', - ); - }, - ); - indent.writeln( - 'reply.reply(wrapError(UnsupportedOperationException(', - ); - }); - }); - indent.writeScoped('} else {', '}', () { - indent.writeln('channel.setMessageHandler(null)'); - }); + indent.format( + ''' + val channel = BasicMessageChannel( + binaryMessenger, + "$channelName", + codec + ) + channel.setMessageHandler { _, reply -> + if (api != null) { + reply.reply(wrapError(UnsupportedOperationException( + "Call references class `$className`, which requires api version $apiRequirement." + ))) + } else { + channel.setMessageHandler(null) + } + }''', + trimIndentation: true, + ); }); } else { onWrite(); diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 0e1e04f5c984..8751a5c70b74 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -366,7 +366,6 @@ abstract class PigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { } }) } - /** * An implementation of [PigeonApiProxyApiTestClass] used to add a new Dart instance of * `ProxyApiTestClass` to the Dart `InstanceManager`. From 90f38b6efaa203ebada25535d3646360b284cd5b Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:29:57 -0400 Subject: [PATCH 36/77] fix api check probably --- packages/pigeon/lib/kotlin_generator.dart | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index bd87691e85af..827895646b2c 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -1242,13 +1242,13 @@ class KotlinGenerator extends StructuredGenerator { ''' val instanceManager: $instanceManagerClassName private var _codec: StandardMessageCodec? = null - val codec: StandardMessageCodec - get() { - if (_codec == null) { - _codec = PigeonProxyApiBaseCodec(this) - } - return _codec!! + val codec: StandardMessageCodec + get() { + if (_codec == null) { + _codec = PigeonProxyApiBaseCodec(this) } + return _codec!! + } init { val api = $instanceManagerApiName(binaryMessenger) @@ -1499,14 +1499,14 @@ class KotlinGenerator extends StructuredGenerator { "$channelName", codec ) - channel.setMessageHandler { _, reply -> - if (api != null) { + if (api != null) { + channel.setMessageHandler { _, reply -> reply.reply(wrapError(UnsupportedOperationException( "Call references class `$className`, which requires api version $apiRequirement." ))) - } else { - channel.setMessageHandler(null) } + } else { + channel.setMessageHandler(null) }''', trimIndentation: true, ); From 172ef3693b7ddf71d5f10a3fd197b23357acc1ad Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 11 Jun 2024 17:22:51 -0400 Subject: [PATCH 37/77] update codecs to be compatible --- .../dev/flutter/pigeon_example_app/Messages.g.kt | 6 +++--- packages/pigeon/lib/dart/templates.dart | 4 ++-- packages/pigeon/lib/generator_tools.dart | 12 ++++-------- packages/pigeon/lib/kotlin_generator.dart | 13 +++++++------ .../kotlin/com/example/test_plugin/CoreTests.gen.kt | 12 ++++++------ .../com/example/test_plugin/ProxyApiTests.gen.kt | 4 ++-- 6 files changed, 24 insertions(+), 27 deletions(-) diff --git a/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt b/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt index 6542e190e78e..11dea4d923a7 100644 --- a/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt +++ b/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt @@ -85,7 +85,7 @@ data class MessageData( } } -private object MessagesPigeonCodec : StandardMessageCodec() { +private open class MessagesPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { @@ -123,7 +123,7 @@ interface ExampleHostApi { companion object { /** The codec used by ExampleHostApi. */ - val codec: MessageCodec by lazy { MessagesPigeonCodec } + val codec: MessageCodec by lazy { MessagesPigeonCodec() } /** Sets up an instance of `ExampleHostApi` to handle messages through the `binaryMessenger`. */ @JvmOverloads fun setUp( @@ -210,7 +210,7 @@ class MessageFlutterApi( ) { companion object { /** The codec used by MessageFlutterApi. */ - val codec: MessageCodec by lazy { MessagesPigeonCodec } + val codec: MessageCodec by lazy { MessagesPigeonCodec() } } fun flutterMethod(aStringArg: String?, callback: (Result) -> Unit) { diff --git a/packages/pigeon/lib/dart/templates.dart b/packages/pigeon/lib/dart/templates.dart index 48c5859dc3d5..ecdb5290b26d 100644 --- a/packages/pigeon/lib/dart/templates.dart +++ b/packages/pigeon/lib/dart/templates.dart @@ -268,7 +268,7 @@ class $_proxyApiCodecName extends _PigeonCodec { @override void writeValue(WriteBuffer buffer, Object? value) { if (value is $proxyApiBaseClassName) { - buffer.putUint8(128); + buffer.putUint8($proxyApiCodecInstanceManagerKey); writeValue(buffer, instanceManager.getIdentifier(value)); } else { super.writeValue(buffer, value); @@ -277,7 +277,7 @@ class $_proxyApiCodecName extends _PigeonCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case $proxyApiCodecInstanceManagerKey: return instanceManager .getInstanceWithWeakReference(readValue(buffer)! as int); default: diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index 39de6d77744e..e8cbc9e7d159 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -451,9 +451,12 @@ const List validTypes = [ 'Object', ]; +/// The dedicated key for accessing an InstanceManager in ProxyApi base codecs. +const int proxyApiCodecInstanceManagerKey = 128; + /// Custom codecs' custom types are enumerated from 255 down to this number to /// avoid collisions with the StandardMessageCodec. -const int _minimumCodecFieldKey = 129; +const int _minimumCodecFieldKey = proxyApiCodecInstanceManagerKey + 1; Iterable _getTypeArguments(TypeDeclaration type) sync* { for (final TypeDeclaration typeArg in type.typeArguments) { @@ -579,13 +582,6 @@ Map> getReferencedTypes( ); } -/// Returns true if the concrete type cannot be determined at compile-time. -bool _isConcreteTypeAmbiguous(TypeDeclaration type) { - return (type.baseName == 'List' && type.typeArguments.isEmpty) || - (type.baseName == 'Map' && type.typeArguments.isEmpty) || - type.baseName == 'Object'; -} - /// All custom definable data types. enum CustomTypes { /// A custom Class. diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 55a80d711a1e..7bed07288c2b 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -329,7 +329,7 @@ class KotlinGenerator extends StructuredGenerator { }) { final Iterable enumeratedTypes = getEnumeratedTypes(root); indent.write( - 'private object ${generatorOptions.fileSpecificClassNameComponent}$_codecName : StandardMessageCodec() '); + 'private open class ${generatorOptions.fileSpecificClassNameComponent}$_codecName : StandardMessageCodec() '); indent.addScoped('{', '}', () { indent.write( 'override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? '); @@ -418,7 +418,7 @@ class KotlinGenerator extends StructuredGenerator { indent.write('val codec: MessageCodec by lazy '); indent.addScoped('{', '}', () { indent.writeln( - '${generatorOptions.fileSpecificClassNameComponent}$_codecName'); + '${generatorOptions.fileSpecificClassNameComponent}$_codecName()'); }); }); @@ -500,7 +500,7 @@ class KotlinGenerator extends StructuredGenerator { indent.write('val codec: MessageCodec by lazy '); indent.addScoped('{', '}', () { indent.writeln( - '${generatorOptions.fileSpecificClassNameComponent}$_codecName'); + '${generatorOptions.fileSpecificClassNameComponent}$_codecName()'); }); indent.writeln( '/** Sets up an instance of `$apiName` to handle messages through the `binaryMessenger`. */'); @@ -695,14 +695,15 @@ class KotlinGenerator extends StructuredGenerator { ); indent.writeScoped( - 'private class $codecName(val registrar: PigeonProxyApiRegistrar) : StandardMessageCodec() {', + 'private class $codecName(val registrar: PigeonProxyApiRegistrar) : ' + '${generatorOptions.fileSpecificClassNameComponent}$_codecName() {', '}', () { indent.format( ''' override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { - 128.toByte() -> { + $proxyApiCodecInstanceManagerKey.toByte() -> { return registrar.instanceManager.getInstance( readValue(buffer).let { if (it is Int) it.toLong() else it as Long }) } @@ -743,7 +744,7 @@ class KotlinGenerator extends StructuredGenerator { ''' when { registrar.instanceManager.containsInstance(value) -> { - stream.write(128) + stream.write($proxyApiCodecInstanceManagerKey) writeValue(stream, registrar.instanceManager.getIdentifierForStrongReference(value)) } else -> super.writeValue(stream, value) diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt index f90b51196112..cd8b26c0d257 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt @@ -406,7 +406,7 @@ data class TestMessage(val testList: List? = null) { } } -private object CoreTestsPigeonCodec : StandardMessageCodec() { +private open class CoreTestsPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { @@ -689,7 +689,7 @@ interface HostIntegrationCoreApi { companion object { /** The codec used by HostIntegrationCoreApi. */ - val codec: MessageCodec by lazy { CoreTestsPigeonCodec } + val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } /** * Sets up an instance of `HostIntegrationCoreApi` to handle messages through the * `binaryMessenger`. @@ -2689,7 +2689,7 @@ class FlutterIntegrationCoreApi( ) { companion object { /** The codec used by FlutterIntegrationCoreApi. */ - val codec: MessageCodec by lazy { CoreTestsPigeonCodec } + val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } } /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ fun noop(callback: (Result) -> Unit) { @@ -3333,7 +3333,7 @@ interface HostTrivialApi { companion object { /** The codec used by HostTrivialApi. */ - val codec: MessageCodec by lazy { CoreTestsPigeonCodec } + val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } /** Sets up an instance of `HostTrivialApi` to handle messages through the `binaryMessenger`. */ @JvmOverloads fun setUp( @@ -3379,7 +3379,7 @@ interface HostSmallApi { companion object { /** The codec used by HostSmallApi. */ - val codec: MessageCodec by lazy { CoreTestsPigeonCodec } + val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } /** Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. */ @JvmOverloads fun setUp( @@ -3448,7 +3448,7 @@ class FlutterSmallApi( ) { companion object { /** The codec used by FlutterSmallApi. */ - val codec: MessageCodec by lazy { CoreTestsPigeonCodec } + val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } } fun echoWrappedList(msgArg: TestMessage, callback: (Result) -> Unit) { diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 9520f4334f75..0175b2450204 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -402,7 +402,7 @@ abstract class PigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { } private class PigeonProxyApiBaseCodec(val registrar: PigeonProxyApiRegistrar) : - StandardMessageCodec() { + ProxyApiTestsPigeonCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { @@ -444,7 +444,7 @@ enum class ProxyApiTestEnum(val raw: Int) { } } -private object ProxyApiTestsPigeonCodec : StandardMessageCodec() { +private open class ProxyApiTestsPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { From c294d49bf7ce6e3c39137f6a4df79b46a49367a1 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 11 Jun 2024 21:08:50 -0400 Subject: [PATCH 38/77] analyze error fix --- .../shared_test_plugin_code/lib/integration_tests.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart index 94d6069ba806..42fe71bc7f10 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart @@ -8,7 +8,6 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'generated.dart'; -import 'src/generated/core_tests.gen.dart'; const int _biggerThanBigInt = 3000000000; const int _regularInt = 42; From 03f8a9e9306f4898a8b8158dcf92cfbf4f10f99b Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Wed, 12 Jun 2024 17:47:45 -0400 Subject: [PATCH 39/77] dont use raw when passing enums and test parent codec --- packages/pigeon/test/kotlin/proxy_api_test.dart | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/pigeon/test/kotlin/proxy_api_test.dart b/packages/pigeon/test/kotlin/proxy_api_test.dart index bc7760c68e4a..4dbf06a65afc 100644 --- a/packages/pigeon/test/kotlin/proxy_api_test.dart +++ b/packages/pigeon/test/kotlin/proxy_api_test.dart @@ -86,7 +86,7 @@ void main() { final StringBuffer sink = StringBuffer(); const KotlinGenerator generator = KotlinGenerator(); generator.generate( - const KotlinOptions(), + const KotlinOptions(fileSpecificClassNameComponent: 'MyFile'), root, sink, dartPackageName: DEFAULT_PACKAGE_NAME, @@ -106,8 +106,10 @@ void main() { ), ); - // Codec and class - expect(code, contains('class PigeonProxyApiBaseCodec')); + // Codec + expect(code, contains('private class PigeonProxyApiBaseCodec(val registrar: PigeonProxyApiRegistrar) : MyFilePigeonCodec()')); + + // Proxy API class expect( code, contains( @@ -535,8 +537,8 @@ void main() { collapsedCode, contains( 'channel.send(listOf(pigeon_identifierArg, validTypeArg, ' - 'enumTypeArg.raw, proxyApiTypeArg, nullableValidTypeArg, ' - 'nullableEnumTypeArg?.raw, nullableProxyApiTypeArg))', + 'enumTypeArg, proxyApiTypeArg, nullableValidTypeArg, ' + 'nullableEnumTypeArg, nullableProxyApiTypeArg))', ), ); expect( @@ -904,8 +906,8 @@ void main() { expect( collapsedCode, contains( - r'channel.send(listOf(pigeon_instanceArg, validTypeArg, enumTypeArg.raw, ' - r'proxyApiTypeArg, nullableValidTypeArg, nullableEnumTypeArg?.raw, ' + r'channel.send(listOf(pigeon_instanceArg, validTypeArg, enumTypeArg, ' + r'proxyApiTypeArg, nullableValidTypeArg, nullableEnumTypeArg, ' r'nullableProxyApiTypeArg))', ), ); From 6a57229e27e3e39192d68cd67ca1e35d9da0c2ec Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Wed, 12 Jun 2024 19:11:00 -0400 Subject: [PATCH 40/77] formatting --- packages/pigeon/test/kotlin/proxy_api_test.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/pigeon/test/kotlin/proxy_api_test.dart b/packages/pigeon/test/kotlin/proxy_api_test.dart index 4dbf06a65afc..0d0cd33d4c21 100644 --- a/packages/pigeon/test/kotlin/proxy_api_test.dart +++ b/packages/pigeon/test/kotlin/proxy_api_test.dart @@ -107,7 +107,10 @@ void main() { ); // Codec - expect(code, contains('private class PigeonProxyApiBaseCodec(val registrar: PigeonProxyApiRegistrar) : MyFilePigeonCodec()')); + expect( + code, + contains( + 'private class PigeonProxyApiBaseCodec(val registrar: PigeonProxyApiRegistrar) : MyFilePigeonCodec()')); // Proxy API class expect( From 38ab4a1885ff359c9f8f0cae582ebdb858481362 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 17 Jun 2024 15:27:14 -0400 Subject: [PATCH 41/77] verify api requirements work --- packages/pigeon/pigeons/proxy_api_tests.dart | 9 ++ .../src/generated/proxy_api_tests.gen.dart | 134 ++++++++++++++++ .../test_plugin/ProxyApiTestApiImpls.kt | 23 ++- .../example/test_plugin/ProxyApiTests.gen.kt | 147 ++++++++++++++++++ 4 files changed, 311 insertions(+), 2 deletions(-) diff --git a/packages/pigeon/pigeons/proxy_api_tests.dart b/packages/pigeon/pigeons/proxy_api_tests.dart index 34407a63bb07..fe6fb73fcfd2 100644 --- a/packages/pigeon/pigeons/proxy_api_tests.dart +++ b/packages/pigeon/pigeons/proxy_api_tests.dart @@ -471,3 +471,12 @@ abstract class ProxyApiSuperClass { abstract class ProxyApiInterface { late void Function()? anInterfaceMethod; } + +@ProxyApi( + kotlinOptions: KotlinProxyApiOptions(minAndroidApi: 25), +) +abstract class ClassWithApiRequirement { + ClassWithApiRequirement(); + + void aMethod(); +} diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart index 97dbbc67559e..160581c270f2 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart @@ -144,6 +144,8 @@ class PigeonInstanceManager { pigeon_instanceManager: instanceManager); ProxyApiInterface.pigeon_setUpMessageHandlers( pigeon_instanceManager: instanceManager); + ClassWithApiRequirement.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); return instanceManager; } @@ -5048,3 +5050,135 @@ class ProxyApiInterface extends PigeonProxyApiBaseClass { ); } } + +class ClassWithApiRequirement extends PigeonProxyApiBaseClass { + ClassWithApiRequirement({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + }) { + final int __pigeon_instanceIdentifier = + pigeon_instanceManager.addDartCreatedInstance(this); + final _PigeonProxyApiBaseCodec pigeonChannelCodec = + __pigeon_codecClassWithApiRequirement; + final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + () async { + const String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = await __pigeon_channel + .send([__pigeon_instanceIdentifier]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { + throw PlatformException( + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], + ); + } else { + return; + } + }(); + } + + /// Constructs [ClassWithApiRequirement] 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 + ClassWithApiRequirement.pigeon_detached({ + super.pigeon_binaryMessenger, + super.pigeon_instanceManager, + }); + + late final _PigeonProxyApiBaseCodec __pigeon_codecClassWithApiRequirement = + _PigeonProxyApiBaseCodec(pigeon_instanceManager); + + static void pigeon_setUpMessageHandlers({ + bool pigeon_clearHandlers = false, + BinaryMessenger? pigeon_binaryMessenger, + PigeonInstanceManager? pigeon_instanceManager, + ClassWithApiRequirement Function()? pigeon_newInstance, + }) { + final _PigeonProxyApiBaseCodec pigeonChannelCodec = + _PigeonProxyApiBaseCodec( + pigeon_instanceManager ?? PigeonInstanceManager.instance); + final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; + { + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (pigeon_clearHandlers) { + __pigeon_channel.setMessageHandler(null); + } else { + __pigeon_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.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.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance was null, expected non-null int.'); + try { + (pigeon_instanceManager ?? PigeonInstanceManager.instance) + .addHostCreatedInstance( + pigeon_newInstance?.call() ?? + ClassWithApiRequirement.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ), + arg_pigeon_instanceIdentifier!, + ); + return wrapResponse(empty: true); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + } + + Future aMethod() async { + final _PigeonProxyApiBaseCodec pigeonChannelCodec = + __pigeon_codecClassWithApiRequirement; + final BinaryMessenger? __pigeon_binaryMessenger = pigeon_binaryMessenger; + const String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( + __pigeon_channelName, + pigeonChannelCodec, + binaryMessenger: __pigeon_binaryMessenger, + ); + final List? __pigeon_replyList = + await __pigeon_channel.send([this]) as List?; + if (__pigeon_replyList == null) { + throw _createConnectionError(__pigeon_channelName); + } else if (__pigeon_replyList.length > 1) { + throw PlatformException( + code: __pigeon_replyList[0]! as String, + message: __pigeon_replyList[1] as String?, + details: __pigeon_replyList[2], + ); + } else { + return; + } + } + + @override + ClassWithApiRequirement pigeon_copy() { + return ClassWithApiRequirement.pigeon_detached( + pigeon_binaryMessenger: pigeon_binaryMessenger, + pigeon_instanceManager: pigeon_instanceManager, + ); + } +} diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt index 3ead9c94bd59..3c70030a8c58 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt @@ -4,6 +4,7 @@ package com.example.test_plugin +import androidx.annotation.RequiresApi import io.flutter.plugin.common.BinaryMessenger class ProxyApiTestClass : ProxyApiSuperClass(), ProxyApiInterface @@ -12,6 +13,8 @@ open class ProxyApiSuperClass interface ProxyApiInterface +@RequiresApi(25) class ClassWithApiRequirement + class ProxyApiRegistrar(binaryMessenger: BinaryMessenger) : PigeonProxyApiRegistrar(binaryMessenger) { override fun getPigeonApiProxyApiTestClass(): PigeonApiProxyApiTestClass { @@ -21,9 +24,13 @@ class ProxyApiRegistrar(binaryMessenger: BinaryMessenger) : override fun getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass { return ProxyApiSuperClassApi(this) } + + override fun getPigeonApiClassWithApiRequirement(): PigeonApiClassWithApiRequirement { + return ClassWithApiRequirementApi(this) + } } -class ProxyApiTestClassApi(pigeonRegistrar: ProxyApiRegistrar) : +class ProxyApiTestClassApi(override val pigeonRegistrar: ProxyApiRegistrar) : PigeonApiProxyApiTestClass(pigeonRegistrar) { override fun pigeon_defaultConstructor( @@ -670,7 +677,7 @@ class ProxyApiTestClassApi(pigeonRegistrar: ProxyApiRegistrar) : } } -class ProxyApiSuperClassApi(pigeonRegistrar: ProxyApiRegistrar) : +class ProxyApiSuperClassApi(override val pigeonRegistrar: ProxyApiRegistrar) : PigeonApiProxyApiSuperClass(pigeonRegistrar) { override fun pigeon_defaultConstructor(): ProxyApiSuperClass { return ProxyApiSuperClass() @@ -678,3 +685,15 @@ class ProxyApiSuperClassApi(pigeonRegistrar: ProxyApiRegistrar) : override fun aSuperMethod(pigeon_instance: ProxyApiSuperClass) {} } + +class ClassWithApiRequirementApi(override val pigeonRegistrar: ProxyApiRegistrar) : + PigeonApiClassWithApiRequirement(pigeonRegistrar) { + @RequiresApi(25) + override fun pigeon_defaultConstructor(): ClassWithApiRequirement { + return ClassWithApiRequirement() + } + + override fun aMethod(pigeon_instance: ClassWithApiRequirement) { + // Do nothing + } +} diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 0175b2450204..8baf1c9ca30e 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -386,18 +386,27 @@ abstract class PigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { return PigeonApiProxyApiInterface(this) } + /** + * An implementation of [PigeonApiClassWithApiRequirement] used to add a new Dart instance of + * `ClassWithApiRequirement` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiClassWithApiRequirement(): PigeonApiClassWithApiRequirement + fun setUp() { PigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager) PigeonApiProxyApiTestClass.setUpMessageHandlers( binaryMessenger, getPigeonApiProxyApiTestClass()) PigeonApiProxyApiSuperClass.setUpMessageHandlers( binaryMessenger, getPigeonApiProxyApiSuperClass()) + PigeonApiClassWithApiRequirement.setUpMessageHandlers( + binaryMessenger, getPigeonApiClassWithApiRequirement()) } fun tearDown() { PigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null) PigeonApiProxyApiTestClass.setUpMessageHandlers(binaryMessenger, null) PigeonApiProxyApiSuperClass.setUpMessageHandlers(binaryMessenger, null) + PigeonApiClassWithApiRequirement.setUpMessageHandlers(binaryMessenger, null) } } @@ -420,6 +429,8 @@ private class PigeonProxyApiBaseCodec(val registrar: PigeonProxyApiRegistrar) : registrar.getPigeonApiProxyApiSuperClass().pigeon_newInstance(value) {} } else if (value is ProxyApiInterface) { registrar.getPigeonApiProxyApiInterface().pigeon_newInstance(value) {} + } else if (android.os.Build.VERSION.SDK_INT >= 25 && value is ClassWithApiRequirement) { + registrar.getPigeonApiClassWithApiRequirement().pigeon_newInstance(value) {} } when { @@ -3936,3 +3947,139 @@ open class PigeonApiProxyApiInterface(open val pigeonRegistrar: PigeonProxyApiRe } } } + +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiClassWithApiRequirement(open val pigeonRegistrar: PigeonProxyApiRegistrar) { + @androidx.annotation.RequiresApi(api = 25) + abstract fun pigeon_defaultConstructor(): ClassWithApiRequirement + + @androidx.annotation.RequiresApi(api = 25) + abstract fun aMethod(pigeon_instance: ClassWithApiRequirement) + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers( + binaryMessenger: BinaryMessenger, + api: PigeonApiClassWithApiRequirement? + ) { + val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() + if (android.os.Build.VERSION.SDK_INT >= 25) { + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_identifierArg = + args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } else { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + reply.reply( + wrapError( + UnsupportedOperationException( + "Call references class `ClassWithApiRequirement`, which requires api version 25."))) + } + } else { + channel.setMessageHandler(null) + } + } + if (android.os.Build.VERSION.SDK_INT >= 25) { + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ClassWithApiRequirement + val wrapped: List = + try { + api.aMethod(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } else { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + reply.reply( + wrapError( + UnsupportedOperationException( + "Call references class `ClassWithApiRequirement`, which requires api version 25."))) + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of ClassWithApiRequirement and attaches it to [pigeon_instanceArg]. */ + @androidx.annotation.RequiresApi(api = 25) + fun pigeon_newInstance( + pigeon_instanceArg: ClassWithApiRequirement, + callback: (Result) -> Unit + ) { + 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.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } +} From fcb3aa5c10f46b1a184a4b94eab3fb00fa8409ad Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Fri, 21 Jun 2024 14:27:42 -0400 Subject: [PATCH 42/77] use helper method --- packages/pigeon/lib/ast.dart | 5 +++++ packages/pigeon/lib/kotlin_generator.dart | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/pigeon/lib/ast.dart b/packages/pigeon/lib/ast.dart index 4194713c527f..f0fd4c882cf1 100644 --- a/packages/pigeon/lib/ast.dart +++ b/packages/pigeon/lib/ast.dart @@ -280,6 +280,11 @@ class AstProxyApi extends Api { bool hasAnyFlutterMessageCalls() => hasCallbackConstructor() || flutterMethods.isNotEmpty; + /// Whether the host proxy API class will have methods that need to be + /// implemented. + bool hasMethodsRequiringImplementation() => + hasAnyHostMessageCalls() || unattachedFields.isNotEmpty; + // Recursively search for all the interfaces apis from a list of names of // interfaces. // diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 7bed07288c2b..04e6b9a05e33 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -775,9 +775,7 @@ class KotlinGenerator extends StructuredGenerator { indent.writeln('@Suppress("UNCHECKED_CAST")'); // The API only needs to be abstract if there are methods to override. final String classModifier = - api.hasAnyHostMessageCalls() || api.unattachedFields.isNotEmpty - ? 'abstract' - : 'open'; + api.hasMethodsRequiringImplementation() ? 'abstract' : 'open'; indent.writeScoped( '$classModifier class $kotlinApiName(open val pigeonRegistrar: ${classNamePrefix}ProxyApiRegistrar) {', '}', @@ -1264,7 +1262,7 @@ class KotlinGenerator extends StructuredGenerator { // Use the default API implementation if this API does not have any // methods to implement. - if (!api.hasAnyHostMessageCalls() && api.unattachedFields.isEmpty) { + if (!api.hasMethodsRequiringImplementation()) { indent.writeScoped('{', '}', () { indent.writeln('return $hostProxyApiPrefix${api.name}(this)'); }); From c981d970b9bc8d9d9764b03df700f9798582fa63 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Fri, 12 Jul 2024 14:47:16 -0400 Subject: [PATCH 43/77] update format trim indentation --- packages/pigeon/lib/generator_tools.dart | 26 +++++++------------ .../pigeon/test/generator_tools_test.dart | 20 ++++++++++++++ 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index e8cbc9e7d159..dc84ee44cc2c 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -88,25 +88,17 @@ class Indent { }) { final List lines = input.split('\n'); - int? shortestIndentation; - if (trimIndentation) { - for (final String line in lines) { - if (line.trim().isNotEmpty) { - final int indentationLength = line.length - line.trimLeft().length; - shortestIndentation = shortestIndentation == null - ? indentationLength - : min(shortestIndentation, indentationLength); - } - } - } + final int indentationToRemove = !trimIndentation + ? 0 + : lines + .where((String line) => line.trim().isNotEmpty) + .map((String line) => line.length - line.trimLeft().length) + .reduce(min); for (int i = 0; i < lines.length; ++i) { - late final String line; - if (trimIndentation && lines[i].trim().isNotEmpty) { - line = lines[i].substring(shortestIndentation!); - } else { - line = lines[i]; - } + final String line = lines[i].length >= indentationToRemove + ? lines[i].substring(indentationToRemove) + : lines[i]; if (i == 0 && !leadingSpace) { add(line.replaceAll('\t', tab)); diff --git a/packages/pigeon/test/generator_tools_test.dart b/packages/pigeon/test/generator_tools_test.dart index 6667b65a4e84..82fba08610b2 100644 --- a/packages/pigeon/test/generator_tools_test.dart +++ b/packages/pigeon/test/generator_tools_test.dart @@ -444,4 +444,24 @@ void main() { expect(result?.type, typeWithHighestMinApi); expect(result?.version, 2); }); + + test('Indent.format trims indentation', () { + final StringBuffer buffer = StringBuffer(); + final Indent indent = Indent(buffer); + + indent.format( + ''' + void myMethod() { + + print('hello'); + }''', + trimIndentation: true, + ); + + expect(buffer.toString(), ''' +void myMethod() { + + print('hello'); +}'''); + }); } From 0b7de440c670565e886d45bb8d183e9103b23f5d Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Fri, 12 Jul 2024 18:43:35 -0400 Subject: [PATCH 44/77] also check nullable can return nonnull --- .../lib/integration_tests.dart | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart index 42fe71bc7f10..7d52b2947e67 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart @@ -2001,51 +2001,72 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { testWidgets('echoNullableInt', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoNullableInt(null), null); + expect(await api.echoNullableInt(1), 1); }); testWidgets('echoNullableDouble', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoNullableDouble(null), null); + expect(await api.echoNullableDouble(1.0), 1.0); }); testWidgets('echoNullableBool', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoNullableBool(null), null); + expect(await api.echoNullableBool(false), false); }); testWidgets('echoNullableString', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoNullableString(null), null); + expect(await api.echoNullableString('aString'), 'aString'); }); testWidgets('echoNullableUint8List', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoNullableUint8List(null), null); + expect(await api.echoNullableUint8List(Uint8List(0)), Uint8List(0)); }); testWidgets('echoNullableObject', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoNullableObject(null), null); + expect(await api.echoNullableObject('aString'), 'aString'); }); testWidgets('echoNullableList', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoNullableList(null), null); + expect(await api.echoNullableList([1]), [1]); }); testWidgets('echoNullableMap', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoNullableMap(null), null); + expect( + await api.echoNullableMap({'value': 1}), + {'value': 1}, + ); }); testWidgets('echoNullableEnum', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoNullableEnum(null), null); + expect( + await api.echoNullableEnum(ProxyApiTestEnum.one), + ProxyApiTestEnum.one, + ); }); testWidgets('echoNullableProxyApi', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoNullableProxyApi(null), null); + + final ProxyApiSuperClass proxyApi = ProxyApiSuperClass(); + expect( + await api.echoNullableProxyApi(proxyApi), + proxyApi, + ); }); testWidgets('noopAsync', (_) async { @@ -2155,46 +2176,64 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { testWidgets('echoAsyncNullableInt', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoAsyncNullableInt(null), null); + expect(await api.echoAsyncNullableInt(1), 1); }); testWidgets('echoAsyncNullableDouble', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoAsyncNullableDouble(null), null); + expect(await api.echoAsyncNullableDouble(2.0), 2.0); }); testWidgets('echoAsyncNullableBool', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoAsyncNullableBool(null), null); + expect(await api.echoAsyncNullableBool(true), true); }); testWidgets('echoAsyncNullableString', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoAsyncNullableString(null), null); + expect(await api.echoAsyncNullableString('aString'), 'aString'); }); testWidgets('echoAsyncNullableUint8List', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoAsyncNullableUint8List(null), null); + expect( + await api.echoAsyncNullableUint8List(Uint8List(0)), + Uint8List(0), + ); }); testWidgets('echoAsyncNullableObject', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoAsyncNullableObject(null), null); + expect(await api.echoAsyncNullableObject(1), 1); }); testWidgets('echoAsyncNullableList', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoAsyncNullableList(null), null); + expect(await api.echoAsyncNullableList([1]), [1]); }); testWidgets('echoAsyncNullableMap', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoAsyncNullableMap(null), null); + expect( + await api.echoAsyncNullableMap({'banana': 1}), + {'banana': 1}, + ); }); testWidgets('echoAsyncNullableEnum', (_) async { final ProxyApiTestClass api = _createGenericProxyApiTestClass(); expect(await api.echoAsyncNullableEnum(null), null); + expect( + await api.echoAsyncNullableEnum(ProxyApiTestEnum.one), + ProxyApiTestEnum.one, + ); }); testWidgets('staticNoop', (_) async { @@ -2372,6 +2411,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { flutterEchoNullableBool: (_, bool? aBool) => aBool, ); expect(await api.callFlutterEchoNullableBool(null), null); + expect(await api.callFlutterEchoNullableBool(true), true); }); testWidgets('callFlutterEchoNullableInt', (_) async { @@ -2379,6 +2419,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { flutterEchoNullableInt: (_, int? anInt) => anInt, ); expect(await api.callFlutterEchoNullableInt(null), null); + expect(await api.callFlutterEchoNullableInt(1), 1); }); testWidgets('callFlutterEchoNullableDouble', (_) async { @@ -2386,6 +2427,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { flutterEchoNullableDouble: (_, double? aDouble) => aDouble, ); expect(await api.callFlutterEchoNullableDouble(null), null); + expect(await api.callFlutterEchoNullableDouble(1.0), 1.0); }); testWidgets('callFlutterEchoNullableString', (_) async { @@ -2393,6 +2435,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { flutterEchoNullableString: (_, String? aString) => aString, ); expect(await api.callFlutterEchoNullableString(null), null); + expect(await api.callFlutterEchoNullableString('aString'), 'aString'); }); testWidgets('callFlutterEchoNullableUint8List', (_) async { @@ -2400,6 +2443,10 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { flutterEchoNullableUint8List: (_, Uint8List? aUint8List) => aUint8List, ); expect(await api.callFlutterEchoNullableUint8List(null), null); + expect( + await api.callFlutterEchoNullableUint8List(Uint8List(0)), + Uint8List(0), + ); }); testWidgets('callFlutterEchoNullableList', (_) async { @@ -2407,6 +2454,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { flutterEchoNullableList: (_, List? aList) => aList, ); expect(await api.callFlutterEchoNullableList(null), null); + expect(await api.callFlutterEchoNullableList([0]), [0]); }); testWidgets('callFlutterEchoNullableMap', (_) async { @@ -2414,6 +2462,10 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { flutterEchoNullableMap: (_, Map? aMap) => aMap, ); expect(await api.callFlutterEchoNullableMap(null), null); + expect( + await api.callFlutterEchoNullableMap({'str': 0}), + {'str': 0}, + ); }); testWidgets('callFlutterEchoNullableEnum', (_) async { @@ -2421,6 +2473,10 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { flutterEchoNullableEnum: (_, ProxyApiTestEnum? anEnum) => anEnum, ); expect(await api.callFlutterEchoNullableEnum(null), null); + expect( + await api.callFlutterEchoNullableEnum(ProxyApiTestEnum.two), + ProxyApiTestEnum.two, + ); }); testWidgets('callFlutterEchoNullableProxyApi', (_) async { @@ -2428,7 +2484,11 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { flutterEchoNullableProxyApi: (_, ProxyApiSuperClass? aProxyApi) => aProxyApi, ); + expect(await api.callFlutterEchoNullableProxyApi(null), null); + + final ProxyApiSuperClass proxyApi = ProxyApiSuperClass(); + expect(await api.callFlutterEchoNullableProxyApi(proxyApi), proxyApi); }); testWidgets('callFlutterNoopAsync', (_) async { From 8974f2865912640dd22d4814b1c25016005da35c Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 16 Jul 2024 14:55:48 -0400 Subject: [PATCH 45/77] update to use file specific prefixes --- packages/pigeon/lib/kotlin/templates.dart | 15 +++-- packages/pigeon/lib/kotlin_generator.dart | 53 +++++++++++----- .../test_plugin/ProxyApiTestApiImpls.kt | 2 +- .../example/test_plugin/ProxyApiTests.gen.kt | 63 +++++++++++-------- .../test_plugin/InstanceManagerTest.kt | 24 +++---- 5 files changed, 98 insertions(+), 59 deletions(-) diff --git a/packages/pigeon/lib/kotlin/templates.dart b/packages/pigeon/lib/kotlin/templates.dart index 720b9f36b612..9637d5d6b5e4 100644 --- a/packages/pigeon/lib/kotlin/templates.dart +++ b/packages/pigeon/lib/kotlin/templates.dart @@ -5,7 +5,9 @@ import '../generator_tools.dart'; /// The Kotlin `InstanceManager`. -const String instanceManagerTemplate = ''' +String instanceManagerTemplate({required String prefix}) { + final String instanceManagerName = '$prefix$instanceManagerClassName'; + return ''' /** * Maintains instances used to communicate with the corresponding objects in Dart. * @@ -22,7 +24,7 @@ const String instanceManagerTemplate = ''' * is recreated. The strong reference will then need to be removed manually again. */ @Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") -class $instanceManagerClassName(private val finalizationListener: $_finalizationListenerClassName) { +class $instanceManagerName(private val finalizationListener: $_finalizationListenerClassName) { /** Interface for listening when a weak reference of an instance is removed from the manager. */ interface $_finalizationListenerClassName { fun onFinalize(identifier: Long) @@ -61,7 +63,7 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization // Host uses identifiers >= 2^16 and Dart is expected to use values n where, // 0 <= n < 2^16. private const val minHostCreatedIdentifier: Long = 65536 - private const val tag = "$instanceManagerClassName" + private const val tag = "$instanceManagerName" /** * Instantiate a new manager with a listener for garbage collected weak @@ -69,8 +71,8 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization * * When the manager is no longer needed, [stopFinalizationListener] must be called. */ - fun create(finalizationListener: $_finalizationListenerClassName): $instanceManagerClassName { - return $instanceManagerClassName(finalizationListener) + fun create(finalizationListener: $_finalizationListenerClassName): $instanceManagerName { + return $instanceManagerName(finalizationListener) } } @@ -93,7 +95,7 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization * * * If this method returns a nonnull identifier, this method also expects the Dart - * `$instanceManagerClassName` to have, or recreate, a weak reference to the Dart instance the + * `$instanceManagerName` to have, or recreate, a weak reference to the Dart instance the * identifier is associated with. */ fun getIdentifierForStrongReference(instance: Any?): Long? { @@ -220,6 +222,7 @@ class $instanceManagerClassName(private val finalizationListener: $_finalization } } '''; +} const String _finalizationListenerClassName = '${classNamePrefix}FinalizationListener'; diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 04e6b9a05e33..6417cadeaabc 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -534,7 +534,10 @@ class KotlinGenerator extends StructuredGenerator { Indent indent, { required String dartPackageName, }) { - indent.format(instanceManagerTemplate); + indent.format(instanceManagerTemplate( + prefix: _getFilePrefixOrEmpty(generatorOptions), + )); + indent.newln(); } @override @@ -544,15 +547,18 @@ class KotlinGenerator extends StructuredGenerator { Indent indent, { required String dartPackageName, }) { - const String instanceManagerApiName = '${instanceManagerClassName}Api'; + final String instanceManagerName = + '${_getFilePrefixOrEmpty(generatorOptions)}$instanceManagerClassName'; + + final String instanceManagerApiName = '${instanceManagerName}Api'; final String removeStrongReferenceName = makeChannelNameWithStrings( - apiName: instanceManagerApiName, + apiName: '${instanceManagerClassName}Api', methodName: 'removeStrongReference', dartPackageName: dartPackageName, ); final String clearName = makeChannelNameWithStrings( - apiName: instanceManagerApiName, + apiName: '${instanceManagerClassName}Api', methodName: 'clear', dartPackageName: dartPackageName, ); @@ -589,7 +595,7 @@ class KotlinGenerator extends StructuredGenerator { _docCommentSpec, ); indent.writeScoped( - 'fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: $instanceManagerClassName?) {', + 'fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: $instanceManagerName?) {', '}', () { const String setHandlerCondition = 'instanceManager != null'; @@ -663,9 +669,16 @@ class KotlinGenerator extends StructuredGenerator { final Iterable allProxyApis = root.apis.whereType(); - _writeProxyApiRegistrar(indent, allProxyApis: allProxyApis); + _writeProxyApiRegistrar( + indent, + allProxyApis: allProxyApis, + filePrefix: _getFilePrefixOrEmpty(generatorOptions), + ); + + final String fullPrefix = + '${_getFilePrefixOrEmpty(generatorOptions)}$classNamePrefix'; - const String codecName = '${classNamePrefix}ProxyApiBaseCodec'; + final String codecName = '${fullPrefix}ProxyApiBaseCodec'; // Sort APIs where edges are an API's super class and interfaces. // @@ -695,7 +708,7 @@ class KotlinGenerator extends StructuredGenerator { ); indent.writeScoped( - 'private class $codecName(val registrar: PigeonProxyApiRegistrar) : ' + 'private class $codecName(val registrar: ${fullPrefix}ProxyApiRegistrar) : ' '${generatorOptions.fileSpecificClassNameComponent}$_codecName() {', '}', () { @@ -767,6 +780,9 @@ class KotlinGenerator extends StructuredGenerator { }) { final String kotlinApiName = '$hostProxyApiPrefix${api.name}'; + final String fullPrefix = + '${_getFilePrefixOrEmpty(generatorOptions)}$classNamePrefix'; + addDocumentationComments( indent, api.documentationComments, @@ -777,7 +793,7 @@ class KotlinGenerator extends StructuredGenerator { final String classModifier = api.hasMethodsRequiringImplementation() ? 'abstract' : 'open'; indent.writeScoped( - '$classModifier class $kotlinApiName(open val pigeonRegistrar: ${classNamePrefix}ProxyApiRegistrar) {', + '$classModifier class $kotlinApiName(open val pigeonRegistrar: ${fullPrefix}ProxyApiRegistrar) {', '}', () { final String fullKotlinClassName = @@ -1194,9 +1210,12 @@ class KotlinGenerator extends StructuredGenerator { void _writeProxyApiRegistrar( Indent indent, { required Iterable allProxyApis, + required String filePrefix, }) { - const String registrarName = '${classNamePrefix}ProxyApiRegistrar'; - const String instanceManagerApiName = '${instanceManagerClassName}Api'; + final String registrarName = + '$filePrefix${classNamePrefix}ProxyApiRegistrar'; + final String instanceManagerName = '$filePrefix$instanceManagerClassName'; + final String instanceManagerApiName = '${instanceManagerName}Api'; addDocumentationComments( indent, @@ -1212,20 +1231,20 @@ class KotlinGenerator extends StructuredGenerator { () { indent.format( ''' - val instanceManager: $instanceManagerClassName + val instanceManager: $instanceManagerName private var _codec: StandardMessageCodec? = null val codec: StandardMessageCodec get() { if (_codec == null) { - _codec = PigeonProxyApiBaseCodec(this) + _codec = $filePrefix${classNamePrefix}ProxyApiBaseCodec(this) } return _codec!! } init { val api = $instanceManagerApiName(binaryMessenger) - instanceManager = $instanceManagerClassName.create( - object : $instanceManagerClassName.PigeonFinalizationListener { + instanceManager = $instanceManagerName.create( + object : $instanceManagerName.PigeonFinalizationListener { override fun onFinalize(identifier: Long) { api.removeStrongReference(identifier) { if (it.isFailure) { @@ -1815,6 +1834,10 @@ class KotlinGenerator extends StructuredGenerator { ); } +String _getFilePrefixOrEmpty(KotlinOptions options) { + return options.fileSpecificClassNameComponent ?? ''; +} + String _getErrorClassName(KotlinOptions generatorOptions) => generatorOptions.errorClassName ?? 'FlutterError'; diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt index 3c70030a8c58..bfe6e4257e79 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTestApiImpls.kt @@ -16,7 +16,7 @@ interface ProxyApiInterface @RequiresApi(25) class ClassWithApiRequirement class ProxyApiRegistrar(binaryMessenger: BinaryMessenger) : - PigeonProxyApiRegistrar(binaryMessenger) { + ProxyApiTestsPigeonProxyApiRegistrar(binaryMessenger) { override fun getPigeonApiProxyApiTestClass(): PigeonApiProxyApiTestClass { return ProxyApiTestClassApi(this) } diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 8baf1c9ca30e..2692bf4bdaf3 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -64,7 +64,9 @@ class ProxyApiTestsError( * instance is recreated. The strong reference will then need to be removed manually again. */ @Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") -class PigeonInstanceManager(private val finalizationListener: PigeonFinalizationListener) { +class ProxyApiTestsPigeonInstanceManager( + private val finalizationListener: PigeonFinalizationListener +) { /** Interface for listening when a weak reference of an instance is removed from the manager. */ interface PigeonFinalizationListener { fun onFinalize(identifier: Long) @@ -100,15 +102,17 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization // Host uses identifiers >= 2^16 and Dart is expected to use values n where, // 0 <= n < 2^16. private const val minHostCreatedIdentifier: Long = 65536 - private const val tag = "PigeonInstanceManager" + private const val tag = "ProxyApiTestsPigeonInstanceManager" /** * Instantiate a new manager with a listener for garbage collected weak references. * * When the manager is no longer needed, [stopFinalizationListener] must be called. */ - fun create(finalizationListener: PigeonFinalizationListener): PigeonInstanceManager { - return PigeonInstanceManager(finalizationListener) + fun create( + finalizationListener: PigeonFinalizationListener + ): ProxyApiTestsPigeonInstanceManager { + return ProxyApiTestsPigeonInstanceManager(finalizationListener) } } @@ -129,8 +133,8 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization * strong reference to `instance` will be added and will need to be removed again with [remove]. * * If this method returns a nonnull identifier, this method also expects the Dart - * `PigeonInstanceManager` to have, or recreate, a weak reference to the Dart instance the - * identifier is associated with. + * `ProxyApiTestsPigeonInstanceManager` to have, or recreate, a weak reference to the Dart + * instance the identifier is associated with. */ fun getIdentifierForStrongReference(instance: Any?): Long? { logWarningIfFinalizationListenerHasStopped() @@ -256,18 +260,18 @@ class PigeonInstanceManager(private val finalizationListener: PigeonFinalization } /** Generated API for managing the Dart and native `PigeonInstanceManager`s. */ -private class PigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { +private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { companion object { - /** The codec used by PigeonInstanceManagerApi. */ + /** The codec used by ProxyApiTestsPigeonInstanceManagerApi. */ val codec: MessageCodec by lazy { StandardMessageCodec() } /** - * Sets up an instance of `PigeonInstanceManagerApi` to handle messages from the + * Sets up an instance of `ProxyApiTestsPigeonInstanceManagerApi` to handle messages from the * `binaryMessenger`. */ fun setUpMessageHandlers( binaryMessenger: BinaryMessenger, - instanceManager: PigeonInstanceManager? + instanceManager: ProxyApiTestsPigeonInstanceManager? ) { run { val channel = @@ -339,27 +343,27 @@ private class PigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { * Provides implementations for each ProxyApi implementation and provides access to resources needed * by any implementation. */ -abstract class PigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { - val instanceManager: PigeonInstanceManager +abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { + val instanceManager: ProxyApiTestsPigeonInstanceManager private var _codec: StandardMessageCodec? = null val codec: StandardMessageCodec get() { if (_codec == null) { - _codec = PigeonProxyApiBaseCodec(this) + _codec = ProxyApiTestsPigeonProxyApiBaseCodec(this) } return _codec!! } init { - val api = PigeonInstanceManagerApi(binaryMessenger) + val api = ProxyApiTestsPigeonInstanceManagerApi(binaryMessenger) instanceManager = - PigeonInstanceManager.create( - object : PigeonInstanceManager.PigeonFinalizationListener { + ProxyApiTestsPigeonInstanceManager.create( + object : ProxyApiTestsPigeonInstanceManager.PigeonFinalizationListener { override fun onFinalize(identifier: Long) { api.removeStrongReference(identifier) { if (it.isFailure) { Log.e( - "PigeonProxyApiRegistrar", + "ProxyApiTestsPigeonProxyApiRegistrar", "Failed to remove Dart strong reference with identifier: $identifier") } } @@ -393,7 +397,7 @@ abstract class PigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { abstract fun getPigeonApiClassWithApiRequirement(): PigeonApiClassWithApiRequirement fun setUp() { - PigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager) + ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager) PigeonApiProxyApiTestClass.setUpMessageHandlers( binaryMessenger, getPigeonApiProxyApiTestClass()) PigeonApiProxyApiSuperClass.setUpMessageHandlers( @@ -403,15 +407,16 @@ abstract class PigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { } fun tearDown() { - PigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null) + ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null) PigeonApiProxyApiTestClass.setUpMessageHandlers(binaryMessenger, null) PigeonApiProxyApiSuperClass.setUpMessageHandlers(binaryMessenger, null) PigeonApiClassWithApiRequirement.setUpMessageHandlers(binaryMessenger, null) } } -private class PigeonProxyApiBaseCodec(val registrar: PigeonProxyApiRegistrar) : - ProxyApiTestsPigeonCodec() { +private class ProxyApiTestsPigeonProxyApiBaseCodec( + val registrar: ProxyApiTestsPigeonProxyApiRegistrar +) : ProxyApiTestsPigeonCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { @@ -481,7 +486,9 @@ private open class ProxyApiTestsPigeonCodec : StandardMessageCodec() { * integration tests. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: PigeonProxyApiRegistrar) { +abstract class PigeonApiProxyApiTestClass( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar +) { abstract fun pigeon_defaultConstructor( aBool: Boolean, anInt: Long, @@ -3802,7 +3809,9 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: PigeonProxyA } /** ProxyApi to serve as a super class to the core ProxyApi class. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiSuperClass(open val pigeonRegistrar: PigeonProxyApiRegistrar) { +abstract class PigeonApiProxyApiSuperClass( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar +) { abstract fun pigeon_defaultConstructor(): com.example.test_plugin.ProxyApiSuperClass abstract fun aSuperMethod(pigeon_instance: com.example.test_plugin.ProxyApiSuperClass) @@ -3896,7 +3905,9 @@ abstract class PigeonApiProxyApiSuperClass(open val pigeonRegistrar: PigeonProxy } /** ProxyApi to serve as an interface to the core ProxyApi class. */ @Suppress("UNCHECKED_CAST") -open class PigeonApiProxyApiInterface(open val pigeonRegistrar: PigeonProxyApiRegistrar) { +open class PigeonApiProxyApiInterface( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar +) { @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ProxyApiInterface and attaches it to [pigeon_instanceArg]. */ fun pigeon_newInstance(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { @@ -3949,7 +3960,9 @@ open class PigeonApiProxyApiInterface(open val pigeonRegistrar: PigeonProxyApiRe } @Suppress("UNCHECKED_CAST") -abstract class PigeonApiClassWithApiRequirement(open val pigeonRegistrar: PigeonProxyApiRegistrar) { +abstract class PigeonApiClassWithApiRequirement( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar +) { @androidx.annotation.RequiresApi(api = 25) abstract fun pigeon_defaultConstructor(): ClassWithApiRequirement diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/InstanceManagerTest.kt b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/InstanceManagerTest.kt index d1b9b783e28b..438ccfd1f444 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/InstanceManagerTest.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/InstanceManagerTest.kt @@ -14,7 +14,7 @@ import org.junit.Test class InstanceManagerTest { @Test fun addDartCreatedInstance() { - val instanceManager: PigeonInstanceManager = createInstanceManager() + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() val testObject = Any() instanceManager.addDartCreatedInstance(testObject, 0) @@ -27,7 +27,7 @@ class InstanceManagerTest { @Test fun addHostCreatedInstance() { - val instanceManager: PigeonInstanceManager = createInstanceManager() + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() val testObject = Any() val identifier: Long = instanceManager.addHostCreatedInstance(testObject) @@ -40,7 +40,7 @@ class InstanceManagerTest { @Test fun remove() { - val instanceManager: PigeonInstanceManager = createInstanceManager() + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() var testObject: Any? = Any() instanceManager.addDartCreatedInstance(testObject!!, 0) assertEquals(testObject, instanceManager.remove(0)) @@ -56,7 +56,7 @@ class InstanceManagerTest { @Test fun clear() { - val instanceManager: PigeonInstanceManager = createInstanceManager() + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() val instance = Any() instanceManager.addDartCreatedInstance(instance, 0) @@ -69,7 +69,7 @@ class InstanceManagerTest { @Test fun canAddSameObjectWithAddDartCreatedInstance() { - val instanceManager: PigeonInstanceManager = createInstanceManager() + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() val instance = Any() instanceManager.addDartCreatedInstance(instance, 0) instanceManager.addDartCreatedInstance(instance, 1) @@ -83,7 +83,7 @@ class InstanceManagerTest { @Test(expected = IllegalArgumentException::class) fun cannotAddSameObjectsWithAddHostCreatedInstance() { - val instanceManager: PigeonInstanceManager = createInstanceManager() + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() val instance = Any() instanceManager.addHostCreatedInstance(instance) instanceManager.addHostCreatedInstance(instance) @@ -93,14 +93,14 @@ class InstanceManagerTest { @Test(expected = IllegalArgumentException::class) fun cannotUseIdentifierLessThanZero() { - val instanceManager: PigeonInstanceManager = createInstanceManager() + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() instanceManager.addDartCreatedInstance(Any(), -1) instanceManager.stopFinalizationListener() } @Test(expected = IllegalArgumentException::class) fun identifiersMustBeUnique() { - val instanceManager: PigeonInstanceManager = createInstanceManager() + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() instanceManager.addDartCreatedInstance(Any(), 0) instanceManager.addDartCreatedInstance(Any(), 0) @@ -109,7 +109,7 @@ class InstanceManagerTest { @Test fun managerIsUsableWhileListenerHasStopped() { - val instanceManager: PigeonInstanceManager = createInstanceManager() + val instanceManager: ProxyApiTestsPigeonInstanceManager = createInstanceManager() instanceManager.stopFinalizationListener() val instance = Any() val identifier: Long = 0 @@ -120,9 +120,9 @@ class InstanceManagerTest { assertTrue(instanceManager.containsInstance(instance)) } - private fun createInstanceManager(): PigeonInstanceManager { - return PigeonInstanceManager.create( - object : PigeonInstanceManager.PigeonFinalizationListener { + private fun createInstanceManager(): ProxyApiTestsPigeonInstanceManager { + return ProxyApiTestsPigeonInstanceManager.create( + object : ProxyApiTestsPigeonInstanceManager.PigeonFinalizationListener { override fun onFinalize(identifier: Long) {} }) } From 4ae228dca3bb56d42f64292b2767618b991cfe8c Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 16 Jul 2024 14:58:33 -0400 Subject: [PATCH 46/77] fix test --- packages/pigeon/test/generator_tools_test.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/pigeon/test/generator_tools_test.dart b/packages/pigeon/test/generator_tools_test.dart index 82fba08610b2..ea257c6db0d6 100644 --- a/packages/pigeon/test/generator_tools_test.dart +++ b/packages/pigeon/test/generator_tools_test.dart @@ -462,6 +462,7 @@ void main() { void myMethod() { print('hello'); -}'''); +} +'''); }); } From 77ac3260362035c604883fd0d3f0cac3f7159d7b Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 16 Jul 2024 15:05:20 -0400 Subject: [PATCH 47/77] logging has name limits --- packages/pigeon/lib/kotlin/templates.dart | 2 +- packages/pigeon/lib/kotlin_generator.dart | 2 +- .../main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/pigeon/lib/kotlin/templates.dart b/packages/pigeon/lib/kotlin/templates.dart index 9637d5d6b5e4..f6bb48744b26 100644 --- a/packages/pigeon/lib/kotlin/templates.dart +++ b/packages/pigeon/lib/kotlin/templates.dart @@ -63,7 +63,7 @@ class $instanceManagerName(private val finalizationListener: $_finalizationListe // Host uses identifiers >= 2^16 and Dart is expected to use values n where, // 0 <= n < 2^16. private const val minHostCreatedIdentifier: Long = 65536 - private const val tag = "$instanceManagerName" + private const val tag = "$instanceManagerClassName" /** * Instantiate a new manager with a listener for garbage collected weak diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 6417cadeaabc..fc2351eabd56 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -1249,7 +1249,7 @@ class KotlinGenerator extends StructuredGenerator { api.removeStrongReference(identifier) { if (it.isFailure) { Log.e( - "$registrarName", + "${classNamePrefix}ProxyApiRegistrar", "Failed to remove Dart strong reference with identifier: \$identifier" ) } diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 2692bf4bdaf3..d460c004861d 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -102,7 +102,7 @@ class ProxyApiTestsPigeonInstanceManager( // Host uses identifiers >= 2^16 and Dart is expected to use values n where, // 0 <= n < 2^16. private const val minHostCreatedIdentifier: Long = 65536 - private const val tag = "ProxyApiTestsPigeonInstanceManager" + private const val tag = "PigeonInstanceManager" /** * Instantiate a new manager with a listener for garbage collected weak references. @@ -363,7 +363,7 @@ abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryM api.removeStrongReference(identifier) { if (it.isFailure) { Log.e( - "ProxyApiTestsPigeonProxyApiRegistrar", + "PigeonProxyApiRegistrar", "Failed to remove Dart strong reference with identifier: $identifier") } } From 33e374241663b9402d548900ef1db402298298db Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 16 Jul 2024 15:38:02 -0400 Subject: [PATCH 48/77] add file prefix --- packages/pigeon/test/kotlin/proxy_api_test.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/pigeon/test/kotlin/proxy_api_test.dart b/packages/pigeon/test/kotlin/proxy_api_test.dart index 0d0cd33d4c21..b86186eab117 100644 --- a/packages/pigeon/test/kotlin/proxy_api_test.dart +++ b/packages/pigeon/test/kotlin/proxy_api_test.dart @@ -95,14 +95,14 @@ void main() { final String collapsedCode = _collapseNewlineAndIndentation(code); // Instance Manager - expect(code, contains(r'class PigeonInstanceManager')); - expect(code, contains(r'class PigeonInstanceManagerApi')); + expect(code, contains(r'class MyFilePigeonInstanceManager')); + expect(code, contains(r'class MyFilePigeonInstanceManagerApi')); // API registrar expect( code, contains( - 'abstract class PigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger)', + 'abstract class MyFilePigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger)', ), ); @@ -110,7 +110,7 @@ void main() { expect( code, contains( - 'private class PigeonProxyApiBaseCodec(val registrar: PigeonProxyApiRegistrar) : MyFilePigeonCodec()')); + 'private class MyFilePigeonProxyApiBaseCodec(val registrar: PigeonProxyApiRegistrar) : MyFilePigeonCodec()')); // Proxy API class expect( From 927aeeadddc2deff4fc3a1ac572429a9125e4808 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:04:57 -0400 Subject: [PATCH 49/77] test fix hopefullY --- packages/pigeon/test/kotlin/proxy_api_test.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/pigeon/test/kotlin/proxy_api_test.dart b/packages/pigeon/test/kotlin/proxy_api_test.dart index b86186eab117..d6ddd35377bf 100644 --- a/packages/pigeon/test/kotlin/proxy_api_test.dart +++ b/packages/pigeon/test/kotlin/proxy_api_test.dart @@ -110,13 +110,13 @@ void main() { expect( code, contains( - 'private class MyFilePigeonProxyApiBaseCodec(val registrar: PigeonProxyApiRegistrar) : MyFilePigeonCodec()')); + 'private class MyFilePigeonProxyApiBaseCodec(val registrar: MyFilePigeonProxyApiRegistrar) : MyFilePigeonCodec()')); // Proxy API class expect( code, contains( - r'abstract class PigeonApiApi(open val pigeonRegistrar: PigeonProxyApiRegistrar)', + r'abstract class PigeonApiApi(open val pigeonRegistrar: MyFilePigeonProxyApiRegistrar)', ), ); From 1dd1eda82f1ab8aebb214c0e77c73b0b633aa3c9 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Fri, 19 Jul 2024 16:24:30 -0400 Subject: [PATCH 50/77] gen without formatting --- .../java/io/flutter/plugins/Messages.java | 92 +- .../flutter/pigeon_example_app/Messages.g.kt | 143 +- .../example/app/ios/Runner/Messages.g.swift | 43 +- .../example/app/lib/src/messages.g.dart | 56 +- .../example/app/macos/Runner/messages.g.h | 33 +- .../example/app/macos/Runner/messages.g.m | 146 +- .../example/app/windows/runner/messages.g.cpp | 365 +- .../example/app/windows/runner/messages.g.h | 85 +- .../CoreTests.java | 1700 ++-- .../ios/Classes/CoreTests.gen.h | 632 +- .../ios/Classes/CoreTests.gen.m | 3197 +++---- .../macos/Classes/CoreTests.gen.h | 626 +- .../macos/Classes/CoreTests.gen.m | 3181 +++---- .../background_platform_channels.gen.dart | 13 +- .../lib/src/generated/core_tests.gen.dart | 1122 +-- .../lib/src/generated/enum.gen.dart | 47 +- .../src/generated/flutter_unittests.gen.dart | 42 +- .../lib/src/generated/message.gen.dart | 73 +- .../lib/src/generated/multiple_arity.gen.dart | 38 +- .../src/generated/non_null_fields.gen.dart | 58 +- .../lib/src/generated/null_fields.gen.dart | 51 +- .../src/generated/nullable_returns.gen.dart | 139 +- .../lib/src/generated/primitive.gen.dart | 202 +- .../src/generated/proxy_api_tests.gen.dart | 95 +- .../test/test_message.gen.dart | 100 +- .../com/example/test_plugin/CoreTests.gen.kt | 2033 ++--- .../example/test_plugin/ProxyApiTests.gen.kt | 2379 ++---- .../ios/Classes/CoreTests.gen.swift | 1012 +-- .../macos/Classes/CoreTests.gen.swift | 1012 +-- .../windows/pigeon/core_tests.gen.cpp | 7405 +++++++---------- .../windows/pigeon/core_tests.gen.h | 760 +- 31 files changed, 9741 insertions(+), 17139 deletions(-) diff --git a/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java b/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java index 8b07206873a2..9676d99075a8 100644 --- a/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java +++ b/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java @@ -19,7 +19,9 @@ import java.lang.annotation.Target; import java.nio.ByteBuffer; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; @@ -37,7 +39,8 @@ public static class FlutterError extends RuntimeException { /** The error details. Must be a datatype supported by the api codec. */ public final Object details; - public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) { + public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) + { super(message); this.code = code; this.details = details; @@ -56,15 +59,14 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { errorList.add(exception.toString()); errorList.add(exception.getClass().getSimpleName()); errorList.add( - "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); + "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); } return errorList; } @NonNull protected static FlutterError createConnectionError(@NonNull String channelName) { - return new FlutterError( - "channel-error", "Unable to establish connection on channel: " + channelName + ".", ""); + return new FlutterError("channel-error", "Unable to establish connection on channel: " + channelName + ".", ""); } @Target(METHOD) @@ -135,17 +137,10 @@ public void setData(@NonNull Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } MessageData that = (MessageData) o; - return Objects.equals(name, that.name) - && Objects.equals(description, that.description) - && code.equals(that.code) - && data.equals(that.data); + return Objects.equals(name, that.name) && Objects.equals(description, that.description) && code.equals(that.code) && data.equals(that.data); } @Override @@ -253,6 +248,7 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } } + /** Asynchronous error handling return type for non-nullable API method returns. */ public interface Result { /** Success case callback method for handling returns. */ @@ -280,10 +276,10 @@ public interface VoidResult { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ExampleHostApi { - @NonNull + @NonNull String getHostLanguage(); - @NonNull + @NonNull Long add(@NonNull Long a, @NonNull Long b); void sendMessage(@NonNull MessageData message, @NonNull Result result); @@ -292,23 +288,16 @@ public interface ExampleHostApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - /** Sets up an instance of `ExampleHostApi` to handle messages through the `binaryMessenger`. */ + /**Sets up an instance of `ExampleHostApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable ExampleHostApi api) { setUp(binaryMessenger, "", api); } - - static void setUp( - @NonNull BinaryMessenger binaryMessenger, - @NonNull String messageChannelSuffix, - @Nullable ExampleHostApi api) { + static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String messageChannelSuffix, @Nullable ExampleHostApi api) { messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -316,7 +305,8 @@ static void setUp( try { String output = api.getHostLanguage(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -329,10 +319,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -341,12 +328,10 @@ static void setUp( Number aArg = (Number) args.get(0); Number bArg = (Number) args.get(1); try { - Long output = - api.add( - (aArg == null) ? null : aArg.longValue(), - (bArg == null) ? null : bArg.longValue()); + Long output = api.add((aArg == null) ? null : aArg.longValue(), (bArg == null) ? null : bArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -359,10 +344,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -398,50 +380,38 @@ public static class MessageFlutterApi { public MessageFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this(argBinaryMessenger, ""); } - - public MessageFlutterApi( - @NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { + public MessageFlutterApi(@NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { this.binaryMessenger = argBinaryMessenger; this.messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ /** The codec used by MessageFlutterApi. */ static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - public void flutterMethod(@Nullable String aStringArg, @NonNull Result result) { - final String channelName = - "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aStringArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); + result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); } else { @SuppressWarnings("ConstantConditions") String output = (String) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } } diff --git a/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt b/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt index 11dea4d923a7..c069119bb465 100644 --- a/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt +++ b/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt @@ -5,6 +5,7 @@ // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") + import android.util.Log import io.flutter.plugin.common.BasicMessageChannel import io.flutter.plugin.common.BinaryMessenger @@ -19,31 +20,33 @@ private fun wrapResult(result: Any?): List { private fun wrapError(exception: Throwable): List { return if (exception is FlutterError) { - listOf(exception.code, exception.message, exception.details) + listOf( + exception.code, + exception.message, + exception.details + ) } else { listOf( - exception.javaClass.simpleName, - exception.toString(), - "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)) + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) + ) } } private fun createConnectionError(channelName: String): FlutterError { - return FlutterError( - "channel-error", "Unable to establish connection on channel: '$channelName'.", "") -} + return FlutterError("channel-error", "Unable to establish connection on channel: '$channelName'.", "")} /** * Error class for passing custom error details to Flutter via a thrown PlatformException. - * * @property code The error code. * @property message The error message. * @property details The error details. Must be a datatype supported by the api codec. */ -class FlutterError( - val code: String, - override val message: String? = null, - val details: Any? = null +class FlutterError ( + val code: String, + override val message: String? = null, + val details: Any? = null ) : Throwable() enum class Code(val raw: Int) { @@ -58,11 +61,12 @@ enum class Code(val raw: Int) { } /** Generated class from Pigeon that represents data sent in messages. */ -data class MessageData( - val name: String? = null, - val description: String? = null, - val code: Code, - val data: Map +data class MessageData ( + val name: String? = null, + val description: String? = null, + val code: Code, + val data: Map + ) { companion object { @Suppress("LocalVariableName") @@ -74,31 +78,32 @@ data class MessageData( return MessageData(name, description, code, data) } } - fun toList(): List { return listOf( - name, - description, - code, - data, + name, + description, + code, + data, ) } } - private open class MessagesPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as? List)?.let { MessageData.fromList(it) } + return (readValue(buffer) as? List)?.let { + MessageData.fromList(it) + } } 130.toByte() -> { - return (readValue(buffer) as Int?)?.let { Code.ofRaw(it) } + return (readValue(buffer) as Int?)?.let { + Code.ofRaw(it) + } } else -> super.readValueOfType(type, buffer) } } - - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is MessageData -> { stream.write(129) @@ -113,40 +118,31 @@ private open class MessagesPigeonCodec : StandardMessageCodec() { } } + /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ interface ExampleHostApi { fun getHostLanguage(): String - fun add(a: Long, b: Long): Long - fun sendMessage(message: MessageData, callback: (Result) -> Unit) companion object { /** The codec used by ExampleHostApi. */ - val codec: MessageCodec by lazy { MessagesPigeonCodec() } + val codec: MessageCodec by lazy { + MessagesPigeonCodec() + } /** Sets up an instance of `ExampleHostApi` to handle messages through the `binaryMessenger`. */ @JvmOverloads - fun setUp( - binaryMessenger: BinaryMessenger, - api: ExampleHostApi?, - messageChannelSuffix: String = "" - ) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + fun setUp(binaryMessenger: BinaryMessenger, api: ExampleHostApi?, messageChannelSuffix: String = "") { + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = - try { - listOf(api.getHostLanguage()) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.getHostLanguage()) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -154,22 +150,17 @@ interface ExampleHostApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } val bArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = - try { - listOf(api.add(aArg, bArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.add(aArg, bArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -177,11 +168,7 @@ interface ExampleHostApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -204,39 +191,31 @@ interface ExampleHostApi { } } /** Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. */ -class MessageFlutterApi( - private val binaryMessenger: BinaryMessenger, - private val messageChannelSuffix: String = "" -) { +class MessageFlutterApi(private val binaryMessenger: BinaryMessenger, private val messageChannelSuffix: String = "") { companion object { /** The codec used by MessageFlutterApi. */ - val codec: MessageCodec by lazy { MessagesPigeonCodec() } + val codec: MessageCodec by lazy { + MessagesPigeonCodec() + } } - - fun flutterMethod(aStringArg: String?, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod$separatedMessageChannelSuffix" + fun flutterMethod(aStringArg: String?, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aStringArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as String callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } } diff --git a/packages/pigeon/example/app/ios/Runner/Messages.g.swift b/packages/pigeon/example/app/ios/Runner/Messages.g.swift index 3d5362cc4f1b..f86af0503153 100644 --- a/packages/pigeon/example/app/ios/Runner/Messages.g.swift +++ b/packages/pigeon/example/app/ios/Runner/Messages.g.swift @@ -29,7 +29,7 @@ final class PigeonError: Error { var localizedDescription: String { return "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" - } + } } private func wrapResult(_ result: Any?) -> [Any?] { @@ -59,9 +59,7 @@ private func wrapError(_ error: Any) -> [Any?] { } private func createConnectionError(withChannelName channelName: String) -> PigeonError { - return PigeonError( - code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", - details: "") + return PigeonError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "") } private func isNullish(_ value: Any?) -> Bool { @@ -154,6 +152,7 @@ class MessagesPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { static let shared = MessagesPigeonCodec(readerWriter: MessagesPigeonCodecReaderWriter()) } + /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol ExampleHostApi { func getHostLanguage() throws -> String @@ -165,14 +164,9 @@ protocol ExampleHostApi { class ExampleHostApiSetup { static var codec: FlutterStandardMessageCodec { MessagesPigeonCodec.shared } /// Sets up an instance of `ExampleHostApi` to handle messages through the `binaryMessenger`. - static func setUp( - binaryMessenger: FlutterBinaryMessenger, api: ExampleHostApi?, messageChannelSuffix: String = "" - ) { + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: ExampleHostApi?, messageChannelSuffix: String = "") { let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" - let getHostLanguageChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let getHostLanguageChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { getHostLanguageChannel.setMessageHandler { _, reply in do { @@ -185,9 +179,7 @@ class ExampleHostApiSetup { } else { getHostLanguageChannel.setMessageHandler(nil) } - let addChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let addChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { addChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -203,9 +195,7 @@ class ExampleHostApiSetup { } else { addChannel.setMessageHandler(nil) } - let sendMessageChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let sendMessageChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { sendMessageChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -226,8 +216,7 @@ class ExampleHostApiSetup { } /// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. protocol MessageFlutterApiProtocol { - func flutterMethod( - aString aStringArg: String?, completion: @escaping (Result) -> Void) + func flutterMethod(aString aStringArg: String?, completion: @escaping (Result) -> Void) } class MessageFlutterApi: MessageFlutterApiProtocol { private let binaryMessenger: FlutterBinaryMessenger @@ -239,13 +228,9 @@ class MessageFlutterApi: MessageFlutterApiProtocol { var codec: MessagesPigeonCodec { return MessagesPigeonCodec.shared } - func flutterMethod( - aString aStringArg: String?, completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func flutterMethod(aString aStringArg: String?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -257,11 +242,7 @@ class MessageFlutterApi: MessageFlutterApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! String completion(.success(result)) diff --git a/packages/pigeon/example/app/lib/src/messages.g.dart b/packages/pigeon/example/app/lib/src/messages.g.dart index d8d4fde551c5..347d829860e6 100644 --- a/packages/pigeon/example/app/lib/src/messages.g.dart +++ b/packages/pigeon/example/app/lib/src/messages.g.dart @@ -18,8 +18,7 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -70,6 +69,7 @@ class MessageData { } } + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -77,7 +77,7 @@ class _PigeonCodec extends StandardMessageCodec { if (value is MessageData) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is Code) { + } else if (value is Code) { buffer.putUint8(130); writeValue(buffer, value.index); } else { @@ -88,9 +88,9 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return MessageData.decode(readValue(buffer)!); - case 130: + case 130: final int? value = readValue(buffer) as int?; return value == null ? null : Code.values[value]; default: @@ -103,11 +103,9 @@ class ExampleHostApi { /// Constructor for [ExampleHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - ExampleHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + ExampleHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -115,10 +113,8 @@ class ExampleHostApi { final String __pigeon_messageChannelSuffix; Future getHostLanguage() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -144,10 +140,8 @@ class ExampleHostApi { } Future add(int a, int b) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -173,10 +167,8 @@ class ExampleHostApi { } Future sendMessage(MessageData message) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -207,25 +199,18 @@ abstract class MessageFlutterApi { String flutterMethod(String? aString); - static void setUp( - MessageFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp(MessageFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod was null.'); + 'Argument for dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); try { @@ -233,9 +218,8 @@ abstract class MessageFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/example/app/macos/Runner/messages.g.h b/packages/pigeon/example/app/macos/Runner/messages.g.h index 8a51885ec9f1..b5ce93a7fd30 100644 --- a/packages/pigeon/example/app/macos/Runner/messages.g.h +++ b/packages/pigeon/example/app/macos/Runner/messages.g.h @@ -30,13 +30,13 @@ typedef NS_ENUM(NSUInteger, PGNCode) { /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithName:(nullable NSString *)name - description:(nullable NSString *)description - code:(PGNCode)code - data:(NSDictionary *)data; -@property(nonatomic, copy, nullable) NSString *name; -@property(nonatomic, copy, nullable) NSString *description; + description:(nullable NSString *)description + code:(PGNCode)code + data:(NSDictionary *)data; +@property(nonatomic, copy, nullable) NSString * name; +@property(nonatomic, copy, nullable) NSString * description; @property(nonatomic, assign) PGNCode code; -@property(nonatomic, copy) NSDictionary *data; +@property(nonatomic, copy) NSDictionary * data; @end /// The codec used by all APIs. @@ -46,26 +46,19 @@ NSObject *PGNGetMessagesCodec(void); /// @return `nil` only when `error != nil`. - (nullable NSString *)getHostLanguageWithError:(FlutterError *_Nullable *_Nonnull)error; /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)addNumber:(NSInteger)a - toNumber:(NSInteger)b - error:(FlutterError *_Nullable *_Nonnull)error; -- (void)sendMessageMessage:(PGNMessageData *)message - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (nullable NSNumber *)addNumber:(NSInteger)a toNumber:(NSInteger)b error:(FlutterError *_Nullable *_Nonnull)error; +- (void)sendMessageMessage:(PGNMessageData *)message completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; @end -extern void SetUpPGNExampleHostApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpPGNExampleHostApi(id binaryMessenger, NSObject *_Nullable api); + +extern void SetUpPGNExampleHostApiWithSuffix(id binaryMessenger, NSObject *_Nullable api, NSString *messageChannelSuffix); -extern void SetUpPGNExampleHostApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); @interface PGNMessageFlutterApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -- (void)flutterMethodAString:(nullable NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger messageChannelSuffix:(nullable NSString *)messageChannelSuffix; +- (void)flutterMethodAString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end NS_ASSUME_NONNULL_END diff --git a/packages/pigeon/example/app/macos/Runner/messages.g.m b/packages/pigeon/example/app/macos/Runner/messages.g.m index 1471345b8801..5d2052266307 100644 --- a/packages/pigeon/example/app/macos/Runner/messages.g.m +++ b/packages/pigeon/example/app/macos/Runner/messages.g.m @@ -26,12 +26,7 @@ } static FlutterError *createConnectionError(NSString *channelName) { - return [FlutterError - errorWithCode:@"channel-error" - message:[NSString stringWithFormat:@"%@/%@/%@", - @"Unable to establish connection on channel: '", - channelName, @"'."] - details:@""]; + return [FlutterError errorWithCode:@"channel-error" message:[NSString stringWithFormat:@"%@/%@/%@", @"Unable to establish connection on channel: '", channelName, @"'."] details:@""]; } static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { @@ -57,10 +52,10 @@ + (nullable PGNMessageData *)nullableFromList:(NSArray *)list; @implementation PGNMessageData + (instancetype)makeWithName:(nullable NSString *)name - description:(nullable NSString *)description - code:(PGNCode)code - data:(NSDictionary *)data { - PGNMessageData *pigeonResult = [[PGNMessageData alloc] init]; + description:(nullable NSString *)description + code:(PGNCode)code + data:(NSDictionary *)data { + PGNMessageData* pigeonResult = [[PGNMessageData alloc] init]; pigeonResult.name = name; pigeonResult.description = description; pigeonResult.code = code; @@ -94,13 +89,13 @@ @interface PGNMessagesPigeonCodecReader : FlutterStandardReader @implementation PGNMessagesPigeonCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 129: + case 129: return [PGNMessageData fromList:[self readValue]]; - case 130: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil ? nil - : [[PGNCodeBox alloc] initWithValue:[enumAsNumber integerValue]]; - } + case 130: + { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil : [[PGNCodeBox alloc] initWithValue:[enumAsNumber integerValue]]; + } default: return [super readValueOfType:type]; } @@ -115,7 +110,7 @@ - (void)writeValue:(id)value { [self writeByte:129]; [self writeValue:[value toList]]; } else if ([value isKindOfClass:[PGNCodeBox class]]) { - PGNCodeBox *box = (PGNCodeBox *)value; + PGNCodeBox * box = (PGNCodeBox *)value; [self writeByte:130]; [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; } else { @@ -139,36 +134,25 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - PGNMessagesPigeonCodecReaderWriter *readerWriter = - [[PGNMessagesPigeonCodecReaderWriter alloc] init]; + PGNMessagesPigeonCodecReaderWriter *readerWriter = [[PGNMessagesPigeonCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } -void SetUpPGNExampleHostApi(id binaryMessenger, - NSObject *api) { +void SetUpPGNExampleHostApi(id binaryMessenger, NSObject *api) { SetUpPGNExampleHostApiWithSuffix(binaryMessenger, api, @""); } -void SetUpPGNExampleHostApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; +void SetUpPGNExampleHostApiWithSuffix(id binaryMessenger, NSObject *api, NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat: @".%@", messageChannelSuffix] : @""; { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_example_package." - @"ExampleHostApi.getHostLanguage", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:PGNGetMessagesCodec()]; + codec:PGNGetMessagesCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(getHostLanguageWithError:)], - @"PGNExampleHostApi api (%@) doesn't respond to @selector(getHostLanguageWithError:)", - api); + NSCAssert([api respondsToSelector:@selector(getHostLanguageWithError:)], @"PGNExampleHostApi api (%@) doesn't respond to @selector(getHostLanguageWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; NSString *output = [api getHostLanguageWithError:&error]; @@ -179,19 +163,13 @@ void SetUpPGNExampleHostApiWithSuffix(id binaryMessenger } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:PGNGetMessagesCodec()]; + codec:PGNGetMessagesCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(addNumber:toNumber:error:)], - @"PGNExampleHostApi api (%@) doesn't respond to @selector(addNumber:toNumber:error:)", - api); + NSCAssert([api respondsToSelector:@selector(addNumber:toNumber:error:)], @"PGNExampleHostApi api (%@) doesn't respond to @selector(addNumber:toNumber:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_a = [GetNullableObjectAtIndex(args, 0) integerValue]; @@ -205,25 +183,19 @@ void SetUpPGNExampleHostApiWithSuffix(id binaryMessenger } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_example_package." - @"ExampleHostApi.sendMessage", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:PGNGetMessagesCodec()]; + codec:PGNGetMessagesCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(sendMessageMessage:completion:)], - @"PGNExampleHostApi api (%@) doesn't respond to " - @"@selector(sendMessageMessage:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(sendMessageMessage:completion:)], @"PGNExampleHostApi api (%@) doesn't respond to @selector(sendMessageMessage:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; PGNMessageData *arg_message = GetNullableObjectAtIndex(args, 0); - [api sendMessageMessage:arg_message - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api sendMessageMessage:arg_message completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -240,41 +212,33 @@ @implementation PGNMessageFlutterApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; } -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger messageChannelSuffix:(nullable NSString*)messageChannelSuffix{ self = [self init]; if (self) { _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; + _messageChannelSuffix = [messageChannelSuffix length] == 0 ? @"" : [NSString stringWithFormat: @".%@", messageChannelSuffix]; } return self; } -- (void)flutterMethodAString:(nullable NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod", - _messageChannelSuffix]; +- (void)flutterMethodAString:(nullable NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:PGNGetMessagesCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:PGNGetMessagesCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } @end + diff --git a/packages/pigeon/example/app/windows/runner/messages.g.cpp b/packages/pigeon/example/app/windows/runner/messages.g.cpp index 7a43ec397a3a..3288a6957188 100644 --- a/packages/pigeon/example/app/windows/runner/messages.g.cpp +++ b/packages/pigeon/example/app/windows/runner/messages.g.cpp @@ -25,25 +25,29 @@ using flutter::EncodableMap; using flutter::EncodableValue; FlutterError CreateConnectionError(const std::string channel_name) { - return FlutterError( - "channel-error", - "Unable to establish connection on channel: '" + channel_name + "'.", - EncodableValue("")); + return FlutterError( + "channel-error", + "Unable to establish connection on channel: '" + channel_name + "'.", + EncodableValue("")); } // MessageData -MessageData::MessageData(const Code& code, const EncodableMap& data) - : code_(code), data_(data) {} - -MessageData::MessageData(const std::string* name, - const std::string* description, const Code& code, - const EncodableMap& data) - : name_(name ? std::optional(*name) : std::nullopt), - description_(description ? std::optional(*description) - : std::nullopt), - code_(code), - data_(data) {} +MessageData::MessageData( + const Code& code, + const EncodableMap& data) + : code_(code), + data_(data) {} + +MessageData::MessageData( + const std::string* name, + const std::string* description, + const Code& code, + const EncodableMap& data) + : name_(name ? std::optional(*name) : std::nullopt), + description_(description ? std::optional(*description) : std::nullopt), + code_(code), + data_(data) {} const std::string* MessageData::name() const { return name_ ? &(*name_) : nullptr; @@ -53,35 +57,47 @@ void MessageData::set_name(const std::string_view* value_arg) { name_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void MessageData::set_name(std::string_view value_arg) { name_ = value_arg; } +void MessageData::set_name(std::string_view value_arg) { + name_ = value_arg; +} + const std::string* MessageData::description() const { return description_ ? &(*description_) : nullptr; } void MessageData::set_description(const std::string_view* value_arg) { - description_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + description_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void MessageData::set_description(std::string_view value_arg) { description_ = value_arg; } -const Code& MessageData::code() const { return code_; } -void MessageData::set_code(const Code& value_arg) { code_ = value_arg; } +const Code& MessageData::code() const { + return code_; +} + +void MessageData::set_code(const Code& value_arg) { + code_ = value_arg; +} + + +const EncodableMap& MessageData::data() const { + return data_; +} -const EncodableMap& MessageData::data() const { return data_; } +void MessageData::set_data(const EncodableMap& value_arg) { + data_ = value_arg; +} -void MessageData::set_data(const EncodableMap& value_arg) { data_ = value_arg; } EncodableList MessageData::ToEncodableList() const { EncodableList list; list.reserve(4); list.push_back(name_ ? EncodableValue(*name_) : EncodableValue()); - list.push_back(description_ ? EncodableValue(*description_) - : EncodableValue()); + list.push_back(description_ ? EncodableValue(*description_) : EncodableValue()); list.push_back(CustomEncodableValue(code_)); list.push_back(EncodableValue(data_)); return list; @@ -89,8 +105,8 @@ EncodableList MessageData::ToEncodableList() const { MessageData MessageData::FromEncodableList(const EncodableList& list) { MessageData decoded( - std::any_cast(std::get(list[2])), - std::get(list[3])); + std::any_cast(std::get(list[2])), + std::get(list[3])); auto& encodable_name = list[0]; if (!encodable_name.IsNull()) { decoded.set_name(std::get(encodable_name)); @@ -102,44 +118,38 @@ MessageData MessageData::FromEncodableList(const EncodableList& list) { return decoded; } + PigeonCodecSerializer::PigeonCodecSerializer() {} EncodableValue PigeonCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { + uint8_t type, + flutter::ByteStreamReader* stream) const { switch (type) { case 129: - return CustomEncodableValue(MessageData::FromEncodableList( - std::get(ReadValue(stream)))); - case 130: { - const auto& encodable_enum_arg = ReadValue(stream); - const int64_t enum_arg_value = - encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); - return encodable_enum_arg.IsNull() - ? EncodableValue() - : CustomEncodableValue(static_cast(enum_arg_value)); - } + return CustomEncodableValue(MessageData::FromEncodableList(std::get(ReadValue(stream)))); + case 130: + { + const auto& encodable_enum_arg = ReadValue(stream); + const int64_t enum_arg_value = encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); + return encodable_enum_arg.IsNull() ? EncodableValue() : CustomEncodableValue(static_cast(enum_arg_value)); + } default: return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); - } + } } void PigeonCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = - std::get_if(&value)) { + const EncodableValue& value, + flutter::ByteStreamWriter* stream) const { + if (const CustomEncodableValue* custom_value = std::get_if(&value)) { if (custom_value->type() == typeid(MessageData)) { stream->WriteByte(129); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); + WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); return; } if (custom_value->type() == typeid(Code)) { stream->WriteByte(130); - WriteValue( - EncodableValue(static_cast(std::any_cast(*custom_value))), - stream); + WriteValue(EncodableValue(static_cast(std::any_cast(*custom_value))), stream); return; } } @@ -148,124 +158,101 @@ void PigeonCodecSerializer::WriteValue( /// The codec used by ExampleHostApi. const flutter::StandardMessageCodec& ExampleHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &PigeonCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance(&PigeonCodecSerializer::GetInstance()); } -// Sets up an instance of `ExampleHostApi` to handle messages through the -// `binary_messenger`. -void ExampleHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, - ExampleHostApi* api) { +// Sets up an instance of `ExampleHostApi` to handle messages through the `binary_messenger`. +void ExampleHostApi::SetUp( + flutter::BinaryMessenger* binary_messenger, + ExampleHostApi* api) { ExampleHostApi::SetUp(binary_messenger, api, ""); } -void ExampleHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, - ExampleHostApi* api, - const std::string& message_channel_suffix) { - const std::string prepended_suffix = - message_channel_suffix.length() > 0 - ? std::string(".") + message_channel_suffix - : ""; +void ExampleHostApi::SetUp( + flutter::BinaryMessenger* binary_messenger, + ExampleHostApi* api, + const std::string& message_channel_suffix) { + const std::string prepended_suffix = message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix : ""; { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_example_package." - "ExampleHostApi.getHostLanguage" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - ErrorOr output = api->GetHostLanguage(); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + ErrorOr output = api->GetHostLanguage(); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_arg = args.at(0); - if (encodable_a_arg.IsNull()) { - reply(WrapError("a_arg unexpectedly null.")); - return; - } - const int64_t a_arg = encodable_a_arg.LongValue(); - const auto& encodable_b_arg = args.at(1); - if (encodable_b_arg.IsNull()) { - reply(WrapError("b_arg unexpectedly null.")); - return; - } - const int64_t b_arg = encodable_b_arg.LongValue(); - ErrorOr output = api->Add(a_arg, b_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_arg = args.at(0); + if (encodable_a_arg.IsNull()) { + reply(WrapError("a_arg unexpectedly null.")); + return; + } + const int64_t a_arg = encodable_a_arg.LongValue(); + const auto& encodable_b_arg = args.at(1); + if (encodable_b_arg.IsNull()) { + reply(WrapError("b_arg unexpectedly null.")); + return; + } + const int64_t b_arg = encodable_b_arg.LongValue(); + ErrorOr output = api->Add(a_arg, b_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_message_arg = args.at(0); - if (encodable_message_arg.IsNull()) { - reply(WrapError("message_arg unexpectedly null.")); - return; - } - const auto& message_arg = std::any_cast( - std::get(encodable_message_arg)); - api->SendMessage(message_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_message_arg = args.at(0); + if (encodable_message_arg.IsNull()) { + reply(WrapError("message_arg unexpectedly null.")); + return; + } + const auto& message_arg = std::any_cast(std::get(encodable_message_arg)); + api->SendMessage(message_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } @@ -273,70 +260,60 @@ void ExampleHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, } EncodableValue ExampleHostApi::WrapError(std::string_view error_message) { - return EncodableValue( - EncodableList{EncodableValue(std::string(error_message)), - EncodableValue("Error"), EncodableValue()}); + return EncodableValue(EncodableList{ + EncodableValue(std::string(error_message)), + EncodableValue("Error"), + EncodableValue() + }); } EncodableValue ExampleHostApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{EncodableValue(error.code()), - EncodableValue(error.message()), - error.details()}); + return EncodableValue(EncodableList{ + EncodableValue(error.code()), + EncodableValue(error.message()), + error.details() + }); } -// Generated class from Pigeon that represents Flutter messages that can be -// called from C++. +// Generated class from Pigeon that represents Flutter messages that can be called from C++. MessageFlutterApi::MessageFlutterApi(flutter::BinaryMessenger* binary_messenger) - : binary_messenger_(binary_messenger), message_channel_suffix_("") {} + : binary_messenger_(binary_messenger), + message_channel_suffix_("") {} -MessageFlutterApi::MessageFlutterApi(flutter::BinaryMessenger* binary_messenger, - const std::string& message_channel_suffix) - : binary_messenger_(binary_messenger), - message_channel_suffix_(message_channel_suffix.length() > 0 - ? std::string(".") + message_channel_suffix - : "") {} +MessageFlutterApi::MessageFlutterApi( + flutter::BinaryMessenger* binary_messenger, + const std::string& message_channel_suffix) + : binary_messenger_(binary_messenger), + message_channel_suffix_(message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix : "") {} const flutter::StandardMessageCodec& MessageFlutterApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &PigeonCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance(&PigeonCodecSerializer::GetInstance()); } void MessageFlutterApi::FlutterMethod( - const std::string* a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi." - "flutterMethod" + - message_channel_suffix_; + const std::string* a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), + a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } } // namespace pigeon_example diff --git a/packages/pigeon/example/app/windows/runner/messages.g.h b/packages/pigeon/example/app/windows/runner/messages.g.h index 3218b702d9b6..a829a3093bbd 100644 --- a/packages/pigeon/example/app/windows/runner/messages.g.h +++ b/packages/pigeon/example/app/windows/runner/messages.g.h @@ -17,16 +17,17 @@ namespace pigeon_example { + // Generated class from Pigeon. class FlutterError { public: - explicit FlutterError(const std::string& code) : code_(code) {} + explicit FlutterError(const std::string& code) + : code_(code) {} explicit FlutterError(const std::string& code, const std::string& message) - : code_(code), message_(message) {} - explicit FlutterError(const std::string& code, const std::string& message, - const flutter::EncodableValue& details) - : code_(code), message_(message), details_(details) {} + : code_(code), message_(message) {} + explicit FlutterError(const std::string& code, const std::string& message, const flutter::EncodableValue& details) + : code_(code), message_(message), details_(details) {} const std::string& code() const { return code_; } const std::string& message() const { return message_; } @@ -38,8 +39,7 @@ class FlutterError { flutter::EncodableValue details_; }; -template -class ErrorOr { +template class ErrorOr { public: ErrorOr(const T& rhs) : v_(rhs) {} ErrorOr(const T&& rhs) : v_(std::move(rhs)) {} @@ -59,17 +59,26 @@ class ErrorOr { std::variant v_; }; -enum class Code { kOne = 0, kTwo = 1 }; + +enum class Code { + kOne = 0, + kTwo = 1 +}; // Generated class from Pigeon that represents data sent in messages. class MessageData { public: // Constructs an object setting all non-nullable fields. - explicit MessageData(const Code& code, const flutter::EncodableMap& data); + explicit MessageData( + const Code& code, + const flutter::EncodableMap& data); // Constructs an object setting all fields. - explicit MessageData(const std::string* name, const std::string* description, - const Code& code, const flutter::EncodableMap& data); + explicit MessageData( + const std::string* name, + const std::string* description, + const Code& code, + const flutter::EncodableMap& data); const std::string* name() const; void set_name(const std::string_view* value_arg); @@ -85,6 +94,7 @@ class MessageData { const flutter::EncodableMap& data() const; void set_data(const flutter::EncodableMap& value_arg); + private: static MessageData FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -95,6 +105,7 @@ class MessageData { std::optional description_; Code code_; flutter::EncodableMap data_; + }; class PigeonCodecSerializer : public flutter::StandardCodecSerializer { @@ -105,52 +116,60 @@ class PigeonCodecSerializer : public flutter::StandardCodecSerializer { return sInstance; } - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue( + const flutter::EncodableValue& value, + flutter::ByteStreamWriter* stream) const override; protected: flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; + uint8_t type, + flutter::ByteStreamReader* stream) const override; + }; -// Generated interface from Pigeon that represents a handler of messages from -// Flutter. +// Generated interface from Pigeon that represents a handler of messages from Flutter. class ExampleHostApi { public: ExampleHostApi(const ExampleHostApi&) = delete; ExampleHostApi& operator=(const ExampleHostApi&) = delete; virtual ~ExampleHostApi() {} virtual ErrorOr GetHostLanguage() = 0; - virtual ErrorOr Add(int64_t a, int64_t b) = 0; - virtual void SendMessage(const MessageData& message, - std::function reply)> result) = 0; + virtual ErrorOr Add( + int64_t a, + int64_t b) = 0; + virtual void SendMessage( + const MessageData& message, + std::function reply)> result) = 0; // The codec used by ExampleHostApi. static const flutter::StandardMessageCodec& GetCodec(); - // Sets up an instance of `ExampleHostApi` to handle messages through the - // `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, - ExampleHostApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, - ExampleHostApi* api, - const std::string& message_channel_suffix); + // Sets up an instance of `ExampleHostApi` to handle messages through the `binary_messenger`. + static void SetUp( + flutter::BinaryMessenger* binary_messenger, + ExampleHostApi* api); + static void SetUp( + flutter::BinaryMessenger* binary_messenger, + ExampleHostApi* api, + const std::string& message_channel_suffix); static flutter::EncodableValue WrapError(std::string_view error_message); static flutter::EncodableValue WrapError(const FlutterError& error); protected: ExampleHostApi() = default; + }; -// Generated class from Pigeon that represents Flutter messages that can be -// called from C++. +// Generated class from Pigeon that represents Flutter messages that can be called from C++. class MessageFlutterApi { public: MessageFlutterApi(flutter::BinaryMessenger* binary_messenger); - MessageFlutterApi(flutter::BinaryMessenger* binary_messenger, - const std::string& message_channel_suffix); + MessageFlutterApi( + flutter::BinaryMessenger* binary_messenger, + const std::string& message_channel_suffix); static const flutter::StandardMessageCodec& GetCodec(); - void FlutterMethod(const std::string* a_string, - std::function&& on_success, - std::function&& on_error); + void FlutterMethod( + const std::string* a_string, + std::function&& on_success, + std::function&& on_error); private: flutter::BinaryMessenger* binary_messenger_; diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java index d7c5ea64ff1e..8e7663baab70 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; @@ -41,7 +42,8 @@ public static class FlutterError extends RuntimeException { /** The error details. Must be a datatype supported by the api codec. */ public final Object details; - public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) { + public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) + { super(message); this.code = code; this.details = details; @@ -60,15 +62,14 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { errorList.add(exception.toString()); errorList.add(exception.getClass().getSimpleName()); errorList.add( - "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); + "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); } return errorList; } @NonNull protected static FlutterError createConnectionError(@NonNull String channelName) { - return new FlutterError( - "channel-error", "Unable to establish connection on channel: " + channelName + ".", ""); + return new FlutterError("channel-error", "Unable to establish connection on channel: " + channelName + ".", ""); } @Target(METHOD) @@ -92,7 +93,7 @@ private AnEnum(final int index) { /** * A class containing all supported types. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class AllTypes { private @NonNull Boolean aBool; @@ -321,49 +322,15 @@ public void setMap(@NonNull Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } AllTypes that = (AllTypes) o; - return aBool.equals(that.aBool) - && anInt.equals(that.anInt) - && anInt64.equals(that.anInt64) - && aDouble.equals(that.aDouble) - && Arrays.equals(aByteArray, that.aByteArray) - && Arrays.equals(a4ByteArray, that.a4ByteArray) - && Arrays.equals(a8ByteArray, that.a8ByteArray) - && Arrays.equals(aFloatArray, that.aFloatArray) - && anEnum.equals(that.anEnum) - && aString.equals(that.aString) - && anObject.equals(that.anObject) - && list.equals(that.list) - && stringList.equals(that.stringList) - && intList.equals(that.intList) - && doubleList.equals(that.doubleList) - && boolList.equals(that.boolList) - && map.equals(that.map); + return aBool.equals(that.aBool) && anInt.equals(that.anInt) && anInt64.equals(that.anInt64) && aDouble.equals(that.aDouble) && Arrays.equals(aByteArray, that.aByteArray) && Arrays.equals(a4ByteArray, that.a4ByteArray) && Arrays.equals(a8ByteArray, that.a8ByteArray) && Arrays.equals(aFloatArray, that.aFloatArray) && anEnum.equals(that.anEnum) && aString.equals(that.aString) && anObject.equals(that.anObject) && list.equals(that.list) && stringList.equals(that.stringList) && intList.equals(that.intList) && doubleList.equals(that.doubleList) && boolList.equals(that.boolList) && map.equals(that.map); } @Override public int hashCode() { - int __pigeon_result = - Objects.hash( - aBool, - anInt, - anInt64, - aDouble, - anEnum, - aString, - anObject, - list, - stringList, - intList, - doubleList, - boolList, - map); + int __pigeon_result = Objects.hash(aBool, anInt, anInt64, aDouble, anEnum, aString, anObject, list, stringList, intList, doubleList, boolList, map); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(aByteArray); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(a4ByteArray); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(a8ByteArray); @@ -560,13 +527,9 @@ ArrayList toList() { Object aBool = __pigeon_list.get(0); pigeonResult.setABool((Boolean) aBool); Object anInt = __pigeon_list.get(1); - pigeonResult.setAnInt( - (anInt == null) ? null : ((anInt instanceof Integer) ? (Integer) anInt : (Long) anInt)); + pigeonResult.setAnInt((anInt == null) ? null : ((anInt instanceof Integer) ? (Integer) anInt : (Long) anInt)); Object anInt64 = __pigeon_list.get(2); - pigeonResult.setAnInt64( - (anInt64 == null) - ? null - : ((anInt64 instanceof Integer) ? (Integer) anInt64 : (Long) anInt64)); + pigeonResult.setAnInt64((anInt64 == null) ? null : ((anInt64 instanceof Integer) ? (Integer) anInt64 : (Long) anInt64)); Object aDouble = __pigeon_list.get(3); pigeonResult.setADouble((Double) aDouble); Object aByteArray = __pigeon_list.get(4); @@ -602,7 +565,7 @@ ArrayList toList() { /** * A class containing all supported nullable types. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class AllNullableTypes { private @Nullable Boolean aNullableBool; @@ -827,59 +790,15 @@ public void setMap(@Nullable Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } AllNullableTypes that = (AllNullableTypes) o; - return Objects.equals(aNullableBool, that.aNullableBool) - && Objects.equals(aNullableInt, that.aNullableInt) - && Objects.equals(aNullableInt64, that.aNullableInt64) - && Objects.equals(aNullableDouble, that.aNullableDouble) - && Arrays.equals(aNullableByteArray, that.aNullableByteArray) - && Arrays.equals(aNullable4ByteArray, that.aNullable4ByteArray) - && Arrays.equals(aNullable8ByteArray, that.aNullable8ByteArray) - && Arrays.equals(aNullableFloatArray, that.aNullableFloatArray) - && Objects.equals(nullableNestedList, that.nullableNestedList) - && Objects.equals(nullableMapWithAnnotations, that.nullableMapWithAnnotations) - && Objects.equals(nullableMapWithObject, that.nullableMapWithObject) - && Objects.equals(aNullableEnum, that.aNullableEnum) - && Objects.equals(aNullableString, that.aNullableString) - && Objects.equals(aNullableObject, that.aNullableObject) - && Objects.equals(allNullableTypes, that.allNullableTypes) - && Objects.equals(list, that.list) - && Objects.equals(stringList, that.stringList) - && Objects.equals(intList, that.intList) - && Objects.equals(doubleList, that.doubleList) - && Objects.equals(boolList, that.boolList) - && Objects.equals(nestedClassList, that.nestedClassList) - && Objects.equals(map, that.map); + return Objects.equals(aNullableBool, that.aNullableBool) && Objects.equals(aNullableInt, that.aNullableInt) && Objects.equals(aNullableInt64, that.aNullableInt64) && Objects.equals(aNullableDouble, that.aNullableDouble) && Arrays.equals(aNullableByteArray, that.aNullableByteArray) && Arrays.equals(aNullable4ByteArray, that.aNullable4ByteArray) && Arrays.equals(aNullable8ByteArray, that.aNullable8ByteArray) && Arrays.equals(aNullableFloatArray, that.aNullableFloatArray) && Objects.equals(nullableNestedList, that.nullableNestedList) && Objects.equals(nullableMapWithAnnotations, that.nullableMapWithAnnotations) && Objects.equals(nullableMapWithObject, that.nullableMapWithObject) && Objects.equals(aNullableEnum, that.aNullableEnum) && Objects.equals(aNullableString, that.aNullableString) && Objects.equals(aNullableObject, that.aNullableObject) && Objects.equals(allNullableTypes, that.allNullableTypes) && Objects.equals(list, that.list) && Objects.equals(stringList, that.stringList) && Objects.equals(intList, that.intList) && Objects.equals(doubleList, that.doubleList) && Objects.equals(boolList, that.boolList) && Objects.equals(nestedClassList, that.nestedClassList) && Objects.equals(map, that.map); } @Override public int hashCode() { - int __pigeon_result = - Objects.hash( - aNullableBool, - aNullableInt, - aNullableInt64, - aNullableDouble, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, - aNullableEnum, - aNullableString, - aNullableObject, - allNullableTypes, - list, - stringList, - intList, - doubleList, - boolList, - nestedClassList, - map); + int __pigeon_result = Objects.hash(aNullableBool, aNullableInt, aNullableInt64, aNullableDouble, nullableNestedList, nullableMapWithAnnotations, nullableMapWithObject, aNullableEnum, aNullableString, aNullableObject, allNullableTypes, list, stringList, intList, doubleList, boolList, nestedClassList, map); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(aNullableByteArray); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(aNullable4ByteArray); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(aNullable8ByteArray); @@ -964,8 +883,7 @@ public static final class Builder { private @Nullable Map nullableMapWithAnnotations; @CanIgnoreReturnValue - public @NonNull Builder setNullableMapWithAnnotations( - @Nullable Map setterArg) { + public @NonNull Builder setNullableMapWithAnnotations(@Nullable Map setterArg) { this.nullableMapWithAnnotations = setterArg; return this; } @@ -1127,17 +1045,9 @@ ArrayList toList() { Object aNullableBool = __pigeon_list.get(0); pigeonResult.setANullableBool((Boolean) aNullableBool); Object aNullableInt = __pigeon_list.get(1); - pigeonResult.setANullableInt( - (aNullableInt == null) - ? null - : ((aNullableInt instanceof Integer) ? (Integer) aNullableInt : (Long) aNullableInt)); + pigeonResult.setANullableInt((aNullableInt == null) ? null : ((aNullableInt instanceof Integer) ? (Integer) aNullableInt : (Long) aNullableInt)); Object aNullableInt64 = __pigeon_list.get(2); - pigeonResult.setANullableInt64( - (aNullableInt64 == null) - ? null - : ((aNullableInt64 instanceof Integer) - ? (Integer) aNullableInt64 - : (Long) aNullableInt64)); + pigeonResult.setANullableInt64((aNullableInt64 == null) ? null : ((aNullableInt64 instanceof Integer) ? (Integer) aNullableInt64 : (Long) aNullableInt64)); Object aNullableDouble = __pigeon_list.get(3); pigeonResult.setANullableDouble((Double) aNullableDouble); Object aNullableByteArray = __pigeon_list.get(4); @@ -1181,10 +1091,11 @@ ArrayList toList() { } /** - * The primary purpose for this class is to ensure coverage of Swift structs with nullable items, - * as the primary [AllNullableTypes] class is being used to test Swift classes. + * The primary purpose for this class is to ensure coverage of Swift structs + * with nullable items, as the primary [AllNullableTypes] class is being used to + * test Swift classes. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class AllNullableTypesWithoutRecursion { private @Nullable Boolean aNullableBool; @@ -1389,55 +1300,15 @@ public void setMap(@Nullable Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } AllNullableTypesWithoutRecursion that = (AllNullableTypesWithoutRecursion) o; - return Objects.equals(aNullableBool, that.aNullableBool) - && Objects.equals(aNullableInt, that.aNullableInt) - && Objects.equals(aNullableInt64, that.aNullableInt64) - && Objects.equals(aNullableDouble, that.aNullableDouble) - && Arrays.equals(aNullableByteArray, that.aNullableByteArray) - && Arrays.equals(aNullable4ByteArray, that.aNullable4ByteArray) - && Arrays.equals(aNullable8ByteArray, that.aNullable8ByteArray) - && Arrays.equals(aNullableFloatArray, that.aNullableFloatArray) - && Objects.equals(nullableNestedList, that.nullableNestedList) - && Objects.equals(nullableMapWithAnnotations, that.nullableMapWithAnnotations) - && Objects.equals(nullableMapWithObject, that.nullableMapWithObject) - && Objects.equals(aNullableEnum, that.aNullableEnum) - && Objects.equals(aNullableString, that.aNullableString) - && Objects.equals(aNullableObject, that.aNullableObject) - && Objects.equals(list, that.list) - && Objects.equals(stringList, that.stringList) - && Objects.equals(intList, that.intList) - && Objects.equals(doubleList, that.doubleList) - && Objects.equals(boolList, that.boolList) - && Objects.equals(map, that.map); + return Objects.equals(aNullableBool, that.aNullableBool) && Objects.equals(aNullableInt, that.aNullableInt) && Objects.equals(aNullableInt64, that.aNullableInt64) && Objects.equals(aNullableDouble, that.aNullableDouble) && Arrays.equals(aNullableByteArray, that.aNullableByteArray) && Arrays.equals(aNullable4ByteArray, that.aNullable4ByteArray) && Arrays.equals(aNullable8ByteArray, that.aNullable8ByteArray) && Arrays.equals(aNullableFloatArray, that.aNullableFloatArray) && Objects.equals(nullableNestedList, that.nullableNestedList) && Objects.equals(nullableMapWithAnnotations, that.nullableMapWithAnnotations) && Objects.equals(nullableMapWithObject, that.nullableMapWithObject) && Objects.equals(aNullableEnum, that.aNullableEnum) && Objects.equals(aNullableString, that.aNullableString) && Objects.equals(aNullableObject, that.aNullableObject) && Objects.equals(list, that.list) && Objects.equals(stringList, that.stringList) && Objects.equals(intList, that.intList) && Objects.equals(doubleList, that.doubleList) && Objects.equals(boolList, that.boolList) && Objects.equals(map, that.map); } @Override public int hashCode() { - int __pigeon_result = - Objects.hash( - aNullableBool, - aNullableInt, - aNullableInt64, - aNullableDouble, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, - aNullableEnum, - aNullableString, - aNullableObject, - list, - stringList, - intList, - doubleList, - boolList, - map); + int __pigeon_result = Objects.hash(aNullableBool, aNullableInt, aNullableInt64, aNullableDouble, nullableNestedList, nullableMapWithAnnotations, nullableMapWithObject, aNullableEnum, aNullableString, aNullableObject, list, stringList, intList, doubleList, boolList, map); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(aNullableByteArray); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(aNullable4ByteArray); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(aNullable8ByteArray); @@ -1522,8 +1393,7 @@ public static final class Builder { private @Nullable Map nullableMapWithAnnotations; @CanIgnoreReturnValue - public @NonNull Builder setNullableMapWithAnnotations( - @Nullable Map setterArg) { + public @NonNull Builder setNullableMapWithAnnotations(@Nullable Map setterArg) { this.nullableMapWithAnnotations = setterArg; return this; } @@ -1660,23 +1530,14 @@ ArrayList toList() { return toListResult; } - static @NonNull AllNullableTypesWithoutRecursion fromList( - @NonNull ArrayList __pigeon_list) { + static @NonNull AllNullableTypesWithoutRecursion fromList(@NonNull ArrayList __pigeon_list) { AllNullableTypesWithoutRecursion pigeonResult = new AllNullableTypesWithoutRecursion(); Object aNullableBool = __pigeon_list.get(0); pigeonResult.setANullableBool((Boolean) aNullableBool); Object aNullableInt = __pigeon_list.get(1); - pigeonResult.setANullableInt( - (aNullableInt == null) - ? null - : ((aNullableInt instanceof Integer) ? (Integer) aNullableInt : (Long) aNullableInt)); + pigeonResult.setANullableInt((aNullableInt == null) ? null : ((aNullableInt instanceof Integer) ? (Integer) aNullableInt : (Long) aNullableInt)); Object aNullableInt64 = __pigeon_list.get(2); - pigeonResult.setANullableInt64( - (aNullableInt64 == null) - ? null - : ((aNullableInt64 instanceof Integer) - ? (Integer) aNullableInt64 - : (Long) aNullableInt64)); + pigeonResult.setANullableInt64((aNullableInt64 == null) ? null : ((aNullableInt64 instanceof Integer) ? (Integer) aNullableInt64 : (Long) aNullableInt64)); Object aNullableDouble = __pigeon_list.get(3); pigeonResult.setANullableDouble((Double) aNullableDouble); Object aNullableByteArray = __pigeon_list.get(4); @@ -1718,11 +1579,11 @@ ArrayList toList() { /** * A class for testing nested class handling. * - *

This is needed to test nested nullable and non-nullable classes, `AllNullableTypes` is - * non-nullable here as it is easier to instantiate than `AllTypes` when testing doesn't require - * both (ie. testing null classes). + * This is needed to test nested nullable and non-nullable classes, + * `AllNullableTypes` is non-nullable here as it is easier to instantiate + * than `AllTypes` when testing doesn't require both (ie. testing null classes). * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class AllClassesWrapper { private @NonNull AllNullableTypes allNullableTypes; @@ -1744,8 +1605,7 @@ public void setAllNullableTypes(@NonNull AllNullableTypes setterArg) { return allNullableTypesWithoutRecursion; } - public void setAllNullableTypesWithoutRecursion( - @Nullable AllNullableTypesWithoutRecursion setterArg) { + public void setAllNullableTypesWithoutRecursion(@Nullable AllNullableTypesWithoutRecursion setterArg) { this.allNullableTypesWithoutRecursion = setterArg; } @@ -1764,16 +1624,10 @@ public void setAllTypes(@Nullable AllTypes setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } AllClassesWrapper that = (AllClassesWrapper) o; - return allNullableTypes.equals(that.allNullableTypes) - && Objects.equals(allNullableTypesWithoutRecursion, that.allNullableTypesWithoutRecursion) - && Objects.equals(allTypes, that.allTypes); + return allNullableTypes.equals(that.allNullableTypes) && Objects.equals(allNullableTypesWithoutRecursion, that.allNullableTypesWithoutRecursion) && Objects.equals(allTypes, that.allTypes); } @Override @@ -1794,8 +1648,7 @@ public static final class Builder { private @Nullable AllNullableTypesWithoutRecursion allNullableTypesWithoutRecursion; @CanIgnoreReturnValue - public @NonNull Builder setAllNullableTypesWithoutRecursion( - @Nullable AllNullableTypesWithoutRecursion setterArg) { + public @NonNull Builder setAllNullableTypesWithoutRecursion(@Nullable AllNullableTypesWithoutRecursion setterArg) { this.allNullableTypesWithoutRecursion = setterArg; return this; } @@ -1831,8 +1684,7 @@ ArrayList toList() { Object allNullableTypes = __pigeon_list.get(0); pigeonResult.setAllNullableTypes((AllNullableTypes) allNullableTypes); Object allNullableTypesWithoutRecursion = __pigeon_list.get(1); - pigeonResult.setAllNullableTypesWithoutRecursion( - (AllNullableTypesWithoutRecursion) allNullableTypesWithoutRecursion); + pigeonResult.setAllNullableTypesWithoutRecursion((AllNullableTypesWithoutRecursion) allNullableTypesWithoutRecursion); Object allTypes = __pigeon_list.get(2); pigeonResult.setAllTypes((AllTypes) allTypes); return pigeonResult; @@ -1842,7 +1694,7 @@ ArrayList toList() { /** * A data class containing a List, used in unit tests. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class TestMessage { private @Nullable List testList; @@ -1857,12 +1709,8 @@ public void setTestList(@Nullable List setterArg) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + if (o == null || getClass() != o.getClass()) { return false; } TestMessage that = (TestMessage) o; return Objects.equals(testList, that.testList); } @@ -1956,6 +1804,7 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } } + /** Asynchronous error handling return type for non-nullable API method returns. */ public interface Result { /** Success case callback method for handling returns. */ @@ -1981,131 +1830,127 @@ public interface VoidResult { void error(@NonNull Throwable error); } /** - * The core interface that each host language plugin must implement in platform_test integration - * tests. + * The core interface that each host language plugin must implement in + * platform_test integration tests. * - *

Generated interface from Pigeon that represents a handler of messages from Flutter. + * Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface HostIntegrationCoreApi { /** - * A no-op function taking no arguments and returning no value, to sanity test basic calling. + * A no-op function taking no arguments and returning no value, to sanity + * test basic calling. */ void noop(); /** Returns the passed object, to test serialization and deserialization. */ - @NonNull + @NonNull AllTypes echoAllTypes(@NonNull AllTypes everything); /** Returns an error, to test error handling. */ - @Nullable + @Nullable Object throwError(); /** Returns an error from a void function, to test error handling. */ void throwErrorFromVoid(); /** Returns a Flutter error, to test error handling. */ - @Nullable + @Nullable Object throwFlutterError(); /** Returns passed in int. */ - @NonNull + @NonNull Long echoInt(@NonNull Long anInt); /** Returns passed in double. */ - @NonNull + @NonNull Double echoDouble(@NonNull Double aDouble); /** Returns the passed in boolean. */ - @NonNull + @NonNull Boolean echoBool(@NonNull Boolean aBool); /** Returns the passed in string. */ - @NonNull + @NonNull String echoString(@NonNull String aString); /** Returns the passed in Uint8List. */ - @NonNull + @NonNull byte[] echoUint8List(@NonNull byte[] aUint8List); /** Returns the passed in generic Object. */ - @NonNull + @NonNull Object echoObject(@NonNull Object anObject); /** Returns the passed list, to test serialization and deserialization. */ - @NonNull + @NonNull List echoList(@NonNull List list); /** Returns the passed map, to test serialization and deserialization. */ - @NonNull + @NonNull Map echoMap(@NonNull Map aMap); /** Returns the passed map to test nested class serialization and deserialization. */ - @NonNull + @NonNull AllClassesWrapper echoClassWrapper(@NonNull AllClassesWrapper wrapper); /** Returns the passed enum to test serialization and deserialization. */ - @NonNull + @NonNull AnEnum echoEnum(@NonNull AnEnum anEnum); /** Returns the default string. */ - @NonNull + @NonNull String echoNamedDefaultString(@NonNull String aString); /** Returns passed in double. */ - @NonNull + @NonNull Double echoOptionalDefaultDouble(@NonNull Double aDouble); /** Returns passed in int. */ - @NonNull + @NonNull Long echoRequiredInt(@NonNull Long anInt); /** Returns the passed object, to test serialization and deserialization. */ - @Nullable + @Nullable AllNullableTypes echoAllNullableTypes(@Nullable AllNullableTypes everything); /** Returns the passed object, to test serialization and deserialization. */ - @Nullable - AllNullableTypesWithoutRecursion echoAllNullableTypesWithoutRecursion( - @Nullable AllNullableTypesWithoutRecursion everything); + @Nullable + AllNullableTypesWithoutRecursion echoAllNullableTypesWithoutRecursion(@Nullable AllNullableTypesWithoutRecursion everything); /** - * Returns the inner `aString` value from the wrapped object, to test sending of nested objects. + * Returns the inner `aString` value from the wrapped object, to test + * sending of nested objects. */ - @Nullable + @Nullable String extractNestedNullableString(@NonNull AllClassesWrapper wrapper); /** - * Returns the inner `aString` value from the wrapped object, to test sending of nested objects. + * Returns the inner `aString` value from the wrapped object, to test + * sending of nested objects. */ - @NonNull + @NonNull AllClassesWrapper createNestedNullableString(@Nullable String nullableString); /** Returns passed in arguments of multiple types. */ - @NonNull - AllNullableTypes sendMultipleNullableTypes( - @Nullable Boolean aNullableBool, - @Nullable Long aNullableInt, - @Nullable String aNullableString); + @NonNull + AllNullableTypes sendMultipleNullableTypes(@Nullable Boolean aNullableBool, @Nullable Long aNullableInt, @Nullable String aNullableString); /** Returns passed in arguments of multiple types. */ - @NonNull - AllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion( - @Nullable Boolean aNullableBool, - @Nullable Long aNullableInt, - @Nullable String aNullableString); + @NonNull + AllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion(@Nullable Boolean aNullableBool, @Nullable Long aNullableInt, @Nullable String aNullableString); /** Returns passed in int. */ - @Nullable + @Nullable Long echoNullableInt(@Nullable Long aNullableInt); /** Returns passed in double. */ - @Nullable + @Nullable Double echoNullableDouble(@Nullable Double aNullableDouble); /** Returns the passed in boolean. */ - @Nullable + @Nullable Boolean echoNullableBool(@Nullable Boolean aNullableBool); /** Returns the passed in string. */ - @Nullable + @Nullable String echoNullableString(@Nullable String aNullableString); /** Returns the passed in Uint8List. */ - @Nullable + @Nullable byte[] echoNullableUint8List(@Nullable byte[] aNullableUint8List); /** Returns the passed in generic Object. */ - @Nullable + @Nullable Object echoNullableObject(@Nullable Object aNullableObject); /** Returns the passed list, to test serialization and deserialization. */ - @Nullable + @Nullable List echoNullableList(@Nullable List aNullableList); /** Returns the passed map, to test serialization and deserialization. */ - @Nullable + @Nullable Map echoNullableMap(@Nullable Map aNullableMap); - @Nullable + @Nullable AnEnum echoNullableEnum(@Nullable AnEnum anEnum); /** Returns passed in int. */ - @Nullable + @Nullable Long echoOptionalNullableInt(@Nullable Long aNullableInt); /** Returns the passed in string. */ - @Nullable + @Nullable String echoNamedNullableString(@Nullable String aNullableString); /** - * A no-op function taking no arguments and returning no value, to sanity test basic - * asynchronous calling. + * A no-op function taking no arguments and returning no value, to sanity + * test basic asynchronous calling. */ void noopAsync(@NonNull VoidResult result); /** Returns passed in int asynchronously. */ @@ -2123,8 +1968,7 @@ AllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion( /** Returns the passed list, to test asynchronous serialization and deserialization. */ void echoAsyncList(@NonNull List list, @NonNull Result> result); /** Returns the passed map, to test asynchronous serialization and deserialization. */ - void echoAsyncMap( - @NonNull Map aMap, @NonNull Result> result); + void echoAsyncMap(@NonNull Map aMap, @NonNull Result> result); /** Returns the passed enum, to test asynchronous serialization and deserialization. */ void echoAsyncEnum(@NonNull AnEnum anEnum, @NonNull Result result); /** Responds with an error from an async function returning a value. */ @@ -2136,12 +1980,9 @@ void echoAsyncMap( /** Returns the passed object, to test async serialization and deserialization. */ void echoAsyncAllTypes(@NonNull AllTypes everything, @NonNull Result result); /** Returns the passed object, to test serialization and deserialization. */ - void echoAsyncNullableAllNullableTypes( - @Nullable AllNullableTypes everything, @NonNull NullableResult result); + void echoAsyncNullableAllNullableTypes(@Nullable AllNullableTypes everything, @NonNull NullableResult result); /** Returns the passed object, to test serialization and deserialization. */ - void echoAsyncNullableAllNullableTypesWithoutRecursion( - @Nullable AllNullableTypesWithoutRecursion everything, - @NonNull NullableResult result); + void echoAsyncNullableAllNullableTypesWithoutRecursion(@Nullable AllNullableTypesWithoutRecursion everything, @NonNull NullableResult result); /** Returns passed in int asynchronously. */ void echoAsyncNullableInt(@Nullable Long anInt, @NonNull NullableResult result); /** Returns passed in double asynchronously. */ @@ -2151,16 +1992,13 @@ void echoAsyncNullableAllNullableTypesWithoutRecursion( /** Returns the passed string asynchronously. */ void echoAsyncNullableString(@Nullable String aString, @NonNull NullableResult result); /** Returns the passed in Uint8List asynchronously. */ - void echoAsyncNullableUint8List( - @Nullable byte[] aUint8List, @NonNull NullableResult result); + void echoAsyncNullableUint8List(@Nullable byte[] aUint8List, @NonNull NullableResult result); /** Returns the passed in generic Object asynchronously. */ void echoAsyncNullableObject(@Nullable Object anObject, @NonNull NullableResult result); /** Returns the passed list, to test asynchronous serialization and deserialization. */ - void echoAsyncNullableList( - @Nullable List list, @NonNull NullableResult> result); + void echoAsyncNullableList(@Nullable List list, @NonNull NullableResult> result); /** Returns the passed map, to test asynchronous serialization and deserialization. */ - void echoAsyncNullableMap( - @Nullable Map aMap, @NonNull NullableResult> result); + void echoAsyncNullableMap(@Nullable Map aMap, @NonNull NullableResult> result); /** Returns the passed enum, to test asynchronous serialization and deserialization. */ void echoAsyncNullableEnum(@Nullable AnEnum anEnum, @NonNull NullableResult result); @@ -2172,24 +2010,13 @@ void echoAsyncNullableMap( void callFlutterEchoAllTypes(@NonNull AllTypes everything, @NonNull Result result); - void callFlutterEchoAllNullableTypes( - @Nullable AllNullableTypes everything, @NonNull NullableResult result); + void callFlutterEchoAllNullableTypes(@Nullable AllNullableTypes everything, @NonNull NullableResult result); - void callFlutterSendMultipleNullableTypes( - @Nullable Boolean aNullableBool, - @Nullable Long aNullableInt, - @Nullable String aNullableString, - @NonNull Result result); + void callFlutterSendMultipleNullableTypes(@Nullable Boolean aNullableBool, @Nullable Long aNullableInt, @Nullable String aNullableString, @NonNull Result result); - void callFlutterEchoAllNullableTypesWithoutRecursion( - @Nullable AllNullableTypesWithoutRecursion everything, - @NonNull NullableResult result); + void callFlutterEchoAllNullableTypesWithoutRecursion(@Nullable AllNullableTypesWithoutRecursion everything, @NonNull NullableResult result); - void callFlutterSendMultipleNullableTypesWithoutRecursion( - @Nullable Boolean aNullableBool, - @Nullable Long aNullableInt, - @Nullable String aNullableString, - @NonNull Result result); + void callFlutterSendMultipleNullableTypesWithoutRecursion(@Nullable Boolean aNullableBool, @Nullable Long aNullableInt, @Nullable String aNullableString, @NonNull Result result); void callFlutterEchoBool(@NonNull Boolean aBool, @NonNull Result result); @@ -2203,33 +2030,25 @@ void callFlutterSendMultipleNullableTypesWithoutRecursion( void callFlutterEchoList(@NonNull List list, @NonNull Result> result); - void callFlutterEchoMap( - @NonNull Map aMap, @NonNull Result> result); + void callFlutterEchoMap(@NonNull Map aMap, @NonNull Result> result); void callFlutterEchoEnum(@NonNull AnEnum anEnum, @NonNull Result result); - void callFlutterEchoNullableBool( - @Nullable Boolean aBool, @NonNull NullableResult result); + void callFlutterEchoNullableBool(@Nullable Boolean aBool, @NonNull NullableResult result); void callFlutterEchoNullableInt(@Nullable Long anInt, @NonNull NullableResult result); - void callFlutterEchoNullableDouble( - @Nullable Double aDouble, @NonNull NullableResult result); + void callFlutterEchoNullableDouble(@Nullable Double aDouble, @NonNull NullableResult result); - void callFlutterEchoNullableString( - @Nullable String aString, @NonNull NullableResult result); + void callFlutterEchoNullableString(@Nullable String aString, @NonNull NullableResult result); - void callFlutterEchoNullableUint8List( - @Nullable byte[] list, @NonNull NullableResult result); + void callFlutterEchoNullableUint8List(@Nullable byte[] list, @NonNull NullableResult result); - void callFlutterEchoNullableList( - @Nullable List list, @NonNull NullableResult> result); + void callFlutterEchoNullableList(@Nullable List list, @NonNull NullableResult> result); - void callFlutterEchoNullableMap( - @Nullable Map aMap, @NonNull NullableResult> result); + void callFlutterEchoNullableMap(@Nullable Map aMap, @NonNull NullableResult> result); - void callFlutterEchoNullableEnum( - @Nullable AnEnum anEnum, @NonNull NullableResult result); + void callFlutterEchoNullableEnum(@Nullable AnEnum anEnum, @NonNull NullableResult result); void callFlutterSmallApiEchoString(@NonNull String aString, @NonNull Result result); @@ -2237,27 +2056,16 @@ void callFlutterEchoNullableEnum( static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - /** - * Sets up an instance of `HostIntegrationCoreApi` to handle messages through the - * `binaryMessenger`. - */ - static void setUp( - @NonNull BinaryMessenger binaryMessenger, @Nullable HostIntegrationCoreApi api) { + /**Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binaryMessenger`. */ + static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable HostIntegrationCoreApi api) { setUp(binaryMessenger, "", api); } - - static void setUp( - @NonNull BinaryMessenger binaryMessenger, - @NonNull String messageChannelSuffix, - @Nullable HostIntegrationCoreApi api) { + static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String messageChannelSuffix, @Nullable HostIntegrationCoreApi api) { messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2265,7 +2073,8 @@ static void setUp( try { api.noop(); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2278,10 +2087,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2291,7 +2097,8 @@ static void setUp( try { AllTypes output = api.echoAllTypes(everythingArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2304,10 +2111,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2315,7 +2119,8 @@ static void setUp( try { Object output = api.throwError(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2328,10 +2133,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2339,7 +2141,8 @@ static void setUp( try { api.throwErrorFromVoid(); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2352,10 +2155,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2363,7 +2163,8 @@ static void setUp( try { Object output = api.throwFlutterError(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2376,10 +2177,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2389,7 +2187,8 @@ static void setUp( try { Long output = api.echoInt((anIntArg == null) ? null : anIntArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2402,10 +2201,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2415,7 +2211,8 @@ static void setUp( try { Double output = api.echoDouble(aDoubleArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2428,10 +2225,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2441,7 +2235,8 @@ static void setUp( try { Boolean output = api.echoBool(aBoolArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2454,10 +2249,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2467,7 +2259,8 @@ static void setUp( try { String output = api.echoString(aStringArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2480,10 +2273,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2493,7 +2283,8 @@ static void setUp( try { byte[] output = api.echoUint8List(aUint8ListArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2506,10 +2297,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2519,7 +2307,8 @@ static void setUp( try { Object output = api.echoObject(anObjectArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2532,10 +2321,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2545,7 +2331,8 @@ static void setUp( try { List output = api.echoList(listArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2558,10 +2345,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2571,7 +2355,8 @@ static void setUp( try { Map output = api.echoMap(aMapArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2584,10 +2369,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2597,7 +2379,8 @@ static void setUp( try { AllClassesWrapper output = api.echoClassWrapper(wrapperArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2610,10 +2393,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2623,7 +2403,8 @@ static void setUp( try { AnEnum output = api.echoEnum(anEnumArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2636,10 +2417,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2649,7 +2427,8 @@ static void setUp( try { String output = api.echoNamedDefaultString(aStringArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2662,10 +2441,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2675,7 +2451,8 @@ static void setUp( try { Double output = api.echoOptionalDefaultDouble(aDoubleArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2688,10 +2465,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2699,10 +2473,10 @@ static void setUp( ArrayList args = (ArrayList) message; Number anIntArg = (Number) args.get(0); try { - Long output = - api.echoRequiredInt((anIntArg == null) ? null : anIntArg.longValue()); + Long output = api.echoRequiredInt((anIntArg == null) ? null : anIntArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2715,10 +2489,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2728,7 +2499,8 @@ static void setUp( try { AllNullableTypes output = api.echoAllNullableTypes(everythingArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2741,22 +2513,18 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; - AllNullableTypesWithoutRecursion everythingArg = - (AllNullableTypesWithoutRecursion) args.get(0); + AllNullableTypesWithoutRecursion everythingArg = (AllNullableTypesWithoutRecursion) args.get(0); try { - AllNullableTypesWithoutRecursion output = - api.echoAllNullableTypesWithoutRecursion(everythingArg); + AllNullableTypesWithoutRecursion output = api.echoAllNullableTypesWithoutRecursion(everythingArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2769,10 +2537,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2782,7 +2547,8 @@ static void setUp( try { String output = api.extractNestedNullableString(wrapperArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2795,10 +2561,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2808,7 +2571,8 @@ static void setUp( try { AllClassesWrapper output = api.createNestedNullableString(nullableStringArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2821,10 +2585,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2834,13 +2595,10 @@ static void setUp( Number aNullableIntArg = (Number) args.get(1); String aNullableStringArg = (String) args.get(2); try { - AllNullableTypes output = - api.sendMultipleNullableTypes( - aNullableBoolArg, - (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), - aNullableStringArg); + AllNullableTypes output = api.sendMultipleNullableTypes(aNullableBoolArg, (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), aNullableStringArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2853,10 +2611,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2866,13 +2621,10 @@ static void setUp( Number aNullableIntArg = (Number) args.get(1); String aNullableStringArg = (String) args.get(2); try { - AllNullableTypesWithoutRecursion output = - api.sendMultipleNullableTypesWithoutRecursion( - aNullableBoolArg, - (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), - aNullableStringArg); + AllNullableTypesWithoutRecursion output = api.sendMultipleNullableTypesWithoutRecursion(aNullableBoolArg, (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), aNullableStringArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2885,10 +2637,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2896,11 +2645,10 @@ static void setUp( ArrayList args = (ArrayList) message; Number aNullableIntArg = (Number) args.get(0); try { - Long output = - api.echoNullableInt( - (aNullableIntArg == null) ? null : aNullableIntArg.longValue()); + Long output = api.echoNullableInt((aNullableIntArg == null) ? null : aNullableIntArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2913,10 +2661,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2926,7 +2671,8 @@ static void setUp( try { Double output = api.echoNullableDouble(aNullableDoubleArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2939,10 +2685,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2952,7 +2695,8 @@ static void setUp( try { Boolean output = api.echoNullableBool(aNullableBoolArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2965,10 +2709,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2978,7 +2719,8 @@ static void setUp( try { String output = api.echoNullableString(aNullableStringArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2991,10 +2733,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3004,7 +2743,8 @@ static void setUp( try { byte[] output = api.echoNullableUint8List(aNullableUint8ListArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3017,10 +2757,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3030,7 +2767,8 @@ static void setUp( try { Object output = api.echoNullableObject(aNullableObjectArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3043,10 +2781,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3056,7 +2791,8 @@ static void setUp( try { List output = api.echoNullableList(aNullableListArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3069,10 +2805,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3082,7 +2815,8 @@ static void setUp( try { Map output = api.echoNullableMap(aNullableMapArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3095,10 +2829,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3108,7 +2839,8 @@ static void setUp( try { AnEnum output = api.echoNullableEnum(anEnumArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3121,10 +2853,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3132,11 +2861,10 @@ static void setUp( ArrayList args = (ArrayList) message; Number aNullableIntArg = (Number) args.get(0); try { - Long output = - api.echoOptionalNullableInt( - (aNullableIntArg == null) ? null : aNullableIntArg.longValue()); + Long output = api.echoOptionalNullableInt((aNullableIntArg == null) ? null : aNullableIntArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3149,10 +2877,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3162,7 +2887,8 @@ static void setUp( try { String output = api.echoNamedNullableString(aNullableStringArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3175,10 +2901,7 @@ static void setUp( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3205,10 +2928,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3237,10 +2957,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3269,10 +2986,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3301,10 +3015,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3333,10 +3044,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3365,10 +3073,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3397,10 +3102,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3429,10 +3131,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3461,10 +3160,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3493,10 +3189,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3523,10 +3216,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3553,10 +3243,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3583,10 +3270,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3615,10 +3299,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3647,17 +3328,13 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; - AllNullableTypesWithoutRecursion everythingArg = - (AllNullableTypesWithoutRecursion) args.get(0); + AllNullableTypesWithoutRecursion everythingArg = (AllNullableTypesWithoutRecursion) args.get(0); NullableResult resultCallback = new NullableResult() { public void success(AllNullableTypesWithoutRecursion result) { @@ -3671,8 +3348,7 @@ public void error(Throwable error) { } }; - api.echoAsyncNullableAllNullableTypesWithoutRecursion( - everythingArg, resultCallback); + api.echoAsyncNullableAllNullableTypesWithoutRecursion(everythingArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -3681,10 +3357,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3704,8 +3377,7 @@ public void error(Throwable error) { } }; - api.echoAsyncNullableInt( - (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.echoAsyncNullableInt((anIntArg == null) ? null : anIntArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -3714,10 +3386,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3746,10 +3415,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3778,10 +3444,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3810,10 +3473,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3842,10 +3502,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3874,10 +3531,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3906,10 +3560,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3938,10 +3589,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3970,10 +3618,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4000,10 +3645,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4030,10 +3672,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4060,10 +3699,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4092,10 +3728,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4124,10 +3757,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4149,11 +3779,7 @@ public void error(Throwable error) { } }; - api.callFlutterSendMultipleNullableTypes( - aNullableBoolArg, - (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), - aNullableStringArg, - resultCallback); + api.callFlutterSendMultipleNullableTypes(aNullableBoolArg, (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), aNullableStringArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4162,17 +3788,13 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; - AllNullableTypesWithoutRecursion everythingArg = - (AllNullableTypesWithoutRecursion) args.get(0); + AllNullableTypesWithoutRecursion everythingArg = (AllNullableTypesWithoutRecursion) args.get(0); NullableResult resultCallback = new NullableResult() { public void success(AllNullableTypesWithoutRecursion result) { @@ -4195,10 +3817,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4220,11 +3839,7 @@ public void error(Throwable error) { } }; - api.callFlutterSendMultipleNullableTypesWithoutRecursion( - aNullableBoolArg, - (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), - aNullableStringArg, - resultCallback); + api.callFlutterSendMultipleNullableTypesWithoutRecursion(aNullableBoolArg, (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), aNullableStringArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4233,10 +3848,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4265,10 +3877,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4288,8 +3897,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoInt( - (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.callFlutterEchoInt((anIntArg == null) ? null : anIntArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -4298,10 +3906,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4330,10 +3935,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4362,10 +3964,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4394,10 +3993,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4426,10 +4022,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4458,10 +4051,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4490,10 +4080,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4522,10 +4109,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4545,8 +4129,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoNullableInt( - (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.callFlutterEchoNullableInt((anIntArg == null) ? null : anIntArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -4555,10 +4138,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4587,10 +4167,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4619,10 +4196,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4651,10 +4225,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4683,10 +4254,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4715,10 +4283,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4747,10 +4312,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4779,10 +4341,10 @@ public void error(Throwable error) { } } /** - * The core interface that the Dart platform_test code implements for host integration tests to - * call into. + * The core interface that the Dart platform_test code implements for host + * integration tests to call into. * - *

Generated class from Pigeon that represents Flutter messages that can be called from Java. + * Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class FlutterIntegrationCoreApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -4791,857 +4353,651 @@ public static class FlutterIntegrationCoreApi { public FlutterIntegrationCoreApi(@NonNull BinaryMessenger argBinaryMessenger) { this(argBinaryMessenger, ""); } - - public FlutterIntegrationCoreApi( - @NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { + public FlutterIntegrationCoreApi(@NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { this.binaryMessenger = argBinaryMessenger; this.messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ /** The codec used by FlutterIntegrationCoreApi. */ static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } /** - * A no-op function taking no arguments and returning no value, to sanity test basic calling. + * A no-op function taking no arguments and returning no value, to sanity + * test basic calling. */ public void noop(@NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( null, channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Responds with an error from an async function returning a value. */ public void throwError(@NonNull NullableResult result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( null, channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") Object output = listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Responds with an error from an async void function. */ public void throwErrorFromVoid(@NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( null, channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed object, to test serialization and deserialization. */ public void echoAllTypes(@NonNull AllTypes everythingArg, @NonNull Result result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(everythingArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); + result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); } else { @SuppressWarnings("ConstantConditions") AllTypes output = (AllTypes) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed object, to test serialization and deserialization. */ - public void echoAllNullableTypes( - @Nullable AllNullableTypes everythingArg, - @NonNull NullableResult result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes" - + messageChannelSuffix; + public void echoAllNullableTypes(@Nullable AllNullableTypes everythingArg, @NonNull NullableResult result) { + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(everythingArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") AllNullableTypes output = (AllNullableTypes) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** * Returns passed in arguments of multiple types. * - *

Tests multiple-arity FlutterApi handling. + * Tests multiple-arity FlutterApi handling. */ - public void sendMultipleNullableTypes( - @Nullable Boolean aNullableBoolArg, - @Nullable Long aNullableIntArg, - @Nullable String aNullableStringArg, - @NonNull Result result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes" - + messageChannelSuffix; + public void sendMultipleNullableTypes(@Nullable Boolean aNullableBoolArg, @Nullable Long aNullableIntArg, @Nullable String aNullableStringArg, @NonNull Result result) { + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList( - Arrays.asList(aNullableBoolArg, aNullableIntArg, aNullableStringArg)), + new ArrayList(Arrays.asList(aNullableBoolArg, aNullableIntArg, aNullableStringArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); + result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); } else { @SuppressWarnings("ConstantConditions") AllNullableTypes output = (AllNullableTypes) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed object, to test serialization and deserialization. */ - public void echoAllNullableTypesWithoutRecursion( - @Nullable AllNullableTypesWithoutRecursion everythingArg, - @NonNull NullableResult result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" - + messageChannelSuffix; + public void echoAllNullableTypesWithoutRecursion(@Nullable AllNullableTypesWithoutRecursion everythingArg, @NonNull NullableResult result) { + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(everythingArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") - AllNullableTypesWithoutRecursion output = - (AllNullableTypesWithoutRecursion) listReply.get(0); + AllNullableTypesWithoutRecursion output = (AllNullableTypesWithoutRecursion) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** * Returns passed in arguments of multiple types. * - *

Tests multiple-arity FlutterApi handling. + * Tests multiple-arity FlutterApi handling. */ - public void sendMultipleNullableTypesWithoutRecursion( - @Nullable Boolean aNullableBoolArg, - @Nullable Long aNullableIntArg, - @Nullable String aNullableStringArg, - @NonNull Result result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" - + messageChannelSuffix; + public void sendMultipleNullableTypesWithoutRecursion(@Nullable Boolean aNullableBoolArg, @Nullable Long aNullableIntArg, @Nullable String aNullableStringArg, @NonNull Result result) { + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList( - Arrays.asList(aNullableBoolArg, aNullableIntArg, aNullableStringArg)), + new ArrayList(Arrays.asList(aNullableBoolArg, aNullableIntArg, aNullableStringArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); + result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); } else { @SuppressWarnings("ConstantConditions") - AllNullableTypesWithoutRecursion output = - (AllNullableTypesWithoutRecursion) listReply.get(0); + AllNullableTypesWithoutRecursion output = (AllNullableTypesWithoutRecursion) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed boolean, to test serialization and deserialization. */ public void echoBool(@NonNull Boolean aBoolArg, @NonNull Result result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aBoolArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); + result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); } else { @SuppressWarnings("ConstantConditions") Boolean output = (Boolean) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed int, to test serialization and deserialization. */ public void echoInt(@NonNull Long anIntArg, @NonNull Result result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(anIntArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); + result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); } else { @SuppressWarnings("ConstantConditions") - Long output = - listReply.get(0) == null ? null : ((Number) listReply.get(0)).longValue(); + Long output = listReply.get(0) == null ? null : ((Number) listReply.get(0)).longValue(); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed double, to test serialization and deserialization. */ public void echoDouble(@NonNull Double aDoubleArg, @NonNull Result result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aDoubleArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); + result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); } else { @SuppressWarnings("ConstantConditions") Double output = (Double) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed string, to test serialization and deserialization. */ public void echoString(@NonNull String aStringArg, @NonNull Result result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aStringArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); + result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); } else { @SuppressWarnings("ConstantConditions") String output = (String) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed byte list, to test serialization and deserialization. */ public void echoUint8List(@NonNull byte[] listArg, @NonNull Result result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(listArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); + result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); } else { @SuppressWarnings("ConstantConditions") byte[] output = (byte[]) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed list, to test serialization and deserialization. */ public void echoList(@NonNull List listArg, @NonNull Result> result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(listArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); + result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); } else { @SuppressWarnings("ConstantConditions") List output = (List) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed map, to test serialization and deserialization. */ - public void echoMap( - @NonNull Map aMapArg, @NonNull Result> result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap" - + messageChannelSuffix; + public void echoMap(@NonNull Map aMapArg, @NonNull Result> result) { + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aMapArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); + result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); } else { @SuppressWarnings("ConstantConditions") Map output = (Map) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed enum to test serialization and deserialization. */ public void echoEnum(@NonNull AnEnum anEnumArg, @NonNull Result result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(anEnumArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); + result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); } else { @SuppressWarnings("ConstantConditions") AnEnum output = (AnEnum) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed boolean, to test serialization and deserialization. */ - public void echoNullableBool( - @Nullable Boolean aBoolArg, @NonNull NullableResult result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool" - + messageChannelSuffix; + public void echoNullableBool(@Nullable Boolean aBoolArg, @NonNull NullableResult result) { + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aBoolArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") Boolean output = (Boolean) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed int, to test serialization and deserialization. */ public void echoNullableInt(@Nullable Long anIntArg, @NonNull NullableResult result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(anIntArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") - Long output = - listReply.get(0) == null ? null : ((Number) listReply.get(0)).longValue(); + Long output = listReply.get(0) == null ? null : ((Number) listReply.get(0)).longValue(); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed double, to test serialization and deserialization. */ - public void echoNullableDouble( - @Nullable Double aDoubleArg, @NonNull NullableResult result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble" - + messageChannelSuffix; + public void echoNullableDouble(@Nullable Double aDoubleArg, @NonNull NullableResult result) { + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aDoubleArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") Double output = (Double) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed string, to test serialization and deserialization. */ - public void echoNullableString( - @Nullable String aStringArg, @NonNull NullableResult result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString" - + messageChannelSuffix; + public void echoNullableString(@Nullable String aStringArg, @NonNull NullableResult result) { + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aStringArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") String output = (String) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed byte list, to test serialization and deserialization. */ - public void echoNullableUint8List( - @Nullable byte[] listArg, @NonNull NullableResult result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List" - + messageChannelSuffix; + public void echoNullableUint8List(@Nullable byte[] listArg, @NonNull NullableResult result) { + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(listArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") byte[] output = (byte[]) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed list, to test serialization and deserialization. */ - public void echoNullableList( - @Nullable List listArg, @NonNull NullableResult> result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList" - + messageChannelSuffix; + public void echoNullableList(@Nullable List listArg, @NonNull NullableResult> result) { + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(listArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") List output = (List) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed map, to test serialization and deserialization. */ - public void echoNullableMap( - @Nullable Map aMapArg, - @NonNull NullableResult> result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap" - + messageChannelSuffix; + public void echoNullableMap(@Nullable Map aMapArg, @NonNull NullableResult> result) { + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aMapArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") Map output = (Map) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed enum to test serialization and deserialization. */ - public void echoNullableEnum( - @Nullable AnEnum anEnumArg, @NonNull NullableResult result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum" - + messageChannelSuffix; + public void echoNullableEnum(@Nullable AnEnum anEnumArg, @NonNull NullableResult result) { + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(anEnumArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") AnEnum output = (AnEnum) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** - * A no-op function taking no arguments and returning no value, to sanity test basic - * asynchronous calling. + * A no-op function taking no arguments and returning no value, to sanity + * test basic asynchronous calling. */ public void noopAsync(@NonNull VoidResult result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( null, channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed in generic Object asynchronously. */ public void echoAsyncString(@NonNull String aStringArg, @NonNull Result result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aStringArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); + result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); } else { @SuppressWarnings("ConstantConditions") String output = (String) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } } /** * An API that can be implemented for minimal, compile-only tests. * - *

Generated interface from Pigeon that represents a handler of messages from Flutter. + * Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface HostTrivialApi { @@ -5651,23 +5007,16 @@ public interface HostTrivialApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - /** Sets up an instance of `HostTrivialApi` to handle messages through the `binaryMessenger`. */ + /**Sets up an instance of `HostTrivialApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable HostTrivialApi api) { setUp(binaryMessenger, "", api); } - - static void setUp( - @NonNull BinaryMessenger binaryMessenger, - @NonNull String messageChannelSuffix, - @Nullable HostTrivialApi api) { + static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String messageChannelSuffix, @Nullable HostTrivialApi api) { messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -5675,7 +5024,8 @@ static void setUp( try { api.noop(); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -5690,7 +5040,7 @@ static void setUp( /** * A simple API implemented in some unit tests. * - *

Generated interface from Pigeon that represents a handler of messages from Flutter. + * Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface HostSmallApi { @@ -5702,23 +5052,16 @@ public interface HostSmallApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - /** Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. */ + /**Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable HostSmallApi api) { setUp(binaryMessenger, "", api); } - - static void setUp( - @NonNull BinaryMessenger binaryMessenger, - @NonNull String messageChannelSuffix, - @Nullable HostSmallApi api) { + static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String messageChannelSuffix, @Nullable HostSmallApi api) { messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -5747,10 +5090,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid" - + messageChannelSuffix, - getCodec()); + binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid" + messageChannelSuffix, getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -5779,7 +5119,7 @@ public void error(Throwable error) { /** * A simple API called in some unit tests. * - *

Generated class from Pigeon that represents Flutter messages that can be called from Java. + * Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class FlutterSmallApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -5788,84 +5128,62 @@ public static class FlutterSmallApi { public FlutterSmallApi(@NonNull BinaryMessenger argBinaryMessenger) { this(argBinaryMessenger, ""); } - - public FlutterSmallApi( - @NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { + public FlutterSmallApi(@NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { this.binaryMessenger = argBinaryMessenger; this.messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ /** The codec used by FlutterSmallApi. */ static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - public void echoWrappedList(@NonNull TestMessage msgArg, @NonNull Result result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(msgArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); + result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); } else { @SuppressWarnings("ConstantConditions") TestMessage output = (TestMessage) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } - public void echoString(@NonNull String aStringArg, @NonNull Result result) { - final String channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString" - + messageChannelSuffix; + final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString" + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>( + binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aStringArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error( - new FlutterError( - (String) listReply.get(0), - (String) listReply.get(1), - (String) listReply.get(2))); + result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error( - new FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - "")); + result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); } else { @SuppressWarnings("ConstantConditions") String output = (String) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } } diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h index 2bf7bbf26bee..ba7cb9bc5faa 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h @@ -38,90 +38,88 @@ typedef NS_ENUM(NSUInteger, FLTAnEnum) { @interface FLTAllTypes : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithABool:(BOOL)aBool - anInt:(NSInteger)anInt - anInt64:(NSInteger)anInt64 - aDouble:(double)aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - anEnum:(FLTAnEnum)anEnum - aString:(NSString *)aString - anObject:(id)anObject - list:(NSArray *)list - stringList:(NSArray *)stringList - intList:(NSArray *)intList - doubleList:(NSArray *)doubleList - boolList:(NSArray *)boolList - map:(NSDictionary *)map; -@property(nonatomic, assign) BOOL aBool; -@property(nonatomic, assign) NSInteger anInt; -@property(nonatomic, assign) NSInteger anInt64; -@property(nonatomic, assign) double aDouble; -@property(nonatomic, strong) FlutterStandardTypedData *aByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *a4ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *a8ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *aFloatArray; ++ (instancetype)makeWithABool:(BOOL )aBool + anInt:(NSInteger )anInt + anInt64:(NSInteger )anInt64 + aDouble:(double )aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + anEnum:(FLTAnEnum)anEnum + aString:(NSString *)aString + anObject:(id )anObject + list:(NSArray *)list + stringList:(NSArray *)stringList + intList:(NSArray *)intList + doubleList:(NSArray *)doubleList + boolList:(NSArray *)boolList + map:(NSDictionary *)map; +@property(nonatomic, assign) BOOL aBool; +@property(nonatomic, assign) NSInteger anInt; +@property(nonatomic, assign) NSInteger anInt64; +@property(nonatomic, assign) double aDouble; +@property(nonatomic, strong) FlutterStandardTypedData * aByteArray; +@property(nonatomic, strong) FlutterStandardTypedData * a4ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData * a8ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData * aFloatArray; @property(nonatomic, assign) FLTAnEnum anEnum; -@property(nonatomic, copy) NSString *aString; -@property(nonatomic, strong) id anObject; -@property(nonatomic, copy) NSArray *list; -@property(nonatomic, copy) NSArray *stringList; -@property(nonatomic, copy) NSArray *intList; -@property(nonatomic, copy) NSArray *doubleList; -@property(nonatomic, copy) NSArray *boolList; -@property(nonatomic, copy) NSDictionary *map; +@property(nonatomic, copy) NSString * aString; +@property(nonatomic, strong) id anObject; +@property(nonatomic, copy) NSArray * list; +@property(nonatomic, copy) NSArray * stringList; +@property(nonatomic, copy) NSArray * intList; +@property(nonatomic, copy) NSArray * doubleList; +@property(nonatomic, copy) NSArray * boolList; +@property(nonatomic, copy) NSDictionary * map; @end /// A class containing all supported nullable types. @interface FLTAllNullableTypes : NSObject + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - allNullableTypes:(nullable FLTAllNullableTypes *)allNullableTypes - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - nestedClassList:(nullable NSArray *)nestedClassList - map:(nullable NSDictionary *)map; -@property(nonatomic, strong, nullable) NSNumber *aNullableBool; -@property(nonatomic, strong, nullable) NSNumber *aNullableInt; -@property(nonatomic, strong, nullable) NSNumber *aNullableInt64; -@property(nonatomic, strong, nullable) NSNumber *aNullableDouble; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; -@property(nonatomic, copy, nullable) - NSDictionary *nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; -@property(nonatomic, strong, nullable) FLTAnEnumBox *aNullableEnum; -@property(nonatomic, copy, nullable) NSString *aNullableString; -@property(nonatomic, strong, nullable) id aNullableObject; -@property(nonatomic, strong, nullable) FLTAllNullableTypes *allNullableTypes; -@property(nonatomic, copy, nullable) NSArray *list; -@property(nonatomic, copy, nullable) NSArray *stringList; -@property(nonatomic, copy, nullable) NSArray *intList; -@property(nonatomic, copy, nullable) NSArray *doubleList; -@property(nonatomic, copy, nullable) NSArray *boolList; -@property(nonatomic, copy, nullable) NSArray *nestedClassList; -@property(nonatomic, copy, nullable) NSDictionary *map; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id )aNullableObject + allNullableTypes:(nullable FLTAllNullableTypes *)allNullableTypes + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + nestedClassList:(nullable NSArray *)nestedClassList + map:(nullable NSDictionary *)map; +@property(nonatomic, strong, nullable) NSNumber * aNullableBool; +@property(nonatomic, strong, nullable) NSNumber * aNullableInt; +@property(nonatomic, strong, nullable) NSNumber * aNullableInt64; +@property(nonatomic, strong, nullable) NSNumber * aNullableDouble; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable4ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable8ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableFloatArray; +@property(nonatomic, copy, nullable) NSArray *> * nullableNestedList; +@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithAnnotations; +@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithObject; +@property(nonatomic, strong, nullable) FLTAnEnumBox * aNullableEnum; +@property(nonatomic, copy, nullable) NSString * aNullableString; +@property(nonatomic, strong, nullable) id aNullableObject; +@property(nonatomic, strong, nullable) FLTAllNullableTypes * allNullableTypes; +@property(nonatomic, copy, nullable) NSArray * list; +@property(nonatomic, copy, nullable) NSArray * stringList; +@property(nonatomic, copy, nullable) NSArray * intList; +@property(nonatomic, copy, nullable) NSArray * doubleList; +@property(nonatomic, copy, nullable) NSArray * boolList; +@property(nonatomic, copy, nullable) NSArray * nestedClassList; +@property(nonatomic, copy, nullable) NSDictionary * map; @end /// The primary purpose for this class is to ensure coverage of Swift structs @@ -129,47 +127,45 @@ typedef NS_ENUM(NSUInteger, FLTAnEnum) { /// test Swift classes. @interface FLTAllNullableTypesWithoutRecursion : NSObject + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - map:(nullable NSDictionary *)map; -@property(nonatomic, strong, nullable) NSNumber *aNullableBool; -@property(nonatomic, strong, nullable) NSNumber *aNullableInt; -@property(nonatomic, strong, nullable) NSNumber *aNullableInt64; -@property(nonatomic, strong, nullable) NSNumber *aNullableDouble; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; -@property(nonatomic, copy, nullable) - NSDictionary *nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; -@property(nonatomic, strong, nullable) FLTAnEnumBox *aNullableEnum; -@property(nonatomic, copy, nullable) NSString *aNullableString; -@property(nonatomic, strong, nullable) id aNullableObject; -@property(nonatomic, copy, nullable) NSArray *list; -@property(nonatomic, copy, nullable) NSArray *stringList; -@property(nonatomic, copy, nullable) NSArray *intList; -@property(nonatomic, copy, nullable) NSArray *doubleList; -@property(nonatomic, copy, nullable) NSArray *boolList; -@property(nonatomic, copy, nullable) NSDictionary *map; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id )aNullableObject + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + map:(nullable NSDictionary *)map; +@property(nonatomic, strong, nullable) NSNumber * aNullableBool; +@property(nonatomic, strong, nullable) NSNumber * aNullableInt; +@property(nonatomic, strong, nullable) NSNumber * aNullableInt64; +@property(nonatomic, strong, nullable) NSNumber * aNullableDouble; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable4ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable8ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableFloatArray; +@property(nonatomic, copy, nullable) NSArray *> * nullableNestedList; +@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithAnnotations; +@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithObject; +@property(nonatomic, strong, nullable) FLTAnEnumBox * aNullableEnum; +@property(nonatomic, copy, nullable) NSString * aNullableString; +@property(nonatomic, strong, nullable) id aNullableObject; +@property(nonatomic, copy, nullable) NSArray * list; +@property(nonatomic, copy, nullable) NSArray * stringList; +@property(nonatomic, copy, nullable) NSArray * intList; +@property(nonatomic, copy, nullable) NSArray * doubleList; +@property(nonatomic, copy, nullable) NSArray * boolList; +@property(nonatomic, copy, nullable) NSDictionary * map; @end /// A class for testing nested class handling. @@ -181,19 +177,17 @@ typedef NS_ENUM(NSUInteger, FLTAnEnum) { /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithAllNullableTypes:(FLTAllNullableTypes *)allNullableTypes - allNullableTypesWithoutRecursion: - (nullable FLTAllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion - allTypes:(nullable FLTAllTypes *)allTypes; -@property(nonatomic, strong) FLTAllNullableTypes *allNullableTypes; -@property(nonatomic, strong, nullable) - FLTAllNullableTypesWithoutRecursion *allNullableTypesWithoutRecursion; -@property(nonatomic, strong, nullable) FLTAllTypes *allTypes; + allNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion + allTypes:(nullable FLTAllTypes *)allTypes; +@property(nonatomic, strong) FLTAllNullableTypes * allNullableTypes; +@property(nonatomic, strong, nullable) FLTAllNullableTypesWithoutRecursion * allNullableTypesWithoutRecursion; +@property(nonatomic, strong, nullable) FLTAllTypes * allTypes; @end /// A data class containing a List, used in unit tests. @interface FLTTestMessage : NSObject + (instancetype)makeWithTestList:(nullable NSArray *)testList; -@property(nonatomic, copy, nullable) NSArray *testList; +@property(nonatomic, copy, nullable) NSArray * testList; @end /// The codec used by all APIs. @@ -208,8 +202,7 @@ NSObject *FLTGetCoreTestsCodec(void); /// Returns the passed object, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable FLTAllTypes *)echoAllTypes:(FLTAllTypes *)everything - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FLTAllTypes *)echoAllTypes:(FLTAllTypes *)everything error:(FlutterError *_Nullable *_Nonnull)error; /// Returns an error, to test error handling. - (nullable id)throwErrorWithError:(FlutterError *_Nullable *_Nonnull)error; /// Returns an error from a void function, to test error handling. @@ -231,13 +224,11 @@ NSObject *FLTGetCoreTestsCodec(void); /// Returns the passed in string. /// /// @return `nil` only when `error != nil`. -- (nullable NSString *)echoString:(NSString *)aString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoString:(NSString *)aString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in Uint8List. /// /// @return `nil` only when `error != nil`. -- (nullable FlutterStandardTypedData *)echoUint8List:(FlutterStandardTypedData *)aUint8List - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FlutterStandardTypedData *)echoUint8List:(FlutterStandardTypedData *)aUint8List error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in generic Object. /// /// @return `nil` only when `error != nil`. @@ -245,279 +236,160 @@ NSObject *FLTGetCoreTestsCodec(void); /// Returns the passed list, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable NSArray *)echoList:(NSArray *)list - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSArray *)echoList:(NSArray *)list error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed map, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed map to test nested class serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable FLTAllClassesWrapper *)echoClassWrapper:(FLTAllClassesWrapper *)wrapper - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FLTAllClassesWrapper *)echoClassWrapper:(FLTAllClassesWrapper *)wrapper error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed enum to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (FLTAnEnumBox *_Nullable)echoEnum:(FLTAnEnum)anEnum - error:(FlutterError *_Nullable *_Nonnull)error; +- (FLTAnEnumBox *_Nullable)echoEnum:(FLTAnEnum)anEnum error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the default string. /// /// @return `nil` only when `error != nil`. -- (nullable NSString *)echoNamedDefaultString:(NSString *)aString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNamedDefaultString:(NSString *)aString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in double. /// /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoOptionalDefaultDouble:(double)aDouble - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoOptionalDefaultDouble:(double)aDouble error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. /// /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoRequiredInt:(NSInteger)anInt - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoRequiredInt:(NSInteger)anInt error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed object, to test serialization and deserialization. -- (nullable FLTAllNullableTypes *)echoAllNullableTypes:(nullable FLTAllNullableTypes *)everything - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FLTAllNullableTypes *)echoAllNullableTypes:(nullable FLTAllNullableTypes *)everything error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed object, to test serialization and deserialization. -- (nullable FLTAllNullableTypesWithoutRecursion *) - echoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FLTAllNullableTypesWithoutRecursion *)echoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. -- (nullable NSString *)extractNestedNullableStringFrom:(FLTAllClassesWrapper *)wrapper - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)extractNestedNullableStringFrom:(FLTAllClassesWrapper *)wrapper error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. /// /// @return `nil` only when `error != nil`. -- (nullable FLTAllClassesWrapper *) - createNestedObjectWithNullableString:(nullable NSString *)nullableString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FLTAllClassesWrapper *)createNestedObjectWithNullableString:(nullable NSString *)nullableString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in arguments of multiple types. /// /// @return `nil` only when `error != nil`. -- (nullable FLTAllNullableTypes *) - sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FLTAllNullableTypes *)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in arguments of multiple types. /// /// @return `nil` only when `error != nil`. -- (nullable FLTAllNullableTypesWithoutRecursion *) - sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FLTAllNullableTypesWithoutRecursion *)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. -- (nullable NSNumber *)echoNullableInt:(nullable NSNumber *)aNullableInt - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableInt:(nullable NSNumber *)aNullableInt error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in double. -- (nullable NSNumber *)echoNullableDouble:(nullable NSNumber *)aNullableDouble - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableDouble:(nullable NSNumber *)aNullableDouble error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in boolean. -- (nullable NSNumber *)echoNullableBool:(nullable NSNumber *)aNullableBool - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableBool:(nullable NSNumber *)aNullableBool error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in string. -- (nullable NSString *)echoNullableString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNullableString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in Uint8List. -- (nullable FlutterStandardTypedData *) - echoNullableUint8List:(nullable FlutterStandardTypedData *)aNullableUint8List - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FlutterStandardTypedData *)echoNullableUint8List:(nullable FlutterStandardTypedData *)aNullableUint8List error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in generic Object. -- (nullable id)echoNullableObject:(nullable id)aNullableObject - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable id)echoNullableObject:(nullable id)aNullableObject error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed list, to test serialization and deserialization. -- (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *)echoNullableMap: - (nullable NSDictionary *)aNullableMap - error:(FlutterError *_Nullable *_Nonnull)error; -- (FLTAnEnumBox *_Nullable)echoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)aNullableMap error:(FlutterError *_Nullable *_Nonnull)error; +- (FLTAnEnumBox *_Nullable)echoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. -- (nullable NSNumber *)echoOptionalNullableInt:(nullable NSNumber *)aNullableInt - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoOptionalNullableInt:(nullable NSNumber *)aNullableInt error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in string. -- (nullable NSString *)echoNamedNullableString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNamedNullableString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Returns passed in int asynchronously. -- (void)echoAsyncInt:(NSInteger)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in double asynchronously. -- (void)echoAsyncDouble:(double)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in boolean asynchronously. -- (void)echoAsyncBool:(BOOL)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string asynchronously. -- (void)echoAsyncString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in Uint8List asynchronously. -- (void)echoAsyncUint8List:(FlutterStandardTypedData *)aUint8List - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncUint8List:(FlutterStandardTypedData *)aUint8List completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in generic Object asynchronously. -- (void)echoAsyncObject:(id)anObject - completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncObject:(id)anObject completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncList:(NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAsyncEnum:(FLTAnEnum)anEnum - completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncEnum:(FLTAnEnum)anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// Responds with an error from an async function returning a value. - (void)throwAsyncErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Responds with an error from an async void function. - (void)throwAsyncErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Responds with a Flutter error from an async function returning a value. -- (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, - FlutterError *_Nullable))completion; +- (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test async serialization and deserialization. -- (void)echoAsyncAllTypes:(FLTAllTypes *)everything - completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncAllTypes:(FLTAllTypes *)everything completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAsyncNullableAllNullableTypes:(nullable FLTAllNullableTypes *)everything - completion:(void (^)(FLTAllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncNullableAllNullableTypes:(nullable FLTAllNullableTypes *)everything completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAsyncNullableAllNullableTypesWithoutRecursion: - (nullable FLTAllNullableTypesWithoutRecursion *)everything - completion: - (void (^)(FLTAllNullableTypesWithoutRecursion - *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncNullableAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in int asynchronously. -- (void)echoAsyncNullableInt:(nullable NSNumber *)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in double asynchronously. -- (void)echoAsyncNullableDouble:(nullable NSNumber *)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableDouble:(nullable NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in boolean asynchronously. -- (void)echoAsyncNullableBool:(nullable NSNumber *)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string asynchronously. -- (void)echoAsyncNullableString:(nullable NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in Uint8List asynchronously. -- (void)echoAsyncNullableUint8List:(nullable FlutterStandardTypedData *)aUint8List - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncNullableUint8List:(nullable FlutterStandardTypedData *)aUint8List completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in generic Object asynchronously. -- (void)echoAsyncNullableObject:(nullable id)anObject - completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableObject:(nullable id)anObject completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableList:(nullable NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed - completion: - (void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; - (void)callFlutterNoopWithCompletion:(void (^)(FlutterError *_Nullable))completion; -- (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, - FlutterError *_Nullable))completion; +- (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; - (void)callFlutterThrowErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllTypes:(FLTAllTypes *)everything - completion: - (void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllNullableTypes:(nullable FLTAllNullableTypes *)everything - completion:(void (^)(FLTAllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion:(void (^)(FLTAllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllNullableTypesWithoutRecursion: - (nullable FLTAllNullableTypesWithoutRecursion *)everything - completion: - (void (^)( - FLTAllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion; -- (void) - callFlutterSendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion: - (void (^)(FLTAllNullableTypesWithoutRecursion - *_Nullable, - FlutterError *_Nullable)) - completion; -- (void)callFlutterEchoBool:(BOOL)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoInt:(NSInteger)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoDouble:(double)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)list - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoList:(NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoEnum:(FLTAnEnum)anEnum - completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableInt:(nullable NSNumber *)anInt - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableDouble:(nullable NSNumber *)aDouble - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableString:(nullable NSString *)aString - completion: - (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableUint8List:(nullable FlutterStandardTypedData *)list - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableList:(nullable NSArray *)list - completion: - (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed - completion: - (void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterSmallApiEchoString:(NSString *)aString - completion: - (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllTypes:(FLTAllTypes *)everything completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllNullableTypes:(nullable FLTAllNullableTypes *)everything completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterSendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoEnum:(FLTAnEnum)anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableDouble:(nullable NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableUint8List:(nullable FlutterStandardTypedData *)list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterSmallApiEchoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end -extern void SetUpFLTHostIntegrationCoreApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpFLTHostIntegrationCoreApi(id binaryMessenger, NSObject *_Nullable api); + +extern void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryMessenger, NSObject *_Nullable api, NSString *messageChannelSuffix); -extern void SetUpFLTHostIntegrationCoreApiWithSuffix( - id binaryMessenger, NSObject *_Nullable api, - NSString *messageChannelSuffix); /// The core interface that the Dart platform_test code implements for host /// integration tests to call into. @interface FLTFlutterIntegrationCoreApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger messageChannelSuffix:(nullable NSString *)messageChannelSuffix; /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. - (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion; @@ -526,130 +398,86 @@ extern void SetUpFLTHostIntegrationCoreApiWithSuffix( /// Responds with an error from an async void function. - (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAllTypes:(FLTAllTypes *)everything - completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAllTypes:(FLTAllTypes *)everything completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAllNullableTypes:(nullable FLTAllNullableTypes *)everything - completion: - (void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAllNullableTypes:(nullable FLTAllNullableTypes *)everything completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion:(void (^)(FLTAllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void) - echoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything - completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. -- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion: - (void (^)( - FLTAllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion; +- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed boolean, to test serialization and deserialization. -- (void)echoBool:(BOOL)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed int, to test serialization and deserialization. -- (void)echoInt:(NSInteger)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed double, to test serialization and deserialization. -- (void)echoDouble:(double)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string, to test serialization and deserialization. -- (void)echoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed byte list, to test serialization and deserialization. -- (void)echoUint8List:(FlutterStandardTypedData *)list - completion: - (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)echoUint8List:(FlutterStandardTypedData *)list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test serialization and deserialization. -- (void)echoList:(NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization. -- (void)echoMap:(NSDictionary *)aMap - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)echoMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. -- (void)echoEnum:(FLTAnEnum)anEnum - completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoEnum:(FLTAnEnum)anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed boolean, to test serialization and deserialization. -- (void)echoNullableBool:(nullable NSNumber *)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed int, to test serialization and deserialization. -- (void)echoNullableInt:(nullable NSNumber *)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed double, to test serialization and deserialization. -- (void)echoNullableDouble:(nullable NSNumber *)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableDouble:(nullable NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string, to test serialization and deserialization. -- (void)echoNullableString:(nullable NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed byte list, to test serialization and deserialization. -- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)list - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test serialization and deserialization. -- (void)echoNullableList:(nullable NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. -- (void)echoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed - completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Returns the passed in generic Object asynchronously. -- (void)echoAsyncString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end + /// An API that can be implemented for minimal, compile-only tests. @protocol FLTHostTrivialApi - (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error; @end -extern void SetUpFLTHostTrivialApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpFLTHostTrivialApi(id binaryMessenger, NSObject *_Nullable api); + +extern void SetUpFLTHostTrivialApiWithSuffix(id binaryMessenger, NSObject *_Nullable api, NSString *messageChannelSuffix); -extern void SetUpFLTHostTrivialApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); /// A simple API implemented in some unit tests. @protocol FLTHostSmallApi -- (void)echoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; - (void)voidVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; @end -extern void SetUpFLTHostSmallApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpFLTHostSmallApi(id binaryMessenger, NSObject *_Nullable api); + +extern void SetUpFLTHostSmallApiWithSuffix(id binaryMessenger, NSObject *_Nullable api, NSString *messageChannelSuffix); -extern void SetUpFLTHostSmallApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); /// A simple API called in some unit tests. @interface FLTFlutterSmallApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -- (void)echoWrappedList:(FLTTestMessage *)msg - completion:(void (^)(FLTTestMessage *_Nullable, FlutterError *_Nullable))completion; -- (void)echoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger messageChannelSuffix:(nullable NSString *)messageChannelSuffix; +- (void)echoWrappedList:(FLTTestMessage *)msg completion:(void (^)(FLTTestMessage *_Nullable, FlutterError *_Nullable))completion; +- (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end NS_ASSUME_NONNULL_END diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m index 6dae6ff2abde..19797a062968 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m @@ -27,12 +27,7 @@ } static FlutterError *createConnectionError(NSString *channelName) { - return [FlutterError - errorWithCode:@"channel-error" - message:[NSString stringWithFormat:@"%@/%@/%@", - @"Unable to establish connection on channel: '", - channelName, @"'."] - details:@""]; + return [FlutterError errorWithCode:@"channel-error" message:[NSString stringWithFormat:@"%@/%@/%@", @"Unable to establish connection on channel: '", channelName, @"'."] details:@""]; } static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { @@ -81,24 +76,24 @@ + (nullable FLTTestMessage *)nullableFromList:(NSArray *)list; @end @implementation FLTAllTypes -+ (instancetype)makeWithABool:(BOOL)aBool - anInt:(NSInteger)anInt - anInt64:(NSInteger)anInt64 - aDouble:(double)aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - anEnum:(FLTAnEnum)anEnum - aString:(NSString *)aString - anObject:(id)anObject - list:(NSArray *)list - stringList:(NSArray *)stringList - intList:(NSArray *)intList - doubleList:(NSArray *)doubleList - boolList:(NSArray *)boolList - map:(NSDictionary *)map { - FLTAllTypes *pigeonResult = [[FLTAllTypes alloc] init]; ++ (instancetype)makeWithABool:(BOOL )aBool + anInt:(NSInteger )anInt + anInt64:(NSInteger )anInt64 + aDouble:(double )aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + anEnum:(FLTAnEnum)anEnum + aString:(NSString *)aString + anObject:(id )anObject + list:(NSArray *)list + stringList:(NSArray *)stringList + intList:(NSArray *)intList + doubleList:(NSArray *)doubleList + boolList:(NSArray *)boolList + map:(NSDictionary *)map { + FLTAllTypes* pigeonResult = [[FLTAllTypes alloc] init]; pigeonResult.aBool = aBool; pigeonResult.anInt = anInt; pigeonResult.anInt64 = anInt64; @@ -168,29 +163,28 @@ + (nullable FLTAllTypes *)nullableFromList:(NSArray *)list { @implementation FLTAllNullableTypes + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - allNullableTypes:(nullable FLTAllNullableTypes *)allNullableTypes - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - nestedClassList:(nullable NSArray *)nestedClassList - map:(nullable NSDictionary *)map { - FLTAllNullableTypes *pigeonResult = [[FLTAllNullableTypes alloc] init]; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id )aNullableObject + allNullableTypes:(nullable FLTAllNullableTypes *)allNullableTypes + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + nestedClassList:(nullable NSArray *)nestedClassList + map:(nullable NSDictionary *)map { + FLTAllNullableTypes* pigeonResult = [[FLTAllNullableTypes alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; pigeonResult.aNullableInt64 = aNullableInt64; @@ -274,28 +268,26 @@ + (nullable FLTAllNullableTypes *)nullableFromList:(NSArray *)list { @implementation FLTAllNullableTypesWithoutRecursion + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - map:(nullable NSDictionary *)map { - FLTAllNullableTypesWithoutRecursion *pigeonResult = - [[FLTAllNullableTypesWithoutRecursion alloc] init]; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id )aNullableObject + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + map:(nullable NSDictionary *)map { + FLTAllNullableTypesWithoutRecursion* pigeonResult = [[FLTAllNullableTypesWithoutRecursion alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; pigeonResult.aNullableInt64 = aNullableInt64; @@ -319,8 +311,7 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool return pigeonResult; } + (FLTAllNullableTypesWithoutRecursion *)fromList:(NSArray *)list { - FLTAllNullableTypesWithoutRecursion *pigeonResult = - [[FLTAllNullableTypesWithoutRecursion alloc] init]; + FLTAllNullableTypesWithoutRecursion *pigeonResult = [[FLTAllNullableTypesWithoutRecursion alloc] init]; pigeonResult.aNullableBool = GetNullableObjectAtIndex(list, 0); pigeonResult.aNullableInt = GetNullableObjectAtIndex(list, 1); pigeonResult.aNullableInt64 = GetNullableObjectAtIndex(list, 2); @@ -374,10 +365,9 @@ + (nullable FLTAllNullableTypesWithoutRecursion *)nullableFromList:(NSArray @implementation FLTAllClassesWrapper + (instancetype)makeWithAllNullableTypes:(FLTAllNullableTypes *)allNullableTypes - allNullableTypesWithoutRecursion: - (nullable FLTAllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion - allTypes:(nullable FLTAllTypes *)allTypes { - FLTAllClassesWrapper *pigeonResult = [[FLTAllClassesWrapper alloc] init]; + allNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion + allTypes:(nullable FLTAllTypes *)allTypes { + FLTAllClassesWrapper* pigeonResult = [[FLTAllClassesWrapper alloc] init]; pigeonResult.allNullableTypes = allNullableTypes; pigeonResult.allNullableTypesWithoutRecursion = allNullableTypesWithoutRecursion; pigeonResult.allTypes = allTypes; @@ -404,7 +394,7 @@ + (nullable FLTAllClassesWrapper *)nullableFromList:(NSArray *)list { @implementation FLTTestMessage + (instancetype)makeWithTestList:(nullable NSArray *)testList { - FLTTestMessage *pigeonResult = [[FLTTestMessage alloc] init]; + FLTTestMessage* pigeonResult = [[FLTTestMessage alloc] init]; pigeonResult.testList = testList; return pigeonResult; } @@ -428,21 +418,21 @@ @interface FLTCoreTestsPigeonCodecReader : FlutterStandardReader @implementation FLTCoreTestsPigeonCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 129: + case 129: return [FLTAllTypes fromList:[self readValue]]; - case 130: + case 130: return [FLTAllNullableTypes fromList:[self readValue]]; - case 131: + case 131: return [FLTAllNullableTypesWithoutRecursion fromList:[self readValue]]; - case 132: + case 132: return [FLTAllClassesWrapper fromList:[self readValue]]; - case 133: + case 133: return [FLTTestMessage fromList:[self readValue]]; - case 134: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil ? nil - : [[FLTAnEnumBox alloc] initWithValue:[enumAsNumber integerValue]]; - } + case 134: + { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil : [[FLTAnEnumBox alloc] initWithValue:[enumAsNumber integerValue]]; + } default: return [super readValueOfType:type]; } @@ -469,7 +459,7 @@ - (void)writeValue:(id)value { [self writeByte:133]; [self writeValue:[value toList]]; } else if ([value isKindOfClass:[FLTAnEnumBox class]]) { - FLTAnEnumBox *box = (FLTAnEnumBox *)value; + FLTAnEnumBox * box = (FLTAnEnumBox *)value; [self writeByte:134]; [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; } else { @@ -493,37 +483,27 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - FLTCoreTestsPigeonCodecReaderWriter *readerWriter = - [[FLTCoreTestsPigeonCodecReaderWriter alloc] init]; + FLTCoreTestsPigeonCodecReaderWriter *readerWriter = [[FLTCoreTestsPigeonCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } -void SetUpFLTHostIntegrationCoreApi(id binaryMessenger, - NSObject *api) { +void SetUpFLTHostIntegrationCoreApi(id binaryMessenger, NSObject *api) { SetUpFLTHostIntegrationCoreApiWithSuffix(binaryMessenger, api, @""); } -void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; +void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryMessenger, NSObject *api, NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat: @".%@", messageChannelSuffix] : @""; /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.noop", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(noopWithError:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(noopWithError:)", - api); + NSCAssert([api respondsToSelector:@selector(noopWithError:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(noopWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; [api noopWithError:&error]; @@ -535,18 +515,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAllTypes", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoAllTypes:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllTypes:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAllTypes:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllTypes:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); @@ -560,18 +535,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns an error, to test error handling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwError", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(throwErrorWithError:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(throwErrorWithError:)", - api); + NSCAssert([api respondsToSelector:@selector(throwErrorWithError:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(throwErrorWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; id output = [api throwErrorWithError:&error]; @@ -583,18 +553,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns an error from a void function, to test error handling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwErrorFromVoid", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwErrorFromVoidWithError:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwErrorFromVoidWithError:)", - api); + NSCAssert([api respondsToSelector:@selector(throwErrorFromVoidWithError:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(throwErrorFromVoidWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; [api throwErrorFromVoidWithError:&error]; @@ -606,18 +571,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns a Flutter error, to test error handling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwFlutterError", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwFlutterErrorWithError:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwFlutterErrorWithError:)", - api); + NSCAssert([api respondsToSelector:@selector(throwFlutterErrorWithError:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(throwFlutterErrorWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; id output = [api throwFlutterErrorWithError:&error]; @@ -629,17 +589,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoInt", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoInt:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoInt:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoInt:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; @@ -653,18 +609,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoDouble", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoDouble:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoDouble:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoDouble:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoDouble:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; @@ -678,17 +629,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in boolean. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoBool", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoBool:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoBool:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoBool:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoBool:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; @@ -702,18 +649,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoString:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); @@ -727,18 +669,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in Uint8List. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoUint8List", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoUint8List:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoUint8List:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoUint8List:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoUint8List:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); @@ -752,18 +689,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in generic Object. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoObject", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoObject:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoObject:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoObject:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoObject:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_anObject = GetNullableObjectAtIndex(args, 0); @@ -777,17 +709,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed list, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoList", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoList:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoList:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoList:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); @@ -801,17 +729,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed map, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoMap", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoMap:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); @@ -825,18 +749,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed map to test nested class serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoClassWrapper", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoClassWrapper:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoClassWrapper:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoClassWrapper:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassWrapper:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); @@ -850,23 +769,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed enum to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoEnum", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAnEnumBox *enumBox = GetNullableObjectAtIndex(args, 0); FLTAnEnum arg_anEnum = enumBox.value; FlutterError *error; - FLTAnEnumBox *output = [api echoEnum:arg_anEnum error:&error]; + FLTAnEnumBox * output = [api echoEnum:arg_anEnum error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -875,18 +790,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the default string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNamedDefaultString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNamedDefaultString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNamedDefaultString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); @@ -900,19 +810,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoOptionalDefaultDouble", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoOptionalDefaultDouble:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoOptionalDefaultDouble:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; @@ -926,18 +830,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoRequiredInt", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoRequiredInt:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoRequiredInt:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoRequiredInt:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoRequiredInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; @@ -951,18 +850,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAllNullableTypes", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAllNullableTypes:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAllNullableTypes:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAllNullableTypes:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllNullableTypes:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); @@ -976,26 +870,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAllNullableTypesWithoutRecursion:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAllNullableTypesWithoutRecursion:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAllNullableTypesWithoutRecursion:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllNullableTypesWithoutRecursion:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); FlutterError *error; - FLTAllNullableTypesWithoutRecursion *output = - [api echoAllNullableTypesWithoutRecursion:arg_everything error:&error]; + FLTAllNullableTypesWithoutRecursion *output = [api echoAllNullableTypesWithoutRecursion:arg_everything error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1005,19 +891,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.extractNestedNullableString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(extractNestedNullableStringFrom:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(extractNestedNullableStringFrom:error:)", - api); + NSCAssert([api respondsToSelector:@selector(extractNestedNullableStringFrom:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(extractNestedNullableStringFrom:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); @@ -1032,25 +912,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.createNestedNullableString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(createNestedObjectWithNullableString:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(createNestedObjectWithNullableString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(createNestedObjectWithNullableString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(createNestedObjectWithNullableString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_nullableString = GetNullableObjectAtIndex(args, 0); FlutterError *error; - FLTAllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString - error:&error]; + FLTAllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1059,30 +932,20 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in arguments of multiple types. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.sendMultipleNullableTypes", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesABool: - anInt:aString:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(sendMultipleNullableTypesABool:anInt:aString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesABool:anInt:aString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(sendMultipleNullableTypesABool:anInt:aString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); FlutterError *error; - FLTAllNullableTypes *output = [api sendMultipleNullableTypesABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - error:&error]; + FLTAllNullableTypes *output = [api sendMultipleNullableTypesABool:arg_aNullableBool anInt:arg_aNullableInt aString:arg_aNullableString error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1091,32 +954,20 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in arguments of multiple types. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); FlutterError *error; - FLTAllNullableTypesWithoutRecursion *output = - [api sendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - error:&error]; + FLTAllNullableTypesWithoutRecursion *output = [api sendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool anInt:arg_aNullableInt aString:arg_aNullableString error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1125,18 +976,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableInt", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableInt:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableInt:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableInt:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); @@ -1150,18 +996,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableDouble", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableDouble:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableDouble:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableDouble:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableDouble:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableDouble = GetNullableObjectAtIndex(args, 0); @@ -1175,18 +1016,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in boolean. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableBool", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableBool:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableBool:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableBool:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableBool:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); @@ -1200,18 +1036,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableString:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); @@ -1225,24 +1056,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in Uint8List. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableUint8List", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableUint8List:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableUint8List:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableUint8List:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableUint8List:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_aNullableUint8List = GetNullableObjectAtIndex(args, 0); FlutterError *error; - FlutterStandardTypedData *output = [api echoNullableUint8List:arg_aNullableUint8List - error:&error]; + FlutterStandardTypedData *output = [api echoNullableUint8List:arg_aNullableUint8List error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1251,18 +1076,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in generic Object. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableObject", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableObject:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableObject:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableObject:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableObject:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_aNullableObject = GetNullableObjectAtIndex(args, 0); @@ -1276,18 +1096,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed list, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableList", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableList:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableList:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableList:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_aNullableList = GetNullableObjectAtIndex(args, 0); @@ -1301,18 +1116,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed map, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableMap", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableMap:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableMap:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aNullableMap = GetNullableObjectAtIndex(args, 0); @@ -1325,23 +1135,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableEnum", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableEnum:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableEnum:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableEnum:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableEnum:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); FlutterError *error; - FLTAnEnumBox *output = [api echoNullableEnum:arg_anEnum error:&error]; + FLTAnEnumBox * output = [api echoNullableEnum:arg_anEnum error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1350,19 +1155,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoOptionalNullableInt", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoOptionalNullableInt:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoOptionalNullableInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); @@ -1376,19 +1175,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNamedNullableString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNamedNullableString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNamedNullableString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); @@ -1403,18 +1196,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.noopAsync", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(noopAsyncWithCompletion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(noopAsyncWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(noopAsyncWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(noopAsyncWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api noopAsyncWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -1426,25 +1214,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in int asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncInt", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncInt:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncInt:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncInt:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncInt:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api echoAsyncInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1452,25 +1234,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in double asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncDouble", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncDouble:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncDouble:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncDouble:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncDouble:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api echoAsyncDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1478,25 +1254,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in boolean asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncBool", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncBool:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncBool:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncBool:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncBool:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api echoAsyncBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1504,25 +1274,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed string asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncString:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncString:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncString:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoAsyncString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1530,26 +1294,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in Uint8List asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncUint8List", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncUint8List:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncUint8List:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncUint8List:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncUint8List:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); - [api echoAsyncUint8List:arg_aUint8List - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncUint8List:arg_aUint8List completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1557,25 +1314,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in generic Object asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncObject", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncObject:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncObject:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncObject:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncObject:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_anObject = GetNullableObjectAtIndex(args, 0); - [api echoAsyncObject:arg_anObject - completion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncObject:arg_anObject completion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1583,25 +1334,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed list, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncList", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncList:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncList:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api echoAsyncList:arg_list - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncList:arg_list completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1609,26 +1354,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed map, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncMap", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncMap:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncMap:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncMap:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncMap:arg_aMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncMap:arg_aMap completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1636,26 +1374,20 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed enum, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncEnum", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncEnum:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAnEnumBox *enumBox = GetNullableObjectAtIndex(args, 0); FLTAnEnum arg_anEnum = enumBox.value; - [api echoAsyncEnum:arg_anEnum - completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncEnum:arg_anEnum completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1663,18 +1395,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Responds with an error from an async function returning a value. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwAsyncError", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncErrorWithCompletion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncErrorWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(throwAsyncErrorWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(throwAsyncErrorWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api throwAsyncErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); @@ -1686,19 +1413,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Responds with an error from an async void function. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwAsyncErrorFromVoid", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncErrorFromVoidWithCompletion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncErrorFromVoidWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(throwAsyncErrorFromVoidWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(throwAsyncErrorFromVoidWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api throwAsyncErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -1710,21 +1431,15 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Responds with a Flutter error from an async function returning a value. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwAsyncFlutterError", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncFlutterErrorWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(throwAsyncFlutterErrorWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, - FlutterError *_Nullable error) { + [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -1734,25 +1449,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed object, to test async serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncAllTypes", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncAllTypes:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncAllTypes:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncAllTypes:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncAllTypes:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncAllTypes:arg_everything - completion:^(FLTAllTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncAllTypes:arg_everything completion:^(FLTAllTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1760,27 +1469,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypes:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableAllNullableTypes:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypes:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableAllNullableTypes:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableAllNullableTypes:arg_everything - completion:^(FLTAllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableAllNullableTypes:arg_everything completion:^(FLTAllNullableTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1788,30 +1489,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi." - @"echoAsyncNullableAllNullableTypesWithoutRecursion", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableAllNullableTypesWithoutRecursion:arg_everything - completion:^(FLTAllNullableTypesWithoutRecursion - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableAllNullableTypesWithoutRecursion:arg_everything completion:^(FLTAllNullableTypesWithoutRecursion *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1819,25 +1509,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in int asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableInt", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableInt:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableInt:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableInt:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableInt:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1845,26 +1529,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in double asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableDouble", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableDouble:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableDouble:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableDouble:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableDouble:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1872,25 +1549,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in boolean asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableBool", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableBool:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableBool:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableBool:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableBool:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1898,26 +1569,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed string asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableString:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableString:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableString:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1925,27 +1589,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in Uint8List asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableUint8List", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableUint8List:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableUint8List:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableUint8List:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableUint8List:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableUint8List:arg_aUint8List - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableUint8List:arg_aUint8List completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1953,26 +1609,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in generic Object asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableObject", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableObject:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableObject:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableObject:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableObject:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_anObject = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableObject:arg_anObject - completion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableObject:arg_anObject completion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1980,25 +1629,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed list, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableList", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableList:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableList:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableList:arg_list - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableList:arg_list completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -2006,26 +1649,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed map, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableMap", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableMap:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableMap:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableMap:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableMap:arg_aMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableMap:arg_aMap completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -2033,44 +1669,32 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed enum, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableEnum", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableEnum:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); - [api - echoAsyncNullableEnum:arg_anEnum - completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableEnum:arg_anEnum completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterNoop", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterNoopWithCompletion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterNoopWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterNoopWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterNoopWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api callFlutterNoopWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -2081,21 +1705,15 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterThrowError", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorWithCompletion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterThrowErrorWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterThrowErrorWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api callFlutterThrowErrorWithCompletion:^(id _Nullable output, - FlutterError *_Nullable error) { + [api callFlutterThrowErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -2104,19 +1722,13 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorFromVoidWithCompletion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterThrowErrorFromVoidWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorFromVoidWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterThrowErrorFromVoidWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api callFlutterThrowErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -2127,602 +1739,423 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoAllTypes", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllTypes:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllTypes:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllTypes:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoAllTypes:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllTypes:arg_everything - completion:^(FLTAllTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoAllTypes:arg_everything completion:^(FLTAllTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoAllNullableTypes", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllNullableTypes:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoAllNullableTypes:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllNullableTypes:arg_everything - completion:^(FLTAllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoAllNullableTypes:arg_everything completion:^(FLTAllNullableTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); - [api callFlutterSendMultipleNullableTypesABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - completion:^(FLTAllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterSendMultipleNullableTypesABool:arg_aNullableBool anInt:arg_aNullableInt aString:arg_aNullableString completion:^(FLTAllNullableTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi." - @"callFlutterEchoAllNullableTypesWithoutRecursion", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (callFlutterEchoAllNullableTypesWithoutRecursion:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllNullableTypesWithoutRecursion:arg_everything - completion:^(FLTAllNullableTypesWithoutRecursion - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoAllNullableTypesWithoutRecursion:arg_everything completion:^(FLTAllNullableTypesWithoutRecursion *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterSendMultipleNullableTypesWithoutRecursion", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector - (callFlutterSendMultipleNullableTypesWithoutRecursionABool: - anInt:aString:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:" - @"completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); - [api callFlutterSendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - completion:^( - FLTAllNullableTypesWithoutRecursion - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterSendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool anInt:arg_aNullableInt aString:arg_aNullableString completion:^(FLTAllNullableTypesWithoutRecursion *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoBool", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoBool:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoBool:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoBool:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoBool:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api callFlutterEchoBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoInt", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoInt:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoInt:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoInt:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoInt:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api callFlutterEchoInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoDouble", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoDouble:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoDouble:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoDouble:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoDouble:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api callFlutterEchoDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoString:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoString:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoString:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoUint8List", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoUint8List:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoUint8List:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoUint8List:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoUint8List:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoUint8List:arg_list - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoUint8List:arg_list completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoList", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoList:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoList:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoList:arg_list - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoList:arg_list completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoMap", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoMap:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoMap:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoMap:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoMap:arg_aMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoMap:arg_aMap completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoEnum", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoEnum:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAnEnumBox *enumBox = GetNullableObjectAtIndex(args, 0); FLTAnEnum arg_anEnum = enumBox.value; - [api callFlutterEchoEnum:arg_anEnum - completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoEnum:arg_anEnum completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableBool", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableBool:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableBool:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableBool:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableBool:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableBool:arg_aBool - completion:^(NSNumber *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableInt", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableInt:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableInt:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableInt:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableInt:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableInt:arg_anInt - completion:^(NSNumber *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableDouble", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableDouble:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableDouble:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableDouble:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableDouble:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableString:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableString:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableString:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableString:arg_aString - completion:^(NSString *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableUint8List", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableUint8List:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableUint8List:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableUint8List:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableUint8List:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableUint8List:arg_list - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableUint8List:arg_list completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableList", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableList:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableList:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableList:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableList:arg_list - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableList:arg_list completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableMap", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableMap:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableMap:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableMap:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableMap:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableMap:arg_aMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableMap:arg_aMap completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableEnum", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableEnum:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableEnum:arg_anEnum - completion:^(FLTAnEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableEnum:arg_anEnum completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterSmallApiEchoString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterSmallApiEchoString:completion:)], - @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterSmallApiEchoString:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterSmallApiEchoString:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterSmallApiEchoString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterSmallApiEchoString:arg_aString - completion:^(NSString *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterSmallApiEchoString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -2739,762 +2172,547 @@ @implementation FLTFlutterIntegrationCoreApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; } -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger messageChannelSuffix:(nullable NSString*)messageChannelSuffix{ self = [self init]; if (self) { _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; + _messageChannelSuffix = [messageChannelSuffix length] == 0 ? @"" : [NSString stringWithFormat: @".%@", messageChannelSuffix]; } return self; } - (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop", - _messageChannelSuffix]; + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:nil reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } - (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError", - _messageChannelSuffix]; + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - id output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:nil reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + id output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } - (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.throwErrorFromVoid", - _messageChannelSuffix]; + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)echoAllTypes:(FLTAllTypes *)arg_everything - completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:nil reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; +} +- (void)echoAllTypes:(FLTAllTypes *)arg_everything completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTAllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoAllNullableTypes:(nullable FLTAllNullableTypes *)arg_everything - completion:(void (^)(FLTAllNullableTypes *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoAllNullableTypes", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + FLTAllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoAllNullableTypes:(nullable FLTAllNullableTypes *)arg_everything completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTAllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool - anInt:(nullable NSNumber *)arg_aNullableInt - aString:(nullable NSString *)arg_aNullableString - completion:(void (^)(FLTAllNullableTypes *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.sendMultipleNullableTypes", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + FLTAllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool anInt:(nullable NSNumber *)arg_aNullableInt aString:(nullable NSString *)arg_aNullableString completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ - arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], - arg_aNullableString ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTAllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoAllNullableTypesWithoutRecursion: - (nullable FLTAllNullableTypesWithoutRecursion *)arg_everything - completion: - (void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], arg_aNullableString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + FLTAllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)arg_everything completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTAllNullableTypesWithoutRecursion *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)arg_aNullableBool - anInt:(nullable NSNumber *)arg_aNullableInt - aString:(nullable NSString *)arg_aNullableString - completion: - (void (^)( - FLTAllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - @"sendMultipleNullableTypesWithoutRecursion", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + FLTAllNullableTypesWithoutRecursion *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)arg_aNullableBool anInt:(nullable NSNumber *)arg_aNullableInt aString:(nullable NSString *)arg_aNullableString completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ - arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], - arg_aNullableString ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTAllNullableTypesWithoutRecursion *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoBool:(BOOL)arg_aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], arg_aNullableString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + FLTAllNullableTypesWithoutRecursion *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoBool:(BOOL)arg_aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ @(arg_aBool) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoInt:(NSInteger)arg_anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[@(arg_aBool)] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoInt:(NSInteger)arg_anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ @(arg_anInt) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoDouble:(double)arg_aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[@(arg_anInt)] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoDouble:(double)arg_aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ @(arg_aDouble) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[@(arg_aDouble)] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoUint8List:(FlutterStandardTypedData *)arg_list - completion: - (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoUint8List:(FlutterStandardTypedData *)arg_list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FlutterStandardTypedData *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoList:(NSArray *)arg_list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_list ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + FlutterStandardTypedData *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoList:(NSArray *)arg_list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoMap:(NSDictionary *)arg_aMap - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_list ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoMap:(NSDictionary *)arg_aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSDictionary *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoEnum:(FLTAnEnum)arg_anEnum - completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_aMap ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoEnum:(FLTAnEnum)arg_anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ [[FLTAnEnumBox alloc] initWithValue:arg_anEnum] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTAnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableBool:(nullable NSNumber *)arg_aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[[[FLTAnEnumBox alloc] initWithValue:arg_anEnum]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + FLTAnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableBool:(nullable NSNumber *)arg_aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableInt:(nullable NSNumber *)arg_anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_aBool ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableInt:(nullable NSNumber *)arg_anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableDouble", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_anInt ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableString:(nullable NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableString", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_aDouble ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableString:(nullable NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableUint8List", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FlutterStandardTypedData *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableList:(nullable NSArray *)arg_list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_list ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + FlutterStandardTypedData *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableList:(nullable NSArray *)arg_list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_list ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSDictionary *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableEnum:(nullable FLTAnEnumBox *)arg_anEnum - completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_aMap ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableEnum:(nullable FLTAnEnumBox *)arg_anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_anEnum == nil ? [NSNull null] : arg_anEnum ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTAnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_anEnum == nil ? [NSNull null] : arg_anEnum] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + FLTAnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync", - _messageChannelSuffix]; + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)echoAsyncString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:nil reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; +} +- (void)echoAsyncString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } @end -void SetUpFLTHostTrivialApi(id binaryMessenger, - NSObject *api) { +void SetUpFLTHostTrivialApi(id binaryMessenger, NSObject *api) { SetUpFLTHostTrivialApiWithSuffix(binaryMessenger, api, @""); } -void SetUpFLTHostTrivialApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; +void SetUpFLTHostTrivialApiWithSuffix(id binaryMessenger, NSObject *api, NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat: @".%@", messageChannelSuffix] : @""; { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(noopWithError:)], - @"FLTHostTrivialApi api (%@) doesn't respond to @selector(noopWithError:)", api); + NSCAssert([api respondsToSelector:@selector(noopWithError:)], @"FLTHostTrivialApi api (%@) doesn't respond to @selector(noopWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; [api noopWithError:&error]; @@ -3505,54 +2723,39 @@ void SetUpFLTHostTrivialApiWithSuffix(id binaryMessenger } } } -void SetUpFLTHostSmallApi(id binaryMessenger, - NSObject *api) { +void SetUpFLTHostSmallApi(id binaryMessenger, NSObject *api) { SetUpFLTHostSmallApiWithSuffix(binaryMessenger, api, @""); } -void SetUpFLTHostSmallApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; +void SetUpFLTHostSmallApiWithSuffix(id binaryMessenger, NSObject *api, NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat: @".%@", messageChannelSuffix] : @""; { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoString:completion:)], - @"FLTHostSmallApi api (%@) doesn't respond to @selector(echoString:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoString:completion:)], @"FLTHostSmallApi api (%@) doesn't respond to @selector(echoString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostSmallApi.voidVoid", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(voidVoidWithCompletion:)], - @"FLTHostSmallApi api (%@) doesn't respond to @selector(voidVoidWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(voidVoidWithCompletion:)], @"FLTHostSmallApi api (%@) doesn't respond to @selector(voidVoidWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api voidVoidWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -3573,67 +2776,53 @@ @implementation FLTFlutterSmallApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; } -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger messageChannelSuffix:(nullable NSString*)messageChannelSuffix{ self = [self init]; if (self) { _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; + _messageChannelSuffix = [messageChannelSuffix length] == 0 ? @"" : [NSString stringWithFormat: @".%@", messageChannelSuffix]; } return self; } -- (void)echoWrappedList:(FLTTestMessage *)arg_msg - completion:(void (^)(FLTTestMessage *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList", - _messageChannelSuffix]; +- (void)echoWrappedList:(FLTTestMessage *)arg_msg completion:(void (^)(FLTTestMessage *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_msg ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FLTTestMessage *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_msg ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + FLTTestMessage *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } @end + diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h index f2b2c0747555..154e7844969e 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h @@ -38,90 +38,88 @@ typedef NS_ENUM(NSUInteger, AnEnum) { @interface AllTypes : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithABool:(BOOL)aBool - anInt:(NSInteger)anInt - anInt64:(NSInteger)anInt64 - aDouble:(double)aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - anEnum:(AnEnum)anEnum - aString:(NSString *)aString - anObject:(id)anObject - list:(NSArray *)list - stringList:(NSArray *)stringList - intList:(NSArray *)intList - doubleList:(NSArray *)doubleList - boolList:(NSArray *)boolList - map:(NSDictionary *)map; -@property(nonatomic, assign) BOOL aBool; -@property(nonatomic, assign) NSInteger anInt; -@property(nonatomic, assign) NSInteger anInt64; -@property(nonatomic, assign) double aDouble; -@property(nonatomic, strong) FlutterStandardTypedData *aByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *a4ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *a8ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *aFloatArray; ++ (instancetype)makeWithABool:(BOOL )aBool + anInt:(NSInteger )anInt + anInt64:(NSInteger )anInt64 + aDouble:(double )aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + anEnum:(AnEnum)anEnum + aString:(NSString *)aString + anObject:(id )anObject + list:(NSArray *)list + stringList:(NSArray *)stringList + intList:(NSArray *)intList + doubleList:(NSArray *)doubleList + boolList:(NSArray *)boolList + map:(NSDictionary *)map; +@property(nonatomic, assign) BOOL aBool; +@property(nonatomic, assign) NSInteger anInt; +@property(nonatomic, assign) NSInteger anInt64; +@property(nonatomic, assign) double aDouble; +@property(nonatomic, strong) FlutterStandardTypedData * aByteArray; +@property(nonatomic, strong) FlutterStandardTypedData * a4ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData * a8ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData * aFloatArray; @property(nonatomic, assign) AnEnum anEnum; -@property(nonatomic, copy) NSString *aString; -@property(nonatomic, strong) id anObject; -@property(nonatomic, copy) NSArray *list; -@property(nonatomic, copy) NSArray *stringList; -@property(nonatomic, copy) NSArray *intList; -@property(nonatomic, copy) NSArray *doubleList; -@property(nonatomic, copy) NSArray *boolList; -@property(nonatomic, copy) NSDictionary *map; +@property(nonatomic, copy) NSString * aString; +@property(nonatomic, strong) id anObject; +@property(nonatomic, copy) NSArray * list; +@property(nonatomic, copy) NSArray * stringList; +@property(nonatomic, copy) NSArray * intList; +@property(nonatomic, copy) NSArray * doubleList; +@property(nonatomic, copy) NSArray * boolList; +@property(nonatomic, copy) NSDictionary * map; @end /// A class containing all supported nullable types. @interface AllNullableTypes : NSObject + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable AnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - allNullableTypes:(nullable AllNullableTypes *)allNullableTypes - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - nestedClassList:(nullable NSArray *)nestedClassList - map:(nullable NSDictionary *)map; -@property(nonatomic, strong, nullable) NSNumber *aNullableBool; -@property(nonatomic, strong, nullable) NSNumber *aNullableInt; -@property(nonatomic, strong, nullable) NSNumber *aNullableInt64; -@property(nonatomic, strong, nullable) NSNumber *aNullableDouble; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; -@property(nonatomic, copy, nullable) - NSDictionary *nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; -@property(nonatomic, strong, nullable) AnEnumBox *aNullableEnum; -@property(nonatomic, copy, nullable) NSString *aNullableString; -@property(nonatomic, strong, nullable) id aNullableObject; -@property(nonatomic, strong, nullable) AllNullableTypes *allNullableTypes; -@property(nonatomic, copy, nullable) NSArray *list; -@property(nonatomic, copy, nullable) NSArray *stringList; -@property(nonatomic, copy, nullable) NSArray *intList; -@property(nonatomic, copy, nullable) NSArray *doubleList; -@property(nonatomic, copy, nullable) NSArray *boolList; -@property(nonatomic, copy, nullable) NSArray *nestedClassList; -@property(nonatomic, copy, nullable) NSDictionary *map; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable AnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id )aNullableObject + allNullableTypes:(nullable AllNullableTypes *)allNullableTypes + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + nestedClassList:(nullable NSArray *)nestedClassList + map:(nullable NSDictionary *)map; +@property(nonatomic, strong, nullable) NSNumber * aNullableBool; +@property(nonatomic, strong, nullable) NSNumber * aNullableInt; +@property(nonatomic, strong, nullable) NSNumber * aNullableInt64; +@property(nonatomic, strong, nullable) NSNumber * aNullableDouble; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable4ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable8ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableFloatArray; +@property(nonatomic, copy, nullable) NSArray *> * nullableNestedList; +@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithAnnotations; +@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithObject; +@property(nonatomic, strong, nullable) AnEnumBox * aNullableEnum; +@property(nonatomic, copy, nullable) NSString * aNullableString; +@property(nonatomic, strong, nullable) id aNullableObject; +@property(nonatomic, strong, nullable) AllNullableTypes * allNullableTypes; +@property(nonatomic, copy, nullable) NSArray * list; +@property(nonatomic, copy, nullable) NSArray * stringList; +@property(nonatomic, copy, nullable) NSArray * intList; +@property(nonatomic, copy, nullable) NSArray * doubleList; +@property(nonatomic, copy, nullable) NSArray * boolList; +@property(nonatomic, copy, nullable) NSArray * nestedClassList; +@property(nonatomic, copy, nullable) NSDictionary * map; @end /// The primary purpose for this class is to ensure coverage of Swift structs @@ -129,47 +127,45 @@ typedef NS_ENUM(NSUInteger, AnEnum) { /// test Swift classes. @interface AllNullableTypesWithoutRecursion : NSObject + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable AnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - map:(nullable NSDictionary *)map; -@property(nonatomic, strong, nullable) NSNumber *aNullableBool; -@property(nonatomic, strong, nullable) NSNumber *aNullableInt; -@property(nonatomic, strong, nullable) NSNumber *aNullableInt64; -@property(nonatomic, strong, nullable) NSNumber *aNullableDouble; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; -@property(nonatomic, copy, nullable) - NSDictionary *nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; -@property(nonatomic, strong, nullable) AnEnumBox *aNullableEnum; -@property(nonatomic, copy, nullable) NSString *aNullableString; -@property(nonatomic, strong, nullable) id aNullableObject; -@property(nonatomic, copy, nullable) NSArray *list; -@property(nonatomic, copy, nullable) NSArray *stringList; -@property(nonatomic, copy, nullable) NSArray *intList; -@property(nonatomic, copy, nullable) NSArray *doubleList; -@property(nonatomic, copy, nullable) NSArray *boolList; -@property(nonatomic, copy, nullable) NSDictionary *map; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable AnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id )aNullableObject + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + map:(nullable NSDictionary *)map; +@property(nonatomic, strong, nullable) NSNumber * aNullableBool; +@property(nonatomic, strong, nullable) NSNumber * aNullableInt; +@property(nonatomic, strong, nullable) NSNumber * aNullableInt64; +@property(nonatomic, strong, nullable) NSNumber * aNullableDouble; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable4ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable8ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableFloatArray; +@property(nonatomic, copy, nullable) NSArray *> * nullableNestedList; +@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithAnnotations; +@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithObject; +@property(nonatomic, strong, nullable) AnEnumBox * aNullableEnum; +@property(nonatomic, copy, nullable) NSString * aNullableString; +@property(nonatomic, strong, nullable) id aNullableObject; +@property(nonatomic, copy, nullable) NSArray * list; +@property(nonatomic, copy, nullable) NSArray * stringList; +@property(nonatomic, copy, nullable) NSArray * intList; +@property(nonatomic, copy, nullable) NSArray * doubleList; +@property(nonatomic, copy, nullable) NSArray * boolList; +@property(nonatomic, copy, nullable) NSDictionary * map; @end /// A class for testing nested class handling. @@ -181,19 +177,17 @@ typedef NS_ENUM(NSUInteger, AnEnum) { /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithAllNullableTypes:(AllNullableTypes *)allNullableTypes - allNullableTypesWithoutRecursion: - (nullable AllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion - allTypes:(nullable AllTypes *)allTypes; -@property(nonatomic, strong) AllNullableTypes *allNullableTypes; -@property(nonatomic, strong, nullable) - AllNullableTypesWithoutRecursion *allNullableTypesWithoutRecursion; -@property(nonatomic, strong, nullable) AllTypes *allTypes; + allNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion + allTypes:(nullable AllTypes *)allTypes; +@property(nonatomic, strong) AllNullableTypes * allNullableTypes; +@property(nonatomic, strong, nullable) AllNullableTypesWithoutRecursion * allNullableTypesWithoutRecursion; +@property(nonatomic, strong, nullable) AllTypes * allTypes; @end /// A data class containing a List, used in unit tests. @interface TestMessage : NSObject + (instancetype)makeWithTestList:(nullable NSArray *)testList; -@property(nonatomic, copy, nullable) NSArray *testList; +@property(nonatomic, copy, nullable) NSArray * testList; @end /// The codec used by all APIs. @@ -208,8 +202,7 @@ NSObject *GetCoreTestsCodec(void); /// Returns the passed object, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable AllTypes *)echoAllTypes:(AllTypes *)everything - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllTypes *)echoAllTypes:(AllTypes *)everything error:(FlutterError *_Nullable *_Nonnull)error; /// Returns an error, to test error handling. - (nullable id)throwErrorWithError:(FlutterError *_Nullable *_Nonnull)error; /// Returns an error from a void function, to test error handling. @@ -231,13 +224,11 @@ NSObject *GetCoreTestsCodec(void); /// Returns the passed in string. /// /// @return `nil` only when `error != nil`. -- (nullable NSString *)echoString:(NSString *)aString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoString:(NSString *)aString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in Uint8List. /// /// @return `nil` only when `error != nil`. -- (nullable FlutterStandardTypedData *)echoUint8List:(FlutterStandardTypedData *)aUint8List - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FlutterStandardTypedData *)echoUint8List:(FlutterStandardTypedData *)aUint8List error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in generic Object. /// /// @return `nil` only when `error != nil`. @@ -245,18 +236,15 @@ NSObject *GetCoreTestsCodec(void); /// Returns the passed list, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable NSArray *)echoList:(NSArray *)list - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSArray *)echoList:(NSArray *)list error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed map, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed map to test nested class serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable AllClassesWrapper *)echoClassWrapper:(AllClassesWrapper *)wrapper - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllClassesWrapper *)echoClassWrapper:(AllClassesWrapper *)wrapper error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed enum to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. @@ -264,257 +252,144 @@ NSObject *GetCoreTestsCodec(void); /// Returns the default string. /// /// @return `nil` only when `error != nil`. -- (nullable NSString *)echoNamedDefaultString:(NSString *)aString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNamedDefaultString:(NSString *)aString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in double. /// /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoOptionalDefaultDouble:(double)aDouble - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoOptionalDefaultDouble:(double)aDouble error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. /// /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoRequiredInt:(NSInteger)anInt - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoRequiredInt:(NSInteger)anInt error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed object, to test serialization and deserialization. -- (nullable AllNullableTypes *)echoAllNullableTypes:(nullable AllNullableTypes *)everything - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllNullableTypes *)echoAllNullableTypes:(nullable AllNullableTypes *)everything error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed object, to test serialization and deserialization. -- (nullable AllNullableTypesWithoutRecursion *) - echoAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)everything - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllNullableTypesWithoutRecursion *)echoAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)everything error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. -- (nullable NSString *)extractNestedNullableStringFrom:(AllClassesWrapper *)wrapper - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)extractNestedNullableStringFrom:(AllClassesWrapper *)wrapper error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. /// /// @return `nil` only when `error != nil`. -- (nullable AllClassesWrapper *) - createNestedObjectWithNullableString:(nullable NSString *)nullableString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllClassesWrapper *)createNestedObjectWithNullableString:(nullable NSString *)nullableString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in arguments of multiple types. /// /// @return `nil` only when `error != nil`. -- (nullable AllNullableTypes *)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull) - error; +- (nullable AllNullableTypes *)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in arguments of multiple types. /// /// @return `nil` only when `error != nil`. -- (nullable AllNullableTypesWithoutRecursion *) - sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllNullableTypesWithoutRecursion *)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. -- (nullable NSNumber *)echoNullableInt:(nullable NSNumber *)aNullableInt - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableInt:(nullable NSNumber *)aNullableInt error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in double. -- (nullable NSNumber *)echoNullableDouble:(nullable NSNumber *)aNullableDouble - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableDouble:(nullable NSNumber *)aNullableDouble error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in boolean. -- (nullable NSNumber *)echoNullableBool:(nullable NSNumber *)aNullableBool - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableBool:(nullable NSNumber *)aNullableBool error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in string. -- (nullable NSString *)echoNullableString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNullableString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in Uint8List. -- (nullable FlutterStandardTypedData *) - echoNullableUint8List:(nullable FlutterStandardTypedData *)aNullableUint8List - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FlutterStandardTypedData *)echoNullableUint8List:(nullable FlutterStandardTypedData *)aNullableUint8List error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in generic Object. -- (nullable id)echoNullableObject:(nullable id)aNullableObject - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable id)echoNullableObject:(nullable id)aNullableObject error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed list, to test serialization and deserialization. -- (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *)echoNullableMap: - (nullable NSDictionary *)aNullableMap - error:(FlutterError *_Nullable *_Nonnull)error; -- (AnEnumBox *_Nullable)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)aNullableMap error:(FlutterError *_Nullable *_Nonnull)error; +- (AnEnumBox *_Nullable)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. -- (nullable NSNumber *)echoOptionalNullableInt:(nullable NSNumber *)aNullableInt - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoOptionalNullableInt:(nullable NSNumber *)aNullableInt error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in string. -- (nullable NSString *)echoNamedNullableString:(nullable NSString *)aNullableString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNamedNullableString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Returns passed in int asynchronously. -- (void)echoAsyncInt:(NSInteger)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in double asynchronously. -- (void)echoAsyncDouble:(double)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in boolean asynchronously. -- (void)echoAsyncBool:(BOOL)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string asynchronously. -- (void)echoAsyncString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in Uint8List asynchronously. -- (void)echoAsyncUint8List:(FlutterStandardTypedData *)aUint8List - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncUint8List:(FlutterStandardTypedData *)aUint8List completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in generic Object asynchronously. -- (void)echoAsyncObject:(id)anObject - completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncObject:(id)anObject completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncList:(NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAsyncEnum:(AnEnum)anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncEnum:(AnEnum)anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// Responds with an error from an async function returning a value. - (void)throwAsyncErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Responds with an error from an async void function. - (void)throwAsyncErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Responds with a Flutter error from an async function returning a value. -- (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, - FlutterError *_Nullable))completion; +- (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test async serialization and deserialization. -- (void)echoAsyncAllTypes:(AllTypes *)everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncAllTypes:(AllTypes *)everything completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAsyncNullableAllNullableTypes:(nullable AllNullableTypes *)everything - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncNullableAllNullableTypes:(nullable AllNullableTypes *)everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAsyncNullableAllNullableTypesWithoutRecursion: - (nullable AllNullableTypesWithoutRecursion *)everything - completion: - (void (^)( - AllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncNullableAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)everything completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in int asynchronously. -- (void)echoAsyncNullableInt:(nullable NSNumber *)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in double asynchronously. -- (void)echoAsyncNullableDouble:(nullable NSNumber *)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableDouble:(nullable NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in boolean asynchronously. -- (void)echoAsyncNullableBool:(nullable NSNumber *)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string asynchronously. -- (void)echoAsyncNullableString:(nullable NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in Uint8List asynchronously. -- (void)echoAsyncNullableUint8List:(nullable FlutterStandardTypedData *)aUint8List - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncNullableUint8List:(nullable FlutterStandardTypedData *)aUint8List completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in generic Object asynchronously. -- (void)echoAsyncNullableObject:(nullable id)anObject - completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableObject:(nullable id)anObject completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableList:(nullable NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableEnum:(nullable AnEnumBox *)anEnumBoxed - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableEnum:(nullable AnEnumBox *)anEnumBoxed completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; - (void)callFlutterNoopWithCompletion:(void (^)(FlutterError *_Nullable))completion; -- (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, - FlutterError *_Nullable))completion; +- (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; - (void)callFlutterThrowErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllTypes:(AllTypes *)everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllNullableTypes:(nullable AllNullableTypes *)everything - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; -- (void) - callFlutterEchoAllNullableTypesWithoutRecursion: - (nullable AllNullableTypesWithoutRecursion *)everything - completion: - (void (^)(AllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion; -- (void) - callFlutterSendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion: - (void (^)(AllNullableTypesWithoutRecursion - *_Nullable, - FlutterError *_Nullable)) - completion; -- (void)callFlutterEchoBool:(BOOL)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoInt:(NSInteger)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoDouble:(double)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)list - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoList:(NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoEnum:(AnEnum)anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableInt:(nullable NSNumber *)anInt - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableDouble:(nullable NSNumber *)aDouble - completion: - (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableString:(nullable NSString *)aString - completion: - (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableUint8List:(nullable FlutterStandardTypedData *)list - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableList:(nullable NSArray *)list - completion: - (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableEnum:(nullable AnEnumBox *)anEnumBoxed - completion: - (void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterSmallApiEchoString:(NSString *)aString - completion: - (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllTypes:(AllTypes *)everything completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllNullableTypes:(nullable AllNullableTypes *)everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)everything completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterSendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoEnum:(AnEnum)anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableDouble:(nullable NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableUint8List:(nullable FlutterStandardTypedData *)list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableEnum:(nullable AnEnumBox *)anEnumBoxed completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterSmallApiEchoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end -extern void SetUpHostIntegrationCoreApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpHostIntegrationCoreApi(id binaryMessenger, NSObject *_Nullable api); + +extern void SetUpHostIntegrationCoreApiWithSuffix(id binaryMessenger, NSObject *_Nullable api, NSString *messageChannelSuffix); -extern void SetUpHostIntegrationCoreApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); /// The core interface that the Dart platform_test code implements for host /// integration tests to call into. @interface FlutterIntegrationCoreApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger messageChannelSuffix:(nullable NSString *)messageChannelSuffix; /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. - (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion; @@ -523,129 +398,86 @@ extern void SetUpHostIntegrationCoreApiWithSuffix(id bin /// Responds with an error from an async void function. - (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAllTypes:(AllTypes *)everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAllTypes:(AllTypes *)everything completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAllNullableTypes:(nullable AllNullableTypes *)everything - completion: - (void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAllNullableTypes:(nullable AllNullableTypes *)everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)everything - completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)everything completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. -- (void) - sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion: - (void (^)(AllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion; +- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed boolean, to test serialization and deserialization. -- (void)echoBool:(BOOL)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed int, to test serialization and deserialization. -- (void)echoInt:(NSInteger)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed double, to test serialization and deserialization. -- (void)echoDouble:(double)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string, to test serialization and deserialization. -- (void)echoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed byte list, to test serialization and deserialization. -- (void)echoUint8List:(FlutterStandardTypedData *)list - completion: - (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)echoUint8List:(FlutterStandardTypedData *)list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test serialization and deserialization. -- (void)echoList:(NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization. -- (void)echoMap:(NSDictionary *)aMap - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)echoMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. -- (void)echoEnum:(AnEnum)anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoEnum:(AnEnum)anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed boolean, to test serialization and deserialization. -- (void)echoNullableBool:(nullable NSNumber *)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed int, to test serialization and deserialization. -- (void)echoNullableInt:(nullable NSNumber *)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed double, to test serialization and deserialization. -- (void)echoNullableDouble:(nullable NSNumber *)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableDouble:(nullable NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string, to test serialization and deserialization. -- (void)echoNullableString:(nullable NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed byte list, to test serialization and deserialization. -- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)list - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test serialization and deserialization. -- (void)echoNullableList:(nullable NSArray *)list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. -- (void)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Returns the passed in generic Object asynchronously. -- (void)echoAsyncString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end + /// An API that can be implemented for minimal, compile-only tests. @protocol HostTrivialApi - (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error; @end -extern void SetUpHostTrivialApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpHostTrivialApi(id binaryMessenger, NSObject *_Nullable api); + +extern void SetUpHostTrivialApiWithSuffix(id binaryMessenger, NSObject *_Nullable api, NSString *messageChannelSuffix); -extern void SetUpHostTrivialApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); /// A simple API implemented in some unit tests. @protocol HostSmallApi -- (void)echoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; - (void)voidVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; @end -extern void SetUpHostSmallApi(id binaryMessenger, - NSObject *_Nullable api); +extern void SetUpHostSmallApi(id binaryMessenger, NSObject *_Nullable api); + +extern void SetUpHostSmallApiWithSuffix(id binaryMessenger, NSObject *_Nullable api, NSString *messageChannelSuffix); -extern void SetUpHostSmallApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); /// A simple API called in some unit tests. @interface FlutterSmallApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -- (void)echoWrappedList:(TestMessage *)msg - completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion; -- (void)echoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger messageChannelSuffix:(nullable NSString *)messageChannelSuffix; +- (void)echoWrappedList:(TestMessage *)msg completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion; +- (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end NS_ASSUME_NONNULL_END diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m index be3810ceae8d..de96e96d4a82 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m @@ -27,12 +27,7 @@ } static FlutterError *createConnectionError(NSString *channelName) { - return [FlutterError - errorWithCode:@"channel-error" - message:[NSString stringWithFormat:@"%@/%@/%@", - @"Unable to establish connection on channel: '", - channelName, @"'."] - details:@""]; + return [FlutterError errorWithCode:@"channel-error" message:[NSString stringWithFormat:@"%@/%@/%@", @"Unable to establish connection on channel: '", channelName, @"'."] details:@""]; } static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { @@ -81,24 +76,24 @@ + (nullable TestMessage *)nullableFromList:(NSArray *)list; @end @implementation AllTypes -+ (instancetype)makeWithABool:(BOOL)aBool - anInt:(NSInteger)anInt - anInt64:(NSInteger)anInt64 - aDouble:(double)aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - anEnum:(AnEnum)anEnum - aString:(NSString *)aString - anObject:(id)anObject - list:(NSArray *)list - stringList:(NSArray *)stringList - intList:(NSArray *)intList - doubleList:(NSArray *)doubleList - boolList:(NSArray *)boolList - map:(NSDictionary *)map { - AllTypes *pigeonResult = [[AllTypes alloc] init]; ++ (instancetype)makeWithABool:(BOOL )aBool + anInt:(NSInteger )anInt + anInt64:(NSInteger )anInt64 + aDouble:(double )aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + anEnum:(AnEnum)anEnum + aString:(NSString *)aString + anObject:(id )anObject + list:(NSArray *)list + stringList:(NSArray *)stringList + intList:(NSArray *)intList + doubleList:(NSArray *)doubleList + boolList:(NSArray *)boolList + map:(NSDictionary *)map { + AllTypes* pigeonResult = [[AllTypes alloc] init]; pigeonResult.aBool = aBool; pigeonResult.anInt = anInt; pigeonResult.anInt64 = anInt64; @@ -168,29 +163,28 @@ + (nullable AllTypes *)nullableFromList:(NSArray *)list { @implementation AllNullableTypes + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable AnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - allNullableTypes:(nullable AllNullableTypes *)allNullableTypes - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - nestedClassList:(nullable NSArray *)nestedClassList - map:(nullable NSDictionary *)map { - AllNullableTypes *pigeonResult = [[AllNullableTypes alloc] init]; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable AnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id )aNullableObject + allNullableTypes:(nullable AllNullableTypes *)allNullableTypes + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + nestedClassList:(nullable NSArray *)nestedClassList + map:(nullable NSDictionary *)map { + AllNullableTypes* pigeonResult = [[AllNullableTypes alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; pigeonResult.aNullableInt64 = aNullableInt64; @@ -274,27 +268,26 @@ + (nullable AllNullableTypes *)nullableFromList:(NSArray *)list { @implementation AllNullableTypesWithoutRecursion + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable AnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - map:(nullable NSDictionary *)map { - AllNullableTypesWithoutRecursion *pigeonResult = [[AllNullableTypesWithoutRecursion alloc] init]; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable AnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id )aNullableObject + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + map:(nullable NSDictionary *)map { + AllNullableTypesWithoutRecursion* pigeonResult = [[AllNullableTypesWithoutRecursion alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; pigeonResult.aNullableInt64 = aNullableInt64; @@ -372,10 +365,9 @@ + (nullable AllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)l @implementation AllClassesWrapper + (instancetype)makeWithAllNullableTypes:(AllNullableTypes *)allNullableTypes - allNullableTypesWithoutRecursion: - (nullable AllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion - allTypes:(nullable AllTypes *)allTypes { - AllClassesWrapper *pigeonResult = [[AllClassesWrapper alloc] init]; + allNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion + allTypes:(nullable AllTypes *)allTypes { + AllClassesWrapper* pigeonResult = [[AllClassesWrapper alloc] init]; pigeonResult.allNullableTypes = allNullableTypes; pigeonResult.allNullableTypesWithoutRecursion = allNullableTypesWithoutRecursion; pigeonResult.allTypes = allTypes; @@ -402,7 +394,7 @@ + (nullable AllClassesWrapper *)nullableFromList:(NSArray *)list { @implementation TestMessage + (instancetype)makeWithTestList:(nullable NSArray *)testList { - TestMessage *pigeonResult = [[TestMessage alloc] init]; + TestMessage* pigeonResult = [[TestMessage alloc] init]; pigeonResult.testList = testList; return pigeonResult; } @@ -426,21 +418,21 @@ @interface CoreTestsPigeonCodecReader : FlutterStandardReader @implementation CoreTestsPigeonCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 129: + case 129: return [AllTypes fromList:[self readValue]]; - case 130: + case 130: return [AllNullableTypes fromList:[self readValue]]; - case 131: + case 131: return [AllNullableTypesWithoutRecursion fromList:[self readValue]]; - case 132: + case 132: return [AllClassesWrapper fromList:[self readValue]]; - case 133: + case 133: return [TestMessage fromList:[self readValue]]; - case 134: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil ? nil - : [[AnEnumBox alloc] initWithValue:[enumAsNumber integerValue]]; - } + case 134: + { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil : [[AnEnumBox alloc] initWithValue:[enumAsNumber integerValue]]; + } default: return [super readValueOfType:type]; } @@ -467,7 +459,7 @@ - (void)writeValue:(id)value { [self writeByte:133]; [self writeValue:[value toList]]; } else if ([value isKindOfClass:[AnEnumBox class]]) { - AnEnumBox *box = (AnEnumBox *)value; + AnEnumBox * box = (AnEnumBox *)value; [self writeByte:134]; [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; } else { @@ -491,37 +483,27 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - CoreTestsPigeonCodecReaderWriter *readerWriter = - [[CoreTestsPigeonCodecReaderWriter alloc] init]; + CoreTestsPigeonCodecReaderWriter *readerWriter = [[CoreTestsPigeonCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } -void SetUpHostIntegrationCoreApi(id binaryMessenger, - NSObject *api) { +void SetUpHostIntegrationCoreApi(id binaryMessenger, NSObject *api) { SetUpHostIntegrationCoreApiWithSuffix(binaryMessenger, api, @""); } -void SetUpHostIntegrationCoreApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; +void SetUpHostIntegrationCoreApiWithSuffix(id binaryMessenger, NSObject *api, NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat: @".%@", messageChannelSuffix] : @""; /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.noop", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(noopWithError:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(noopWithError:)", - api); + NSCAssert([api respondsToSelector:@selector(noopWithError:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(noopWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; [api noopWithError:&error]; @@ -533,18 +515,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAllTypes", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoAllTypes:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllTypes:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAllTypes:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllTypes:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); @@ -558,18 +535,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns an error, to test error handling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwError", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(throwErrorWithError:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwErrorWithError:)", - api); + NSCAssert([api respondsToSelector:@selector(throwErrorWithError:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwErrorWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; id output = [api throwErrorWithError:&error]; @@ -581,18 +553,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns an error from a void function, to test error handling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwErrorFromVoid", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwErrorFromVoidWithError:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwErrorFromVoidWithError:)", - api); + NSCAssert([api respondsToSelector:@selector(throwErrorFromVoidWithError:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwErrorFromVoidWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; [api throwErrorFromVoidWithError:&error]; @@ -604,18 +571,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns a Flutter error, to test error handling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwFlutterError", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwFlutterErrorWithError:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwFlutterErrorWithError:)", - api); + NSCAssert([api respondsToSelector:@selector(throwFlutterErrorWithError:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwFlutterErrorWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; id output = [api throwFlutterErrorWithError:&error]; @@ -627,17 +589,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoInt", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoInt:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoInt:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoInt:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; @@ -651,17 +609,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoDouble", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoDouble:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoDouble:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoDouble:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoDouble:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; @@ -675,17 +629,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in boolean. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoBool", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoBool:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoBool:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoBool:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoBool:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; @@ -699,17 +649,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); @@ -723,18 +669,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in Uint8List. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoUint8List", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoUint8List:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoUint8List:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoUint8List:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoUint8List:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); @@ -748,17 +689,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in generic Object. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoObject", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoObject:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoObject:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoObject:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoObject:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_anObject = GetNullableObjectAtIndex(args, 0); @@ -772,17 +709,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed list, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoList", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoList:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoList:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoList:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); @@ -796,17 +729,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed map, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoMap", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoMap:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoMap:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoMap:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); @@ -820,18 +749,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed map to test nested class serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoClassWrapper", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoClassWrapper:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassWrapper:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoClassWrapper:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassWrapper:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); @@ -845,23 +769,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed enum to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoEnum", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnumBox *enumBox = GetNullableObjectAtIndex(args, 0); AnEnum arg_anEnum = enumBox.value; FlutterError *error; - AnEnumBox *output = [api echoEnum:arg_anEnum error:&error]; + AnEnumBox * output = [api echoEnum:arg_anEnum error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -870,18 +790,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the default string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNamedDefaultString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNamedDefaultString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNamedDefaultString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); @@ -895,19 +810,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoOptionalDefaultDouble", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoOptionalDefaultDouble:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoOptionalDefaultDouble:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; @@ -921,18 +830,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoRequiredInt", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoRequiredInt:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoRequiredInt:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoRequiredInt:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoRequiredInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; @@ -946,18 +850,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAllNullableTypes", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAllNullableTypes:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAllNullableTypes:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAllNullableTypes:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllNullableTypes:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); @@ -971,26 +870,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAllNullableTypesWithoutRecursion:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAllNullableTypesWithoutRecursion:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAllNullableTypesWithoutRecursion:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllNullableTypesWithoutRecursion:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); FlutterError *error; - AllNullableTypesWithoutRecursion *output = - [api echoAllNullableTypesWithoutRecursion:arg_everything error:&error]; + AllNullableTypesWithoutRecursion *output = [api echoAllNullableTypesWithoutRecursion:arg_everything error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1000,19 +891,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.extractNestedNullableString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(extractNestedNullableStringFrom:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(extractNestedNullableStringFrom:error:)", - api); + NSCAssert([api respondsToSelector:@selector(extractNestedNullableStringFrom:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(extractNestedNullableStringFrom:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); @@ -1027,25 +912,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.createNestedNullableString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(createNestedObjectWithNullableString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(createNestedObjectWithNullableString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(createNestedObjectWithNullableString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(createNestedObjectWithNullableString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_nullableString = GetNullableObjectAtIndex(args, 0); FlutterError *error; - AllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString - error:&error]; + AllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1054,30 +932,20 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in arguments of multiple types. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.sendMultipleNullableTypes", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesABool: - anInt:aString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(sendMultipleNullableTypesABool:anInt:aString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesABool:anInt:aString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(sendMultipleNullableTypesABool:anInt:aString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); FlutterError *error; - AllNullableTypes *output = [api sendMultipleNullableTypesABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - error:&error]; + AllNullableTypes *output = [api sendMultipleNullableTypesABool:arg_aNullableBool anInt:arg_aNullableInt aString:arg_aNullableString error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1086,32 +954,20 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in arguments of multiple types. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); FlutterError *error; - AllNullableTypesWithoutRecursion *output = - [api sendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - error:&error]; + AllNullableTypesWithoutRecursion *output = [api sendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool anInt:arg_aNullableInt aString:arg_aNullableString error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1120,18 +976,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableInt", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoNullableInt:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableInt:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableInt:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); @@ -1145,18 +996,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableDouble", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableDouble:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableDouble:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableDouble:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableDouble:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableDouble = GetNullableObjectAtIndex(args, 0); @@ -1170,18 +1016,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in boolean. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableBool", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoNullableBool:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableBool:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableBool:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableBool:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); @@ -1195,18 +1036,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); @@ -1220,24 +1056,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in Uint8List. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableUint8List", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableUint8List:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableUint8List:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableUint8List:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableUint8List:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_aNullableUint8List = GetNullableObjectAtIndex(args, 0); FlutterError *error; - FlutterStandardTypedData *output = [api echoNullableUint8List:arg_aNullableUint8List - error:&error]; + FlutterStandardTypedData *output = [api echoNullableUint8List:arg_aNullableUint8List error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1246,18 +1076,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in generic Object. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableObject", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableObject:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNullableObject:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableObject:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableObject:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_aNullableObject = GetNullableObjectAtIndex(args, 0); @@ -1271,18 +1096,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed list, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableList", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoNullableList:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableList:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableList:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableList:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_aNullableList = GetNullableObjectAtIndex(args, 0); @@ -1296,18 +1116,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed map, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableMap", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoNullableMap:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableMap:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableMap:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableMap:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aNullableMap = GetNullableObjectAtIndex(args, 0); @@ -1320,23 +1135,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNullableEnum", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoNullableEnum:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableEnum:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNullableEnum:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableEnum:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); FlutterError *error; - AnEnumBox *output = [api echoNullableEnum:arg_anEnum error:&error]; + AnEnumBox * output = [api echoNullableEnum:arg_anEnum error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1345,19 +1155,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoOptionalNullableInt", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoOptionalNullableInt:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoOptionalNullableInt:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); @@ -1371,19 +1175,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoNamedNullableString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoNamedNullableString:error:)", - api); + NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNamedNullableString:error:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); @@ -1398,18 +1196,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.noopAsync", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(noopAsyncWithCompletion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(noopAsyncWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(noopAsyncWithCompletion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(noopAsyncWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api noopAsyncWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -1421,25 +1214,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in int asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncInt", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoAsyncInt:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncInt:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncInt:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncInt:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api echoAsyncInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1447,25 +1234,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in double asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncDouble", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncDouble:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncDouble:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncDouble:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncDouble:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api echoAsyncDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1473,25 +1254,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in boolean asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncBool", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncBool:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncBool:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncBool:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncBool:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api echoAsyncBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1499,25 +1274,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed string asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncString:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncString:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncString:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoAsyncString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1525,26 +1294,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in Uint8List asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncUint8List", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncUint8List:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncUint8List:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncUint8List:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncUint8List:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); - [api echoAsyncUint8List:arg_aUint8List - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncUint8List:arg_aUint8List completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1552,25 +1314,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in generic Object asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncObject", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncObject:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncObject:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncObject:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncObject:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_anObject = GetNullableObjectAtIndex(args, 0); - [api echoAsyncObject:arg_anObject - completion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncObject:arg_anObject completion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1578,25 +1334,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed list, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncList", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncList:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncList:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncList:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api echoAsyncList:arg_list - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncList:arg_list completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1604,26 +1354,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed map, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncMap", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector(echoAsyncMap:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncMap:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncMap:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncMap:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncMap:arg_aMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncMap:arg_aMap completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1631,26 +1374,20 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed enum, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncEnum", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncEnum:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnumBox *enumBox = GetNullableObjectAtIndex(args, 0); AnEnum arg_anEnum = enumBox.value; - [api echoAsyncEnum:arg_anEnum - completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncEnum:arg_anEnum completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1658,18 +1395,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Responds with an error from an async function returning a value. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwAsyncError", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncErrorWithCompletion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncErrorWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(throwAsyncErrorWithCompletion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwAsyncErrorWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api throwAsyncErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); @@ -1681,19 +1413,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Responds with an error from an async void function. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwAsyncErrorFromVoid", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncErrorFromVoidWithCompletion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncErrorFromVoidWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(throwAsyncErrorFromVoidWithCompletion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwAsyncErrorFromVoidWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api throwAsyncErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -1705,21 +1431,15 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Responds with a Flutter error from an async function returning a value. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.throwAsyncFlutterError", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(throwAsyncFlutterErrorWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwAsyncFlutterErrorWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, - FlutterError *_Nullable error) { + [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -1729,25 +1449,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed object, to test async serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncAllTypes", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncAllTypes:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncAllTypes:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncAllTypes:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncAllTypes:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncAllTypes:arg_everything - completion:^(AllTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncAllTypes:arg_everything completion:^(AllTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1755,27 +1469,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypes:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableAllNullableTypes:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypes:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableAllNullableTypes:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableAllNullableTypes:arg_everything - completion:^(AllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableAllNullableTypes:arg_everything completion:^(AllNullableTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1783,30 +1489,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi." - @"echoAsyncNullableAllNullableTypesWithoutRecursion", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableAllNullableTypesWithoutRecursion:arg_everything - completion:^(AllNullableTypesWithoutRecursion - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableAllNullableTypesWithoutRecursion:arg_everything completion:^(AllNullableTypesWithoutRecursion *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1814,25 +1509,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in int asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableInt", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableInt:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableInt:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableInt:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableInt:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1840,26 +1529,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in double asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableDouble", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableDouble:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableDouble:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableDouble:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableDouble:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1867,25 +1549,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in boolean asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableBool", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableBool:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableBool:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableBool:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableBool:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1893,26 +1569,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed string asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableString:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableString:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableString:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1920,27 +1589,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in Uint8List asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableUint8List", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableUint8List:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableUint8List:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableUint8List:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableUint8List:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableUint8List:arg_aUint8List - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableUint8List:arg_aUint8List completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1948,26 +1609,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in generic Object asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableObject", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableObject:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableObject:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableObject:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableObject:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_anObject = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableObject:arg_anObject - completion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableObject:arg_anObject completion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1975,25 +1629,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed list, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableList", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableList:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableList:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableList:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableList:arg_list - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableList:arg_list completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -2001,26 +1649,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed map, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableMap", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableMap:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableMap:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableMap:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableMap:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableMap:arg_aMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableMap:arg_aMap completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -2028,43 +1669,32 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed enum, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.echoAsyncNullableEnum", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(echoAsyncNullableEnum:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableEnum:arg_anEnum - completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableEnum:arg_anEnum completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterNoop", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterNoopWithCompletion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterNoopWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterNoopWithCompletion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterNoopWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api callFlutterNoopWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -2075,21 +1705,15 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterThrowError", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorWithCompletion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterThrowErrorWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorWithCompletion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterThrowErrorWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api callFlutterThrowErrorWithCompletion:^(id _Nullable output, - FlutterError *_Nullable error) { + [api callFlutterThrowErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -2098,19 +1722,13 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorFromVoidWithCompletion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterThrowErrorFromVoidWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorFromVoidWithCompletion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterThrowErrorFromVoidWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api callFlutterThrowErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -2121,601 +1739,423 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoAllTypes", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllTypes:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllTypes:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllTypes:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoAllTypes:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllTypes:arg_everything - completion:^(AllTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoAllTypes:arg_everything completion:^(AllTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoAllNullableTypes", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllNullableTypes:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoAllNullableTypes:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllNullableTypes:arg_everything - completion:^(AllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoAllNullableTypes:arg_everything completion:^(AllNullableTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); - [api callFlutterSendMultipleNullableTypesABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - completion:^(AllNullableTypes *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterSendMultipleNullableTypesABool:arg_aNullableBool anInt:arg_aNullableInt aString:arg_aNullableString completion:^(AllNullableTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi." - @"callFlutterEchoAllNullableTypesWithoutRecursion", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector - (callFlutterEchoAllNullableTypesWithoutRecursion:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllNullableTypesWithoutRecursion:arg_everything - completion:^(AllNullableTypesWithoutRecursion - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoAllNullableTypesWithoutRecursion:arg_everything completion:^(AllNullableTypesWithoutRecursion *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - @"callFlutterSendMultipleNullableTypesWithoutRecursion", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert( - [api respondsToSelector:@selector - (callFlutterSendMultipleNullableTypesWithoutRecursionABool: - anInt:aString:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:" - @"completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); - [api callFlutterSendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool - anInt:arg_aNullableInt - aString:arg_aNullableString - completion:^( - AllNullableTypesWithoutRecursion - *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterSendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool anInt:arg_aNullableInt aString:arg_aNullableString completion:^(AllNullableTypesWithoutRecursion *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoBool", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoBool:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoBool:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoBool:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoBool:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api callFlutterEchoBool:arg_aBool - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoInt", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoInt:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoInt:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoInt:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoInt:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api callFlutterEchoInt:arg_anInt - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoDouble", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoDouble:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoDouble:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoDouble:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoDouble:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api callFlutterEchoDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoString:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoString:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoString:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoUint8List", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoUint8List:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoUint8List:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoUint8List:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoUint8List:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoUint8List:arg_list - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoUint8List:arg_list completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoList", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoList:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoList:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoList:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoList:arg_list - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoList:arg_list completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoMap", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoMap:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoMap:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoMap:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoMap:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoMap:arg_aMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoMap:arg_aMap completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoEnum", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoEnum:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnumBox *enumBox = GetNullableObjectAtIndex(args, 0); AnEnum arg_anEnum = enumBox.value; - [api callFlutterEchoEnum:arg_anEnum - completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoEnum:arg_anEnum completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableBool", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableBool:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableBool:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableBool:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableBool:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableBool:arg_aBool - completion:^(NSNumber *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableInt", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableInt:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableInt:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableInt:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableInt:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableInt:arg_anInt - completion:^(NSNumber *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableDouble", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableDouble:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableDouble:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableDouble:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableDouble:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableDouble:arg_aDouble - completion:^(NSNumber *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableString:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableString:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableString:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableString:arg_aString - completion:^(NSString *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableUint8List", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableUint8List:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableUint8List:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableUint8List:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableUint8List:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableUint8List:arg_list - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableUint8List:arg_list completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableList", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableList:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableList:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableList:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableList:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableList:arg_list - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableList:arg_list completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableMap", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableMap:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableMap:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableMap:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableMap:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableMap:arg_aMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableMap:arg_aMap completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterEchoNullableEnum", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterEchoNullableEnum:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableEnum:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableEnum:arg_anEnum - completion:^(AnEnumBox *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableEnum:arg_anEnum completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostIntegrationCoreApi.callFlutterSmallApiEchoString", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterSmallApiEchoString:completion:)], - @"HostIntegrationCoreApi api (%@) doesn't respond to " - @"@selector(callFlutterSmallApiEchoString:completion:)", - api); + NSCAssert([api respondsToSelector:@selector(callFlutterSmallApiEchoString:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterSmallApiEchoString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterSmallApiEchoString:arg_aString - completion:^(NSString *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterSmallApiEchoString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -2732,760 +2172,547 @@ @implementation FlutterIntegrationCoreApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; } -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger messageChannelSuffix:(nullable NSString*)messageChannelSuffix{ self = [self init]; if (self) { _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; + _messageChannelSuffix = [messageChannelSuffix length] == 0 ? @"" : [NSString stringWithFormat: @".%@", messageChannelSuffix]; } return self; } - (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop", - _messageChannelSuffix]; + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:nil reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } - (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError", - _messageChannelSuffix]; + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - id output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:nil reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + id output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } - (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.throwErrorFromVoid", - _messageChannelSuffix]; + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)echoAllTypes:(AllTypes *)arg_everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:nil reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; +} +- (void)echoAllTypes:(AllTypes *)arg_everything completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - AllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoAllNullableTypes:(nullable AllNullableTypes *)arg_everything - completion: - (void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoAllNullableTypes", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + AllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoAllNullableTypes:(nullable AllNullableTypes *)arg_everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool - anInt:(nullable NSNumber *)arg_aNullableInt - aString:(nullable NSString *)arg_aNullableString - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.sendMultipleNullableTypes", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool anInt:(nullable NSNumber *)arg_aNullableInt aString:(nullable NSString *)arg_aNullableString completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ - arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], - arg_aNullableString ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoAllNullableTypesWithoutRecursion: - (nullable AllNullableTypesWithoutRecursion *)arg_everything - completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], arg_aNullableString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)arg_everything completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - AllNullableTypesWithoutRecursion *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void) - sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)arg_aNullableBool - anInt:(nullable NSNumber *)arg_aNullableInt - aString:(nullable NSString *)arg_aNullableString - completion: - (void (^)(AllNullableTypesWithoutRecursion *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - @"sendMultipleNullableTypesWithoutRecursion", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + AllNullableTypesWithoutRecursion *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)arg_aNullableBool anInt:(nullable NSNumber *)arg_aNullableInt aString:(nullable NSString *)arg_aNullableString completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ - arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], - arg_aNullableString ?: [NSNull null] - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - AllNullableTypesWithoutRecursion *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoBool:(BOOL)arg_aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], arg_aNullableString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + AllNullableTypesWithoutRecursion *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoBool:(BOOL)arg_aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ @(arg_aBool) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoInt:(NSInteger)arg_anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[@(arg_aBool)] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoInt:(NSInteger)arg_anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ @(arg_anInt) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoDouble:(double)arg_aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[@(arg_anInt)] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoDouble:(double)arg_aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ @(arg_aDouble) ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[@(arg_aDouble)] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoUint8List:(FlutterStandardTypedData *)arg_list - completion: - (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoUint8List:(FlutterStandardTypedData *)arg_list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FlutterStandardTypedData *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoList:(NSArray *)arg_list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_list ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + FlutterStandardTypedData *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoList:(NSArray *)arg_list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoMap:(NSDictionary *)arg_aMap - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_list ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoMap:(NSDictionary *)arg_aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSDictionary *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoEnum:(AnEnum)arg_anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_aMap ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoEnum:(AnEnum)arg_anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ [[AnEnumBox alloc] initWithValue:arg_anEnum] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - AnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableBool:(nullable NSNumber *)arg_aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[[[AnEnumBox alloc] initWithValue:arg_anEnum]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + AnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableBool:(nullable NSNumber *)arg_aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableInt:(nullable NSNumber *)arg_anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_aBool ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableInt:(nullable NSNumber *)arg_anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableDouble", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_anInt ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableString:(nullable NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableString", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_aDouble ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableString:(nullable NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = - [NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"FlutterIntegrationCoreApi.echoNullableUint8List", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FlutterStandardTypedData *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableList:(nullable NSArray *)arg_list - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_list ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + FlutterStandardTypedData *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableList:(nullable NSArray *)arg_list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_list ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_list ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSDictionary *output = - reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableEnum:(nullable AnEnumBox *)arg_anEnum - completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_aMap ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableEnum:(nullable AnEnumBox *)arg_anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_anEnum == nil ? [NSNull null] : arg_anEnum ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - AnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_anEnum == nil ? [NSNull null] : arg_anEnum] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + AnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync", - _messageChannelSuffix]; + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)echoAsyncString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:nil reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; +} +- (void)echoAsyncString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } @end -void SetUpHostTrivialApi(id binaryMessenger, - NSObject *api) { +void SetUpHostTrivialApi(id binaryMessenger, NSObject *api) { SetUpHostTrivialApiWithSuffix(binaryMessenger, api, @""); } -void SetUpHostTrivialApiWithSuffix(id binaryMessenger, - NSObject *api, NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; +void SetUpHostTrivialApiWithSuffix(id binaryMessenger, NSObject *api, NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat: @".%@", messageChannelSuffix] : @""; { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(noopWithError:)], - @"HostTrivialApi api (%@) doesn't respond to @selector(noopWithError:)", api); + NSCAssert([api respondsToSelector:@selector(noopWithError:)], @"HostTrivialApi api (%@) doesn't respond to @selector(noopWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; [api noopWithError:&error]; @@ -3500,47 +2727,35 @@ void SetUpHostSmallApi(id binaryMessenger, NSObject binaryMessenger, - NSObject *api, NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; +void SetUpHostSmallApiWithSuffix(id binaryMessenger, NSObject *api, NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat: @".%@", messageChannelSuffix] : @""; { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoString:completion:)], - @"HostSmallApi api (%@) doesn't respond to @selector(echoString:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoString:completion:)], @"HostSmallApi api (%@) doesn't respond to @selector(echoString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoString:arg_aString - completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests." - @"HostSmallApi.voidVoid", - messageChannelSuffix] + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid", messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(voidVoidWithCompletion:)], - @"HostSmallApi api (%@) doesn't respond to @selector(voidVoidWithCompletion:)", - api); + NSCAssert([api respondsToSelector:@selector(voidVoidWithCompletion:)], @"HostSmallApi api (%@) doesn't respond to @selector(voidVoidWithCompletion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api voidVoidWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -3561,67 +2776,53 @@ @implementation FlutterSmallApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; } -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger messageChannelSuffix:(nullable NSString*)messageChannelSuffix{ self = [self init]; if (self) { _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; + _messageChannelSuffix = [messageChannelSuffix length] == 0 ? @"" : [NSString stringWithFormat: @".%@", messageChannelSuffix]; } return self; } -- (void)echoWrappedList:(TestMessage *)arg_msg - completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList", - _messageChannelSuffix]; +- (void)echoWrappedList:(TestMessage *)arg_msg completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_msg ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - TestMessage *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString", - _messageChannelSuffix]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_msg ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + TestMessage *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString", _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel + messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } @end + diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/background_platform_channels.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/background_platform_channels.gen.dart index e9e063126c1a..ab533554272f 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/background_platform_channels.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/background_platform_channels.gen.dart @@ -19,6 +19,7 @@ PlatformException _createConnectionError(String channelName) { ); } + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); } @@ -27,11 +28,9 @@ class BackgroundApi2Host { /// Constructor for [BackgroundApi2Host]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - BackgroundApi2Host( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + BackgroundApi2Host({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -39,10 +38,8 @@ class BackgroundApi2Host { final String __pigeon_messageChannelSuffix; Future add(int x, int y) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.BackgroundApi2Host.add$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.BackgroundApi2Host.add$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart index e192a84ceea1..74a8f145b2d9 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart @@ -19,8 +19,7 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -250,10 +249,8 @@ class AllNullableTypes { aNullable8ByteArray: result[6] as Int64List?, aNullableFloatArray: result[7] as Float64List?, nullableNestedList: (result[8] as List?)?.cast?>(), - nullableMapWithAnnotations: - (result[9] as Map?)?.cast(), - nullableMapWithObject: - (result[10] as Map?)?.cast(), + nullableMapWithAnnotations: (result[9] as Map?)?.cast(), + nullableMapWithObject: (result[10] as Map?)?.cast(), aNullableEnum: result[11] as AnEnum?, aNullableString: result[12] as String?, aNullableObject: result[13], @@ -263,8 +260,7 @@ class AllNullableTypes { intList: (result[17] as List?)?.cast(), doubleList: (result[18] as List?)?.cast(), boolList: (result[19] as List?)?.cast(), - nestedClassList: - (result[20] as List?)?.cast(), + nestedClassList: (result[20] as List?)?.cast(), map: result[21] as Map?, ); } @@ -374,10 +370,8 @@ class AllNullableTypesWithoutRecursion { aNullable8ByteArray: result[6] as Int64List?, aNullableFloatArray: result[7] as Float64List?, nullableNestedList: (result[8] as List?)?.cast?>(), - nullableMapWithAnnotations: - (result[9] as Map?)?.cast(), - nullableMapWithObject: - (result[10] as Map?)?.cast(), + nullableMapWithAnnotations: (result[9] as Map?)?.cast(), + nullableMapWithObject: (result[10] as Map?)?.cast(), aNullableEnum: result[11] as AnEnum?, aNullableString: result[12] as String?, aNullableObject: result[13], @@ -421,8 +415,7 @@ class AllClassesWrapper { result as List; return AllClassesWrapper( allNullableTypes: result[0]! as AllNullableTypes, - allNullableTypesWithoutRecursion: - result[1] as AllNullableTypesWithoutRecursion?, + allNullableTypesWithoutRecursion: result[1] as AllNullableTypesWithoutRecursion?, allTypes: result[2] as AllTypes?, ); } @@ -450,6 +443,7 @@ class TestMessage { } } + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -457,19 +451,19 @@ class _PigeonCodec extends StandardMessageCodec { if (value is AllTypes) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is AllNullableTypes) { + } else if (value is AllNullableTypes) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is AllNullableTypesWithoutRecursion) { + } else if (value is AllNullableTypesWithoutRecursion) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is AllClassesWrapper) { + } else if (value is AllClassesWrapper) { buffer.putUint8(132); writeValue(buffer, value.encode()); - } else if (value is TestMessage) { + } else if (value is TestMessage) { buffer.putUint8(133); writeValue(buffer, value.encode()); - } else if (value is AnEnum) { + } else if (value is AnEnum) { buffer.putUint8(134); writeValue(buffer, value.index); } else { @@ -480,17 +474,17 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return AllTypes.decode(readValue(buffer)!); - case 130: + case 130: return AllNullableTypes.decode(readValue(buffer)!); - case 131: + case 131: return AllNullableTypesWithoutRecursion.decode(readValue(buffer)!); - case 132: + case 132: return AllClassesWrapper.decode(readValue(buffer)!); - case 133: + case 133: return TestMessage.decode(readValue(buffer)!); - case 134: + case 134: final int? value = readValue(buffer) as int?; return value == null ? null : AnEnum.values[value]; default: @@ -505,11 +499,9 @@ class HostIntegrationCoreApi { /// Constructor for [HostIntegrationCoreApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - HostIntegrationCoreApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + HostIntegrationCoreApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -519,10 +511,8 @@ class HostIntegrationCoreApi { /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. Future noop() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -544,10 +534,8 @@ class HostIntegrationCoreApi { /// Returns the passed object, to test serialization and deserialization. Future echoAllTypes(AllTypes everything) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -574,10 +562,8 @@ class HostIntegrationCoreApi { /// Returns an error, to test error handling. Future throwError() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -599,10 +585,8 @@ class HostIntegrationCoreApi { /// Returns an error from a void function, to test error handling. Future throwErrorFromVoid() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -624,10 +608,8 @@ class HostIntegrationCoreApi { /// Returns a Flutter error, to test error handling. Future throwFlutterError() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -649,10 +631,8 @@ class HostIntegrationCoreApi { /// Returns passed in int. Future echoInt(int anInt) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -679,10 +659,8 @@ class HostIntegrationCoreApi { /// Returns passed in double. Future echoDouble(double aDouble) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -709,10 +687,8 @@ class HostIntegrationCoreApi { /// Returns the passed in boolean. Future echoBool(bool aBool) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -739,10 +715,8 @@ class HostIntegrationCoreApi { /// Returns the passed in string. Future echoString(String aString) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -769,10 +743,8 @@ class HostIntegrationCoreApi { /// Returns the passed in Uint8List. Future echoUint8List(Uint8List aUint8List) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -799,10 +771,8 @@ class HostIntegrationCoreApi { /// Returns the passed in generic Object. Future echoObject(Object anObject) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -829,10 +799,8 @@ class HostIntegrationCoreApi { /// Returns the passed list, to test serialization and deserialization. Future> echoList(List list) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -859,10 +827,8 @@ class HostIntegrationCoreApi { /// Returns the passed map, to test serialization and deserialization. Future> echoMap(Map aMap) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -883,17 +849,14 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as Map?)! - .cast(); + return (__pigeon_replyList[0] as Map?)!.cast(); } } /// Returns the passed map to test nested class serialization and deserialization. Future echoClassWrapper(AllClassesWrapper wrapper) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -920,10 +883,8 @@ class HostIntegrationCoreApi { /// Returns the passed enum to test serialization and deserialization. Future echoEnum(AnEnum anEnum) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -950,10 +911,8 @@ class HostIntegrationCoreApi { /// Returns the default string. Future echoNamedDefaultString({String aString = 'default'}) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -980,10 +939,8 @@ class HostIntegrationCoreApi { /// Returns passed in double. Future echoOptionalDefaultDouble([double aDouble = 3.14]) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1010,10 +967,8 @@ class HostIntegrationCoreApi { /// Returns passed in int. Future echoRequiredInt({required int anInt}) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1039,12 +994,9 @@ class HostIntegrationCoreApi { } /// Returns the passed object, to test serialization and deserialization. - Future echoAllNullableTypes( - AllNullableTypes? everything) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future echoAllNullableTypes(AllNullableTypes? everything) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1065,13 +1017,9 @@ class HostIntegrationCoreApi { } /// Returns the passed object, to test serialization and deserialization. - Future - echoAllNullableTypesWithoutRecursion( - AllNullableTypesWithoutRecursion? everything) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future echoAllNullableTypesWithoutRecursion(AllNullableTypesWithoutRecursion? everything) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1094,10 +1042,8 @@ class HostIntegrationCoreApi { /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. Future extractNestedNullableString(AllClassesWrapper wrapper) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1119,18 +1065,15 @@ class HostIntegrationCoreApi { /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. - Future createNestedNullableString( - String? nullableString) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future createNestedNullableString(String? nullableString) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([nullableString]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([nullableString]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1150,19 +1093,15 @@ class HostIntegrationCoreApi { } /// Returns passed in arguments of multiple types. - Future sendMultipleNullableTypes( - bool? aNullableBool, int? aNullableInt, String? aNullableString) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future sendMultipleNullableTypes(bool? aNullableBool, int? aNullableInt, String? aNullableString) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([aNullableBool, aNullableInt, aNullableString]) - as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([aNullableBool, aNullableInt, aNullableString]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1182,20 +1121,15 @@ class HostIntegrationCoreApi { } /// Returns passed in arguments of multiple types. - Future - sendMultipleNullableTypesWithoutRecursion(bool? aNullableBool, - int? aNullableInt, String? aNullableString) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future sendMultipleNullableTypesWithoutRecursion(bool? aNullableBool, int? aNullableInt, String? aNullableString) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([aNullableBool, aNullableInt, aNullableString]) - as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([aNullableBool, aNullableInt, aNullableString]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1216,10 +1150,8 @@ class HostIntegrationCoreApi { /// Returns passed in int. Future echoNullableInt(int? aNullableInt) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1241,16 +1173,14 @@ class HostIntegrationCoreApi { /// Returns passed in double. Future echoNullableDouble(double? aNullableDouble) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([aNullableDouble]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([aNullableDouble]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1266,10 +1196,8 @@ class HostIntegrationCoreApi { /// Returns the passed in boolean. Future echoNullableBool(bool? aNullableBool) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1291,16 +1219,14 @@ class HostIntegrationCoreApi { /// Returns the passed in string. Future echoNullableString(String? aNullableString) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([aNullableString]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([aNullableString]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1315,18 +1241,15 @@ class HostIntegrationCoreApi { } /// Returns the passed in Uint8List. - Future echoNullableUint8List( - Uint8List? aNullableUint8List) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future echoNullableUint8List(Uint8List? aNullableUint8List) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([aNullableUint8List]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([aNullableUint8List]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1342,16 +1265,14 @@ class HostIntegrationCoreApi { /// Returns the passed in generic Object. Future echoNullableObject(Object? aNullableObject) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([aNullableObject]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([aNullableObject]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1367,10 +1288,8 @@ class HostIntegrationCoreApi { /// Returns the passed list, to test serialization and deserialization. Future?> echoNullableList(List? aNullableList) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1391,12 +1310,9 @@ class HostIntegrationCoreApi { } /// Returns the passed map, to test serialization and deserialization. - Future?> echoNullableMap( - Map? aNullableMap) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future?> echoNullableMap(Map? aNullableMap) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1412,16 +1328,13 @@ class HostIntegrationCoreApi { details: __pigeon_replyList[2], ); } else { - return (__pigeon_replyList[0] as Map?) - ?.cast(); + return (__pigeon_replyList[0] as Map?)?.cast(); } } Future echoNullableEnum(AnEnum? anEnum) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1443,10 +1356,8 @@ class HostIntegrationCoreApi { /// Returns passed in int. Future echoOptionalNullableInt([int? aNullableInt]) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1468,16 +1379,14 @@ class HostIntegrationCoreApi { /// Returns the passed in string. Future echoNamedNullableString({String? aNullableString}) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([aNullableString]) as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([aNullableString]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1494,10 +1403,8 @@ class HostIntegrationCoreApi { /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. Future noopAsync() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1519,10 +1426,8 @@ class HostIntegrationCoreApi { /// Returns passed in int asynchronously. Future echoAsyncInt(int anInt) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1549,10 +1454,8 @@ class HostIntegrationCoreApi { /// Returns passed in double asynchronously. Future echoAsyncDouble(double aDouble) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1579,10 +1482,8 @@ class HostIntegrationCoreApi { /// Returns the passed in boolean asynchronously. Future echoAsyncBool(bool aBool) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1609,10 +1510,8 @@ class HostIntegrationCoreApi { /// Returns the passed string asynchronously. Future echoAsyncString(String aString) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1639,10 +1538,8 @@ class HostIntegrationCoreApi { /// Returns the passed in Uint8List asynchronously. Future echoAsyncUint8List(Uint8List aUint8List) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1669,10 +1566,8 @@ class HostIntegrationCoreApi { /// Returns the passed in generic Object asynchronously. Future echoAsyncObject(Object anObject) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1699,10 +1594,8 @@ class HostIntegrationCoreApi { /// Returns the passed list, to test asynchronous serialization and deserialization. Future> echoAsyncList(List list) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1729,10 +1622,8 @@ class HostIntegrationCoreApi { /// Returns the passed map, to test asynchronous serialization and deserialization. Future> echoAsyncMap(Map aMap) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1753,17 +1644,14 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as Map?)! - .cast(); + return (__pigeon_replyList[0] as Map?)!.cast(); } } /// Returns the passed enum, to test asynchronous serialization and deserialization. Future echoAsyncEnum(AnEnum anEnum) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1790,10 +1678,8 @@ class HostIntegrationCoreApi { /// Responds with an error from an async function returning a value. Future throwAsyncError() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1815,10 +1701,8 @@ class HostIntegrationCoreApi { /// Responds with an error from an async void function. Future throwAsyncErrorFromVoid() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1840,10 +1724,8 @@ class HostIntegrationCoreApi { /// Responds with a Flutter error from an async function returning a value. Future throwAsyncFlutterError() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1865,10 +1747,8 @@ class HostIntegrationCoreApi { /// Returns the passed object, to test async serialization and deserialization. Future echoAsyncAllTypes(AllTypes everything) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1894,12 +1774,9 @@ class HostIntegrationCoreApi { } /// Returns the passed object, to test serialization and deserialization. - Future echoAsyncNullableAllNullableTypes( - AllNullableTypes? everything) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future echoAsyncNullableAllNullableTypes(AllNullableTypes? everything) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1920,13 +1797,9 @@ class HostIntegrationCoreApi { } /// Returns the passed object, to test serialization and deserialization. - Future - echoAsyncNullableAllNullableTypesWithoutRecursion( - AllNullableTypesWithoutRecursion? everything) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future echoAsyncNullableAllNullableTypesWithoutRecursion(AllNullableTypesWithoutRecursion? everything) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1948,10 +1821,8 @@ class HostIntegrationCoreApi { /// Returns passed in int asynchronously. Future echoAsyncNullableInt(int? anInt) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1973,10 +1844,8 @@ class HostIntegrationCoreApi { /// Returns passed in double asynchronously. Future echoAsyncNullableDouble(double? aDouble) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1998,10 +1867,8 @@ class HostIntegrationCoreApi { /// Returns the passed in boolean asynchronously. Future echoAsyncNullableBool(bool? aBool) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2023,10 +1890,8 @@ class HostIntegrationCoreApi { /// Returns the passed string asynchronously. Future echoAsyncNullableString(String? aString) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2048,10 +1913,8 @@ class HostIntegrationCoreApi { /// Returns the passed in Uint8List asynchronously. Future echoAsyncNullableUint8List(Uint8List? aUint8List) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2073,10 +1936,8 @@ class HostIntegrationCoreApi { /// Returns the passed in generic Object asynchronously. Future echoAsyncNullableObject(Object? anObject) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2098,10 +1959,8 @@ class HostIntegrationCoreApi { /// Returns the passed list, to test asynchronous serialization and deserialization. Future?> echoAsyncNullableList(List? list) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2122,12 +1981,9 @@ class HostIntegrationCoreApi { } /// Returns the passed map, to test asynchronous serialization and deserialization. - Future?> echoAsyncNullableMap( - Map? aMap) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future?> echoAsyncNullableMap(Map? aMap) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2143,17 +1999,14 @@ class HostIntegrationCoreApi { details: __pigeon_replyList[2], ); } else { - return (__pigeon_replyList[0] as Map?) - ?.cast(); + return (__pigeon_replyList[0] as Map?)?.cast(); } } /// Returns the passed enum, to test asynchronous serialization and deserialization. Future echoAsyncNullableEnum(AnEnum? anEnum) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2174,10 +2027,8 @@ class HostIntegrationCoreApi { } Future callFlutterNoop() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2198,10 +2049,8 @@ class HostIntegrationCoreApi { } Future callFlutterThrowError() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2222,10 +2071,8 @@ class HostIntegrationCoreApi { } Future callFlutterThrowErrorFromVoid() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2246,10 +2093,8 @@ class HostIntegrationCoreApi { } Future callFlutterEchoAllTypes(AllTypes everything) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2274,12 +2119,9 @@ class HostIntegrationCoreApi { } } - Future callFlutterEchoAllNullableTypes( - AllNullableTypes? everything) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future callFlutterEchoAllNullableTypes(AllNullableTypes? everything) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2299,19 +2141,15 @@ class HostIntegrationCoreApi { } } - Future callFlutterSendMultipleNullableTypes( - bool? aNullableBool, int? aNullableInt, String? aNullableString) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future callFlutterSendMultipleNullableTypes(bool? aNullableBool, int? aNullableInt, String? aNullableString) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([aNullableBool, aNullableInt, aNullableString]) - as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([aNullableBool, aNullableInt, aNullableString]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2330,13 +2168,9 @@ class HostIntegrationCoreApi { } } - Future - callFlutterEchoAllNullableTypesWithoutRecursion( - AllNullableTypesWithoutRecursion? everything) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future callFlutterEchoAllNullableTypesWithoutRecursion(AllNullableTypesWithoutRecursion? everything) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2356,20 +2190,15 @@ class HostIntegrationCoreApi { } } - Future - callFlutterSendMultipleNullableTypesWithoutRecursion(bool? aNullableBool, - int? aNullableInt, String? aNullableString) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future callFlutterSendMultipleNullableTypesWithoutRecursion(bool? aNullableBool, int? aNullableInt, String? aNullableString) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = await __pigeon_channel - .send([aNullableBool, aNullableInt, aNullableString]) - as List?; + final List? __pigeon_replyList = + await __pigeon_channel.send([aNullableBool, aNullableInt, aNullableString]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2389,10 +2218,8 @@ class HostIntegrationCoreApi { } Future callFlutterEchoBool(bool aBool) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2418,10 +2245,8 @@ class HostIntegrationCoreApi { } Future callFlutterEchoInt(int anInt) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2447,10 +2272,8 @@ class HostIntegrationCoreApi { } Future callFlutterEchoDouble(double aDouble) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2476,10 +2299,8 @@ class HostIntegrationCoreApi { } Future callFlutterEchoString(String aString) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2505,10 +2326,8 @@ class HostIntegrationCoreApi { } Future callFlutterEchoUint8List(Uint8List list) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2534,10 +2353,8 @@ class HostIntegrationCoreApi { } Future> callFlutterEchoList(List list) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2562,12 +2379,9 @@ class HostIntegrationCoreApi { } } - Future> callFlutterEchoMap( - Map aMap) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future> callFlutterEchoMap(Map aMap) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2588,16 +2402,13 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as Map?)! - .cast(); + return (__pigeon_replyList[0] as Map?)!.cast(); } } Future callFlutterEchoEnum(AnEnum anEnum) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2623,10 +2434,8 @@ class HostIntegrationCoreApi { } Future callFlutterEchoNullableBool(bool? aBool) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2647,10 +2456,8 @@ class HostIntegrationCoreApi { } Future callFlutterEchoNullableInt(int? anInt) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2671,10 +2478,8 @@ class HostIntegrationCoreApi { } Future callFlutterEchoNullableDouble(double? aDouble) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2695,10 +2500,8 @@ class HostIntegrationCoreApi { } Future callFlutterEchoNullableString(String? aString) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2719,10 +2522,8 @@ class HostIntegrationCoreApi { } Future callFlutterEchoNullableUint8List(Uint8List? list) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2742,12 +2543,9 @@ class HostIntegrationCoreApi { } } - Future?> callFlutterEchoNullableList( - List? list) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future?> callFlutterEchoNullableList(List? list) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2767,12 +2565,9 @@ class HostIntegrationCoreApi { } } - Future?> callFlutterEchoNullableMap( - Map? aMap) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future?> callFlutterEchoNullableMap(Map? aMap) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2788,16 +2583,13 @@ class HostIntegrationCoreApi { details: __pigeon_replyList[2], ); } else { - return (__pigeon_replyList[0] as Map?) - ?.cast(); + return (__pigeon_replyList[0] as Map?)?.cast(); } } Future callFlutterEchoNullableEnum(AnEnum? anEnum) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2818,10 +2610,8 @@ class HostIntegrationCoreApi { } Future callFlutterSmallApiEchoString(String aString) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2871,18 +2661,15 @@ abstract class FlutterIntegrationCoreApi { /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - AllNullableTypes sendMultipleNullableTypes( - bool? aNullableBool, int? aNullableInt, String? aNullableString); + AllNullableTypes sendMultipleNullableTypes(bool? aNullableBool, int? aNullableInt, String? aNullableString); /// Returns the passed object, to test serialization and deserialization. - AllNullableTypesWithoutRecursion? echoAllNullableTypesWithoutRecursion( - AllNullableTypesWithoutRecursion? everything); + AllNullableTypesWithoutRecursion? echoAllNullableTypesWithoutRecursion(AllNullableTypesWithoutRecursion? everything); /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - AllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion( - bool? aNullableBool, int? aNullableInt, String? aNullableString); + AllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion(bool? aNullableBool, int? aNullableInt, String? aNullableString); /// Returns the passed boolean, to test serialization and deserialization. bool echoBool(bool aBool); @@ -2939,18 +2726,11 @@ abstract class FlutterIntegrationCoreApi { /// Returns the passed in generic Object asynchronously. Future echoAsyncString(String aString); - static void setUp( - FlutterIntegrationCoreApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp(FlutterIntegrationCoreApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -2961,18 +2741,15 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -2983,18 +2760,15 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -3005,25 +2779,22 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes was null.'); final List args = (message as List?)!; final AllTypes? arg_everything = (args[0] as AllTypes?); assert(arg_everything != null, @@ -3033,140 +2804,118 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes was null.'); final List args = (message as List?)!; - final AllNullableTypes? arg_everything = - (args[0] as AllNullableTypes?); + final AllNullableTypes? arg_everything = (args[0] as AllNullableTypes?); try { - final AllNullableTypes? output = - api.echoAllNullableTypes(arg_everything); + final AllNullableTypes? output = api.echoAllNullableTypes(arg_everything); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes was null.'); final List args = (message as List?)!; final bool? arg_aNullableBool = (args[0] as bool?); final int? arg_aNullableInt = (args[1] as int?); final String? arg_aNullableString = (args[2] as String?); try { - final AllNullableTypes output = api.sendMultipleNullableTypes( - arg_aNullableBool, arg_aNullableInt, arg_aNullableString); + final AllNullableTypes output = api.sendMultipleNullableTypes(arg_aNullableBool, arg_aNullableInt, arg_aNullableString); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion was null.'); final List args = (message as List?)!; - final AllNullableTypesWithoutRecursion? arg_everything = - (args[0] as AllNullableTypesWithoutRecursion?); + final AllNullableTypesWithoutRecursion? arg_everything = (args[0] as AllNullableTypesWithoutRecursion?); try { - final AllNullableTypesWithoutRecursion? output = - api.echoAllNullableTypesWithoutRecursion(arg_everything); + final AllNullableTypesWithoutRecursion? output = api.echoAllNullableTypesWithoutRecursion(arg_everything); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion was null.'); final List args = (message as List?)!; final bool? arg_aNullableBool = (args[0] as bool?); final int? arg_aNullableInt = (args[1] as int?); final String? arg_aNullableString = (args[2] as String?); try { - final AllNullableTypesWithoutRecursion output = - api.sendMultipleNullableTypesWithoutRecursion( - arg_aNullableBool, arg_aNullableInt, arg_aNullableString); + final AllNullableTypesWithoutRecursion output = api.sendMultipleNullableTypesWithoutRecursion(arg_aNullableBool, arg_aNullableInt, arg_aNullableString); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool was null.'); final List args = (message as List?)!; final bool? arg_aBool = (args[0] as bool?); assert(arg_aBool != null, @@ -3176,25 +2925,22 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt was null.'); final List args = (message as List?)!; final int? arg_anInt = (args[0] as int?); assert(arg_anInt != null, @@ -3204,25 +2950,22 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble was null.'); final List args = (message as List?)!; final double? arg_aDouble = (args[0] as double?); assert(arg_aDouble != null, @@ -3232,25 +2975,22 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); assert(arg_aString != null, @@ -3260,25 +3000,22 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List was null.'); final List args = (message as List?)!; final Uint8List? arg_list = (args[0] as Uint8List?); assert(arg_list != null, @@ -3288,28 +3025,24 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList was null.'); final List args = (message as List?)!; - final List? arg_list = - (args[0] as List?)?.cast(); + final List? arg_list = (args[0] as List?)?.cast(); assert(arg_list != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList was null, expected non-null List.'); try { @@ -3317,28 +3050,24 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap was null.'); final List args = (message as List?)!; - final Map? arg_aMap = - (args[0] as Map?)?.cast(); + final Map? arg_aMap = (args[0] as Map?)?.cast(); assert(arg_aMap != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap was null, expected non-null Map.'); try { @@ -3346,25 +3075,22 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum was null.'); final List args = (message as List?)!; final AnEnum? arg_anEnum = (args[0] as AnEnum?); assert(arg_anEnum != null, @@ -3374,25 +3100,22 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool was null.'); final List args = (message as List?)!; final bool? arg_aBool = (args[0] as bool?); try { @@ -3400,25 +3123,22 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt was null.'); final List args = (message as List?)!; final int? arg_anInt = (args[0] as int?); try { @@ -3426,25 +3146,22 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble was null.'); final List args = (message as List?)!; final double? arg_aDouble = (args[0] as double?); try { @@ -3452,25 +3169,22 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); try { @@ -3478,25 +3192,22 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List was null.'); final List args = (message as List?)!; final Uint8List? arg_list = (args[0] as Uint8List?); try { @@ -3504,79 +3215,68 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList was null.'); final List args = (message as List?)!; - final List? arg_list = - (args[0] as List?)?.cast(); + final List? arg_list = (args[0] as List?)?.cast(); try { final List? output = api.echoNullableList(arg_list); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap was null.'); final List args = (message as List?)!; - final Map? arg_aMap = - (args[0] as Map?)?.cast(); + final Map? arg_aMap = (args[0] as Map?)?.cast(); try { final Map? output = api.echoNullableMap(arg_aMap); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum was null.'); final List args = (message as List?)!; final AnEnum? arg_anEnum = (args[0] as AnEnum?); try { @@ -3584,18 +3284,15 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -3606,25 +3303,22 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); assert(arg_aString != null, @@ -3634,9 +3328,8 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } @@ -3649,11 +3342,9 @@ class HostTrivialApi { /// Constructor for [HostTrivialApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - HostTrivialApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + HostTrivialApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -3661,10 +3352,8 @@ class HostTrivialApi { final String __pigeon_messageChannelSuffix; Future noop() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3690,11 +3379,9 @@ class HostSmallApi { /// Constructor for [HostSmallApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - HostSmallApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + HostSmallApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -3702,10 +3389,8 @@ class HostSmallApi { final String __pigeon_messageChannelSuffix; Future echo(String aString) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3731,10 +3416,8 @@ class HostSmallApi { } Future voidVoid() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3763,25 +3446,18 @@ abstract class FlutterSmallApi { String echoString(String aString); - static void setUp( - FlutterSmallApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp(FlutterSmallApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList was null.'); final List args = (message as List?)!; final TestMessage? arg_msg = (args[0] as TestMessage?); assert(arg_msg != null, @@ -3791,25 +3467,22 @@ abstract class FlutterSmallApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); assert(arg_aString != null, @@ -3819,9 +3492,8 @@ abstract class FlutterSmallApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart index e2ca92672ed7..359b0f0bc3f2 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart @@ -19,8 +19,7 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -34,13 +33,10 @@ List wrapResponse( enum EnumState { /// This comment is to test enum member (Pending) documentation comments. Pending, - /// This comment is to test enum member (Success) documentation comments. Success, - /// This comment is to test enum member (Error) documentation comments. Error, - /// This comment is to test enum member (SnakeCase) documentation comments. SnakeCase, } @@ -68,6 +64,7 @@ class DataWithEnum { } } + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -75,7 +72,7 @@ class _PigeonCodec extends StandardMessageCodec { if (value is DataWithEnum) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is EnumState) { + } else if (value is EnumState) { buffer.putUint8(130); writeValue(buffer, value.index); } else { @@ -86,9 +83,9 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return DataWithEnum.decode(readValue(buffer)!); - case 130: + case 130: final int? value = readValue(buffer) as int?; return value == null ? null : EnumState.values[value]; default: @@ -102,11 +99,9 @@ class EnumApi2Host { /// Constructor for [EnumApi2Host]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - EnumApi2Host( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + EnumApi2Host({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -115,10 +110,8 @@ class EnumApi2Host { /// This comment is to test method documentation comments. Future echo(DataWithEnum data) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.EnumApi2Host.echo$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.EnumApi2Host.echo$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -151,25 +144,18 @@ abstract class EnumApi2Flutter { /// This comment is to test method documentation comments. DataWithEnum echo(DataWithEnum data); - static void setUp( - EnumApi2Flutter? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp(EnumApi2Flutter? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.EnumApi2Flutter.echo$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.EnumApi2Flutter.echo$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.EnumApi2Flutter.echo was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.EnumApi2Flutter.echo was null.'); final List args = (message as List?)!; final DataWithEnum? arg_data = (args[0] as DataWithEnum?); assert(arg_data != null, @@ -179,9 +165,8 @@ abstract class EnumApi2Flutter { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart index 61e4b97a5fe0..d24eb571f933 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart @@ -108,6 +108,7 @@ class FlutterSearchReplies { } } + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -115,13 +116,13 @@ class _PigeonCodec extends StandardMessageCodec { if (value is FlutterSearchRequest) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is FlutterSearchReply) { + } else if (value is FlutterSearchReply) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is FlutterSearchRequests) { + } else if (value is FlutterSearchRequests) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is FlutterSearchReplies) { + } else if (value is FlutterSearchReplies) { buffer.putUint8(132); writeValue(buffer, value.encode()); } else { @@ -132,13 +133,13 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return FlutterSearchRequest.decode(readValue(buffer)!); - case 130: + case 130: return FlutterSearchReply.decode(readValue(buffer)!); - case 131: + case 131: return FlutterSearchRequests.decode(readValue(buffer)!); - case 132: + case 132: return FlutterSearchReplies.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -152,8 +153,7 @@ class Api { /// BinaryMessenger will be used which routes to the host platform. Api({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -161,10 +161,8 @@ class Api { final String __pigeon_messageChannelSuffix; Future search(FlutterSearchRequest request) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.Api.search$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.Api.search$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -190,10 +188,8 @@ class Api { } Future doSearches(FlutterSearchRequests request) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.Api.doSearches$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.Api.doSearches$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -219,10 +215,8 @@ class Api { } Future echo(FlutterSearchRequests requests) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.Api.echo$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.Api.echo$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -248,10 +242,8 @@ class Api { } Future anInt(int value) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.Api.anInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.Api.anInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart index fb7e65c9483f..2d833e477c61 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart @@ -19,8 +19,7 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -140,6 +139,7 @@ class MessageNested { } } + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -147,13 +147,13 @@ class _PigeonCodec extends StandardMessageCodec { if (value is MessageSearchRequest) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is MessageSearchReply) { + } else if (value is MessageSearchReply) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is MessageNested) { + } else if (value is MessageNested) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is MessageRequestState) { + } else if (value is MessageRequestState) { buffer.putUint8(132); writeValue(buffer, value.index); } else { @@ -164,13 +164,13 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return MessageSearchRequest.decode(readValue(buffer)!); - case 130: + case 130: return MessageSearchReply.decode(readValue(buffer)!); - case 131: + case 131: return MessageNested.decode(readValue(buffer)!); - case 132: + case 132: final int? value = readValue(buffer) as int?; return value == null ? null : MessageRequestState.values[value]; default: @@ -186,11 +186,9 @@ class MessageApi { /// Constructor for [MessageApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - MessageApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + MessageApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -201,10 +199,8 @@ class MessageApi { /// /// This comment also tests multiple line comments. Future initialize() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.MessageApi.initialize$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.MessageApi.initialize$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -226,10 +222,8 @@ class MessageApi { /// This comment is to test method documentation comments. Future search(MessageSearchRequest request) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.MessageApi.search$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.MessageApi.search$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -260,11 +254,9 @@ class MessageNestedApi { /// Constructor for [MessageNestedApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - MessageNestedApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + MessageNestedApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -275,10 +267,8 @@ class MessageNestedApi { /// /// This comment also tests multiple line comments. Future search(MessageNested nested) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.MessageNestedApi.search$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.MessageNestedApi.search$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -311,28 +301,20 @@ abstract class MessageFlutterSearchApi { /// This comment is to test method documentation comments. MessageSearchReply search(MessageSearchRequest request); - static void setUp( - MessageFlutterSearchApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp(MessageFlutterSearchApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.MessageFlutterSearchApi.search$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.MessageFlutterSearchApi.search$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MessageFlutterSearchApi.search was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MessageFlutterSearchApi.search was null.'); final List args = (message as List?)!; - final MessageSearchRequest? arg_request = - (args[0] as MessageSearchRequest?); + final MessageSearchRequest? arg_request = (args[0] as MessageSearchRequest?); assert(arg_request != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MessageFlutterSearchApi.search was null, expected non-null MessageSearchRequest.'); try { @@ -340,9 +322,8 @@ abstract class MessageFlutterSearchApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart index 33b984077af0..a5cb97b796f2 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart @@ -19,8 +19,7 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -30,6 +29,7 @@ List wrapResponse( return [error.code, error.message, error.details]; } + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); } @@ -38,11 +38,9 @@ class MultipleArityHostApi { /// Constructor for [MultipleArityHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - MultipleArityHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + MultipleArityHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -50,10 +48,8 @@ class MultipleArityHostApi { final String __pigeon_messageChannelSuffix; Future subtract(int x, int y) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.MultipleArityHostApi.subtract$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.MultipleArityHostApi.subtract$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -84,25 +80,18 @@ abstract class MultipleArityFlutterApi { int subtract(int x, int y); - static void setUp( - MultipleArityFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp(MultipleArityFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.MultipleArityFlutterApi.subtract$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.MultipleArityFlutterApi.subtract$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MultipleArityFlutterApi.subtract was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MultipleArityFlutterApi.subtract was null.'); final List args = (message as List?)!; final int? arg_x = (args[0] as int?); assert(arg_x != null, @@ -115,9 +104,8 @@ abstract class MultipleArityFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart index c9c7fe5a638e..346c28207515 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart @@ -19,8 +19,7 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -123,6 +122,7 @@ class NonNullFieldSearchReply { } } + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -130,13 +130,13 @@ class _PigeonCodec extends StandardMessageCodec { if (value is NonNullFieldSearchRequest) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is ExtraData) { + } else if (value is ExtraData) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is NonNullFieldSearchReply) { + } else if (value is NonNullFieldSearchReply) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is ReplyType) { + } else if (value is ReplyType) { buffer.putUint8(132); writeValue(buffer, value.index); } else { @@ -147,13 +147,13 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return NonNullFieldSearchRequest.decode(readValue(buffer)!); - case 130: + case 130: return ExtraData.decode(readValue(buffer)!); - case 131: + case 131: return NonNullFieldSearchReply.decode(readValue(buffer)!); - case 132: + case 132: final int? value = readValue(buffer) as int?; return value == null ? null : ReplyType.values[value]; default: @@ -166,23 +166,18 @@ class NonNullFieldHostApi { /// Constructor for [NonNullFieldHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - NonNullFieldHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + NonNullFieldHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); final String __pigeon_messageChannelSuffix; - Future search( - NonNullFieldSearchRequest nested) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.NonNullFieldHostApi.search$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + Future search(NonNullFieldSearchRequest nested) async { + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.NonNullFieldHostApi.search$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -213,28 +208,20 @@ abstract class NonNullFieldFlutterApi { NonNullFieldSearchReply search(NonNullFieldSearchRequest request); - static void setUp( - NonNullFieldFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp(NonNullFieldFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.NonNullFieldFlutterApi.search$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.NonNullFieldFlutterApi.search$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NonNullFieldFlutterApi.search was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NonNullFieldFlutterApi.search was null.'); final List args = (message as List?)!; - final NonNullFieldSearchRequest? arg_request = - (args[0] as NonNullFieldSearchRequest?); + final NonNullFieldSearchRequest? arg_request = (args[0] as NonNullFieldSearchRequest?); assert(arg_request != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NonNullFieldFlutterApi.search was null, expected non-null NonNullFieldSearchRequest.'); try { @@ -242,9 +229,8 @@ abstract class NonNullFieldFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart index 578a7c28c316..75d4ebbc0b92 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart @@ -19,8 +19,7 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -102,6 +101,7 @@ class NullFieldsSearchReply { } } + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -109,10 +109,10 @@ class _PigeonCodec extends StandardMessageCodec { if (value is NullFieldsSearchRequest) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is NullFieldsSearchReply) { + } else if (value is NullFieldsSearchReply) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is NullFieldsSearchReplyType) { + } else if (value is NullFieldsSearchReplyType) { buffer.putUint8(131); writeValue(buffer, value.index); } else { @@ -123,11 +123,11 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return NullFieldsSearchRequest.decode(readValue(buffer)!); - case 130: + case 130: return NullFieldsSearchReply.decode(readValue(buffer)!); - case 131: + case 131: final int? value = readValue(buffer) as int?; return value == null ? null : NullFieldsSearchReplyType.values[value]; default: @@ -140,11 +140,9 @@ class NullFieldsHostApi { /// Constructor for [NullFieldsHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - NullFieldsHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + NullFieldsHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -152,10 +150,8 @@ class NullFieldsHostApi { final String __pigeon_messageChannelSuffix; Future search(NullFieldsSearchRequest nested) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.NullFieldsHostApi.search$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.NullFieldsHostApi.search$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -186,28 +182,20 @@ abstract class NullFieldsFlutterApi { NullFieldsSearchReply search(NullFieldsSearchRequest request); - static void setUp( - NullFieldsFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp(NullFieldsFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.NullFieldsFlutterApi.search$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.NullFieldsFlutterApi.search$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NullFieldsFlutterApi.search was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NullFieldsFlutterApi.search was null.'); final List args = (message as List?)!; - final NullFieldsSearchRequest? arg_request = - (args[0] as NullFieldsSearchRequest?); + final NullFieldsSearchRequest? arg_request = (args[0] as NullFieldsSearchRequest?); assert(arg_request != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NullFieldsFlutterApi.search was null, expected non-null NullFieldsSearchRequest.'); try { @@ -215,9 +203,8 @@ abstract class NullFieldsFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/nullable_returns.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/nullable_returns.gen.dart index 72ea0ae7363f..7d5cd700fda9 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/nullable_returns.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/nullable_returns.gen.dart @@ -19,8 +19,7 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -30,6 +29,7 @@ List wrapResponse( return [error.code, error.message, error.details]; } + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); } @@ -38,11 +38,9 @@ class NullableReturnHostApi { /// Constructor for [NullableReturnHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - NullableReturnHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + NullableReturnHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -50,10 +48,8 @@ class NullableReturnHostApi { final String __pigeon_messageChannelSuffix; Future doit() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.NullableReturnHostApi.doit$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.NullableReturnHostApi.doit$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -79,18 +75,11 @@ abstract class NullableReturnFlutterApi { int? doit(); - static void setUp( - NullableReturnFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp(NullableReturnFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.NullableReturnFlutterApi.doit$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.NullableReturnFlutterApi.doit$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -101,9 +90,8 @@ abstract class NullableReturnFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } @@ -115,11 +103,9 @@ class NullableArgHostApi { /// Constructor for [NullableArgHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - NullableArgHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + NullableArgHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -127,10 +113,8 @@ class NullableArgHostApi { final String __pigeon_messageChannelSuffix; Future doit(int? x) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.NullableArgHostApi.doit$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.NullableArgHostApi.doit$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -161,25 +145,18 @@ abstract class NullableArgFlutterApi { int? doit(int? x); - static void setUp( - NullableArgFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp(NullableArgFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.NullableArgFlutterApi.doit$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.NullableArgFlutterApi.doit$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NullableArgFlutterApi.doit was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NullableArgFlutterApi.doit was null.'); final List args = (message as List?)!; final int? arg_x = (args[0] as int?); try { @@ -187,9 +164,8 @@ abstract class NullableArgFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } @@ -201,11 +177,9 @@ class NullableCollectionReturnHostApi { /// Constructor for [NullableCollectionReturnHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - NullableCollectionReturnHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + NullableCollectionReturnHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -213,10 +187,8 @@ class NullableCollectionReturnHostApi { final String __pigeon_messageChannelSuffix; Future?> doit() async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionReturnHostApi.doit$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionReturnHostApi.doit$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -242,18 +214,11 @@ abstract class NullableCollectionReturnFlutterApi { List? doit(); - static void setUp( - NullableCollectionReturnFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp(NullableCollectionReturnFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionReturnFlutterApi.doit$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionReturnFlutterApi.doit$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -264,9 +229,8 @@ abstract class NullableCollectionReturnFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } @@ -278,11 +242,9 @@ class NullableCollectionArgHostApi { /// Constructor for [NullableCollectionArgHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - NullableCollectionArgHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + NullableCollectionArgHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -290,10 +252,8 @@ class NullableCollectionArgHostApi { final String __pigeon_messageChannelSuffix; Future> doit(List? x) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionArgHostApi.doit$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionArgHostApi.doit$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -324,36 +284,27 @@ abstract class NullableCollectionArgFlutterApi { List doit(List? x); - static void setUp( - NullableCollectionArgFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp(NullableCollectionArgFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionArgFlutterApi.doit$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionArgFlutterApi.doit$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionArgFlutterApi.doit was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionArgFlutterApi.doit was null.'); final List args = (message as List?)!; - final List? arg_x = - (args[0] as List?)?.cast(); + final List? arg_x = (args[0] as List?)?.cast(); try { final List output = api.doit(arg_x); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/primitive.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/primitive.gen.dart index 8ac914eb6fad..7868fb1d09e8 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/primitive.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/primitive.gen.dart @@ -19,8 +19,7 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -30,6 +29,7 @@ List wrapResponse( return [error.code, error.message, error.details]; } + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); } @@ -38,11 +38,9 @@ class PrimitiveHostApi { /// Constructor for [PrimitiveHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - PrimitiveHostApi( - {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + PrimitiveHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -50,10 +48,8 @@ class PrimitiveHostApi { final String __pigeon_messageChannelSuffix; Future anInt(int value) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.anInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.anInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -79,10 +75,8 @@ class PrimitiveHostApi { } Future aBool(bool value) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aBool$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aBool$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -108,10 +102,8 @@ class PrimitiveHostApi { } Future aString(String value) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -137,10 +129,8 @@ class PrimitiveHostApi { } Future aDouble(double value) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aDouble$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aDouble$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -166,10 +156,8 @@ class PrimitiveHostApi { } Future> aMap(Map value) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -195,10 +183,8 @@ class PrimitiveHostApi { } Future> aList(List value) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aList$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aList$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -224,10 +210,8 @@ class PrimitiveHostApi { } Future anInt32List(Int32List value) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.anInt32List$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.anInt32List$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -253,10 +237,8 @@ class PrimitiveHostApi { } Future> aBoolList(List value) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aBoolList$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aBoolList$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -282,10 +264,8 @@ class PrimitiveHostApi { } Future> aStringIntMap(Map value) async { - final String __pigeon_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aStringIntMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = - BasicMessageChannel( + final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aStringIntMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -306,8 +286,7 @@ class PrimitiveHostApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as Map?)! - .cast(); + return (__pigeon_replyList[0] as Map?)!.cast(); } } } @@ -333,25 +312,18 @@ abstract class PrimitiveFlutterApi { Map aStringIntMap(Map value); - static void setUp( - PrimitiveFlutterApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp(PrimitiveFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.anInt$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.anInt$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.anInt was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.anInt was null.'); final List args = (message as List?)!; final int? arg_value = (args[0] as int?); assert(arg_value != null, @@ -361,25 +333,22 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBool$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBool$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBool was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBool was null.'); final List args = (message as List?)!; final bool? arg_value = (args[0] as bool?); assert(arg_value != null, @@ -389,25 +358,22 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aString$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aString$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aString was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aString was null.'); final List args = (message as List?)!; final String? arg_value = (args[0] as String?); assert(arg_value != null, @@ -417,25 +383,22 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aDouble$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aDouble$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aDouble was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aDouble was null.'); final List args = (message as List?)!; final double? arg_value = (args[0] as double?); assert(arg_value != null, @@ -445,28 +408,24 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aMap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aMap was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aMap was null.'); final List args = (message as List?)!; - final Map? arg_value = - (args[0] as Map?); + final Map? arg_value = (args[0] as Map?); assert(arg_value != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aMap was null, expected non-null Map.'); try { @@ -474,25 +433,22 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aList$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aList$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aList was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aList was null.'); final List args = (message as List?)!; final List? arg_value = (args[0] as List?); assert(arg_value != null, @@ -502,25 +458,22 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.anInt32List$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.anInt32List$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.anInt32List was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.anInt32List was null.'); final List args = (message as List?)!; final Int32List? arg_value = (args[0] as Int32List?); assert(arg_value != null, @@ -530,28 +483,24 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBoolList$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBoolList$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBoolList was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBoolList was null.'); final List args = (message as List?)!; - final List? arg_value = - (args[0] as List?)?.cast(); + final List? arg_value = (args[0] as List?)?.cast(); assert(arg_value != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBoolList was null, expected non-null List.'); try { @@ -559,28 +508,24 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aStringIntMap$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aStringIntMap$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aStringIntMap was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aStringIntMap was null.'); final List args = (message as List?)!; - final Map? arg_value = - (args[0] as Map?)?.cast(); + final Map? arg_value = (args[0] as Map?)?.cast(); assert(arg_value != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aStringIntMap was null, expected non-null Map.'); try { @@ -588,9 +533,8 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart index 160581c270f2..6553d5daaff2 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart @@ -9,8 +9,7 @@ import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; -import 'package:flutter/foundation.dart' - show ReadBuffer, WriteBuffer, immutable, protected; +import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer, immutable, protected; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart' show WidgetsFlutterBinding; @@ -21,8 +20,7 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -31,7 +29,6 @@ List wrapResponse( } return [error.code, error.message, error.details]; } - /// An immutable object that serves as the base class for all ProxyApis and /// can provide functional copies of itself. /// @@ -117,8 +114,7 @@ class PigeonInstanceManager { final Expando _identifiers = Expando(); final Map> _weakInstances = >{}; - final Map _strongInstances = - {}; + final Map _strongInstances = {}; late final Finalizer _finalizer; int _nextIdentifier = 0; @@ -136,16 +132,11 @@ class PigeonInstanceManager { api.removeStrongReference(identifier); }, ); - _PigeonInstanceManagerApi.setUpMessageHandlers( - instanceManager: instanceManager); - ProxyApiTestClass.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - ProxyApiSuperClass.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - ProxyApiInterface.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); - ClassWithApiRequirement.pigeon_setUpMessageHandlers( - pigeon_instanceManager: instanceManager); + _PigeonInstanceManagerApi.setUpMessageHandlers(instanceManager: instanceManager); + ProxyApiTestClass.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + ProxyApiSuperClass.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + ProxyApiInterface.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + ClassWithApiRequirement.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); return instanceManager; } @@ -209,19 +200,15 @@ class PigeonInstanceManager { /// /// This method also expects the host `InstanceManager` to have a strong /// reference to the instance the identifier is associated with. - T? getInstanceWithWeakReference( - int identifier) { - final PigeonProxyApiBaseClass? weakInstance = - _weakInstances[identifier]?.target; + T? getInstanceWithWeakReference(int identifier) { + final PigeonProxyApiBaseClass? weakInstance = _weakInstances[identifier]?.target; if (weakInstance == null) { - final PigeonProxyApiBaseClass? strongInstance = - _strongInstances[identifier]; + final PigeonProxyApiBaseClass? strongInstance = _strongInstances[identifier]; if (strongInstance != null) { final PigeonProxyApiBaseClass copy = strongInstance.pigeon_copy(); _identifiers[copy] = identifier; - _weakInstances[identifier] = - WeakReference(copy); + _weakInstances[identifier] = WeakReference(copy); _finalizer.attach(copy, identifier, detach: copy); return copy as T; } @@ -245,20 +232,17 @@ class PigeonInstanceManager { /// added. /// /// Returns unique identifier of the [instance] added. - void addHostCreatedInstance( - PigeonProxyApiBaseClass instance, int identifier) { + void addHostCreatedInstance(PigeonProxyApiBaseClass instance, int identifier) { _addInstanceWithIdentifier(instance, identifier); } - void _addInstanceWithIdentifier( - PigeonProxyApiBaseClass instance, int identifier) { + void _addInstanceWithIdentifier(PigeonProxyApiBaseClass instance, int identifier) { assert(!containsIdentifier(identifier)); assert(getIdentifier(instance) == null); assert(identifier >= 0); _identifiers[instance] = identifier; - _weakInstances[identifier] = - WeakReference(instance); + _weakInstances[identifier] = WeakReference(instance); _finalizer.attach(instance, identifier, detach: instance); final PigeonProxyApiBaseClass copy = instance.pigeon_copy(); @@ -382,36 +366,37 @@ class _PigeonInstanceManagerApi { } class _PigeonProxyApiBaseCodec extends _PigeonCodec { - const _PigeonProxyApiBaseCodec(this.instanceManager); - final PigeonInstanceManager instanceManager; - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonProxyApiBaseClass) { - buffer.putUint8(128); - writeValue(buffer, instanceManager.getIdentifier(value)); - } else { - super.writeValue(buffer, value); - } - } - - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return instanceManager - .getInstanceWithWeakReference(readValue(buffer)! as int); - default: - return super.readValueOfType(type, buffer); - } - } + const _PigeonProxyApiBaseCodec(this.instanceManager); + final PigeonInstanceManager instanceManager; + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is PigeonProxyApiBaseClass) { + buffer.putUint8(128); + writeValue(buffer, instanceManager.getIdentifier(value)); + } else { + super.writeValue(buffer, value); + } + } + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 128: + return instanceManager + .getInstanceWithWeakReference(readValue(buffer)! as int); + default: + return super.readValueOfType(type, buffer); + } + } } + enum ProxyApiTestEnum { one, two, three, } + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -427,7 +412,7 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: final int? value = readValue(buffer) as int?; return value == null ? null : ProxyApiTestEnum.values[value]; default: @@ -435,7 +420,6 @@ class _PigeonCodec extends StandardMessageCodec { } } } - /// The core ProxyApi test class that each supported host language must /// implement in platform_tests integration tests. class ProxyApiTestClass extends ProxyApiSuperClass @@ -5182,3 +5166,4 @@ class ClassWithApiRequirement extends PigeonProxyApiBaseClass { ); } } + diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/test/test_message.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/test/test_message.gen.dart index 27add3253372..bc796055d14a 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/test/test_message.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/test/test_message.gen.dart @@ -14,6 +14,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:shared_test_plugin_code/src/generated/message.gen.dart'; + class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -21,13 +22,13 @@ class _PigeonCodec extends StandardMessageCodec { if (value is MessageSearchRequest) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is MessageSearchReply) { + } else if (value is MessageSearchReply) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is MessageNested) { + } else if (value is MessageNested) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is MessageRequestState) { + } else if (value is MessageRequestState) { buffer.putUint8(132); writeValue(buffer, value.index); } else { @@ -38,13 +39,13 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return MessageSearchRequest.decode(readValue(buffer)!); - case 130: + case 130: return MessageSearchReply.decode(readValue(buffer)!); - case 131: + case 131: return MessageNested.decode(readValue(buffer)!); - case 132: + case 132: final int? value = readValue(buffer) as int?; return value == null ? null : MessageRequestState.values[value]; default: @@ -57,8 +58,7 @@ class _PigeonCodec extends StandardMessageCodec { /// /// This comment also tests multiple line comments. abstract class TestHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); /// This comment is to test documentation comments. @@ -69,56 +69,39 @@ abstract class TestHostApi { /// This comment is to test method documentation comments. MessageSearchReply search(MessageSearchRequest request); - static void setUp( - TestHostApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp(TestHostApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.MessageApi.initialize$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.MessageApi.initialize$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { try { api.initialize(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.MessageApi.search$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.MessageApi.search$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MessageApi.search was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MessageApi.search was null.'); final List args = (message as List?)!; - final MessageSearchRequest? arg_request = - (args[0] as MessageSearchRequest?); + final MessageSearchRequest? arg_request = (args[0] as MessageSearchRequest?); assert(arg_request != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MessageApi.search was null, expected non-null MessageSearchRequest.'); try { @@ -126,9 +109,8 @@ abstract class TestHostApi { return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } @@ -138,8 +120,7 @@ abstract class TestHostApi { /// This comment is to test api documentation comments. abstract class TestNestedApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); /// This comment is to test method documentation comments. @@ -147,28 +128,18 @@ abstract class TestNestedApi { /// This comment also tests multiple line comments. MessageSearchReply search(MessageNested nested); - static void setUp( - TestNestedApi? api, { - BinaryMessenger? binaryMessenger, - String messageChannelSuffix = '', - }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp(TestNestedApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { + messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel< - Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.MessageNestedApi.search$messageChannelSuffix', - pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + 'dev.flutter.pigeon.pigeon_integration_tests.MessageNestedApi.search$messageChannelSuffix', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(__pigeon_channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MessageNestedApi.search was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MessageNestedApi.search was null.'); final List args = (message as List?)!; final MessageNested? arg_nested = (args[0] as MessageNested?); assert(arg_nested != null, @@ -178,9 +149,8 @@ abstract class TestNestedApi { return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse( - error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt index cd8b26c0d257..94b4e78af0cb 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt @@ -22,19 +22,22 @@ private fun wrapResult(result: Any?): List { private fun wrapError(exception: Throwable): List { return if (exception is FlutterError) { - listOf(exception.code, exception.message, exception.details) + listOf( + exception.code, + exception.message, + exception.details + ) } else { listOf( - exception.javaClass.simpleName, - exception.toString(), - "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)) + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) + ) } } private fun createConnectionError(channelName: String): FlutterError { - return FlutterError( - "channel-error", "Unable to establish connection on channel: '$channelName'.", "") -} + return FlutterError("channel-error", "Unable to establish connection on channel: '$channelName'.", "")} enum class AnEnum(val raw: Int) { ONE(0), @@ -55,24 +58,25 @@ enum class AnEnum(val raw: Int) { * * Generated class from Pigeon that represents data sent in messages. */ -data class AllTypes( - val aBool: Boolean, - val anInt: Long, - val anInt64: Long, - val aDouble: Double, - val aByteArray: ByteArray, - val a4ByteArray: IntArray, - val a8ByteArray: LongArray, - val aFloatArray: DoubleArray, - val anEnum: AnEnum, - val aString: String, - val anObject: Any, - val list: List, - val stringList: List, - val intList: List, - val doubleList: List, - val boolList: List, - val map: Map +data class AllTypes ( + val aBool: Boolean, + val anInt: Long, + val anInt64: Long, + val aDouble: Double, + val aByteArray: ByteArray, + val a4ByteArray: IntArray, + val a8ByteArray: LongArray, + val aFloatArray: DoubleArray, + val anEnum: AnEnum, + val aString: String, + val anObject: Any, + val list: List, + val stringList: List, + val intList: List, + val doubleList: List, + val boolList: List, + val map: Map + ) { companion object { @Suppress("LocalVariableName") @@ -94,46 +98,28 @@ data class AllTypes( val doubleList = __pigeon_list[14] as List val boolList = __pigeon_list[15] as List val map = __pigeon_list[16] as Map - return AllTypes( - aBool, - anInt, - anInt64, - aDouble, - aByteArray, - a4ByteArray, - a8ByteArray, - aFloatArray, - anEnum, - aString, - anObject, - list, - stringList, - intList, - doubleList, - boolList, - map) + return AllTypes(aBool, anInt, anInt64, aDouble, aByteArray, a4ByteArray, a8ByteArray, aFloatArray, anEnum, aString, anObject, list, stringList, intList, doubleList, boolList, map) } } - fun toList(): List { return listOf( - aBool, - anInt, - anInt64, - aDouble, - aByteArray, - a4ByteArray, - a8ByteArray, - aFloatArray, - anEnum, - aString, - anObject, - list, - stringList, - intList, - doubleList, - boolList, - map, + aBool, + anInt, + anInt64, + aDouble, + aByteArray, + a4ByteArray, + a8ByteArray, + aFloatArray, + anEnum, + aString, + anObject, + list, + stringList, + intList, + doubleList, + boolList, + map, ) } } @@ -143,38 +129,37 @@ data class AllTypes( * * Generated class from Pigeon that represents data sent in messages. */ -data class AllNullableTypes( - val aNullableBool: Boolean? = null, - val aNullableInt: Long? = null, - val aNullableInt64: Long? = null, - val aNullableDouble: Double? = null, - val aNullableByteArray: ByteArray? = null, - val aNullable4ByteArray: IntArray? = null, - val aNullable8ByteArray: LongArray? = null, - val aNullableFloatArray: DoubleArray? = null, - val nullableNestedList: List?>? = null, - val nullableMapWithAnnotations: Map? = null, - val nullableMapWithObject: Map? = null, - val aNullableEnum: AnEnum? = null, - val aNullableString: String? = null, - val aNullableObject: Any? = null, - val allNullableTypes: AllNullableTypes? = null, - val list: List? = null, - val stringList: List? = null, - val intList: List? = null, - val doubleList: List? = null, - val boolList: List? = null, - val nestedClassList: List? = null, - val map: Map? = null +data class AllNullableTypes ( + val aNullableBool: Boolean? = null, + val aNullableInt: Long? = null, + val aNullableInt64: Long? = null, + val aNullableDouble: Double? = null, + val aNullableByteArray: ByteArray? = null, + val aNullable4ByteArray: IntArray? = null, + val aNullable8ByteArray: LongArray? = null, + val aNullableFloatArray: DoubleArray? = null, + val nullableNestedList: List?>? = null, + val nullableMapWithAnnotations: Map? = null, + val nullableMapWithObject: Map? = null, + val aNullableEnum: AnEnum? = null, + val aNullableString: String? = null, + val aNullableObject: Any? = null, + val allNullableTypes: AllNullableTypes? = null, + val list: List? = null, + val stringList: List? = null, + val intList: List? = null, + val doubleList: List? = null, + val boolList: List? = null, + val nestedClassList: List? = null, + val map: Map? = null + ) { companion object { @Suppress("LocalVariableName") fun fromList(__pigeon_list: List): AllNullableTypes { val aNullableBool = __pigeon_list[0] as Boolean? - val aNullableInt = - __pigeon_list[1].let { num -> if (num is Int) num.toLong() else num as Long? } - val aNullableInt64 = - __pigeon_list[2].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableInt = __pigeon_list[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableInt64 = __pigeon_list[2].let { num -> if (num is Int) num.toLong() else num as Long? } val aNullableDouble = __pigeon_list[3] as Double? val aNullableByteArray = __pigeon_list[4] as ByteArray? val aNullable4ByteArray = __pigeon_list[5] as IntArray? @@ -194,96 +179,73 @@ data class AllNullableTypes( val boolList = __pigeon_list[19] as List? val nestedClassList = __pigeon_list[20] as List? val map = __pigeon_list[21] as Map? - return AllNullableTypes( - aNullableBool, - aNullableInt, - aNullableInt64, - aNullableDouble, - aNullableByteArray, - aNullable4ByteArray, - aNullable8ByteArray, - aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, - aNullableEnum, - aNullableString, - aNullableObject, - allNullableTypes, - list, - stringList, - intList, - doubleList, - boolList, - nestedClassList, - map) + return AllNullableTypes(aNullableBool, aNullableInt, aNullableInt64, aNullableDouble, aNullableByteArray, aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, nullableNestedList, nullableMapWithAnnotations, nullableMapWithObject, aNullableEnum, aNullableString, aNullableObject, allNullableTypes, list, stringList, intList, doubleList, boolList, nestedClassList, map) } } - fun toList(): List { return listOf( - aNullableBool, - aNullableInt, - aNullableInt64, - aNullableDouble, - aNullableByteArray, - aNullable4ByteArray, - aNullable8ByteArray, - aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, - aNullableEnum, - aNullableString, - aNullableObject, - allNullableTypes, - list, - stringList, - intList, - doubleList, - boolList, - nestedClassList, - map, + aNullableBool, + aNullableInt, + aNullableInt64, + aNullableDouble, + aNullableByteArray, + aNullable4ByteArray, + aNullable8ByteArray, + aNullableFloatArray, + nullableNestedList, + nullableMapWithAnnotations, + nullableMapWithObject, + aNullableEnum, + aNullableString, + aNullableObject, + allNullableTypes, + list, + stringList, + intList, + doubleList, + boolList, + nestedClassList, + map, ) } } /** - * The primary purpose for this class is to ensure coverage of Swift structs with nullable items, as - * the primary [AllNullableTypes] class is being used to test Swift classes. + * The primary purpose for this class is to ensure coverage of Swift structs + * with nullable items, as the primary [AllNullableTypes] class is being used to + * test Swift classes. * * Generated class from Pigeon that represents data sent in messages. */ -data class AllNullableTypesWithoutRecursion( - val aNullableBool: Boolean? = null, - val aNullableInt: Long? = null, - val aNullableInt64: Long? = null, - val aNullableDouble: Double? = null, - val aNullableByteArray: ByteArray? = null, - val aNullable4ByteArray: IntArray? = null, - val aNullable8ByteArray: LongArray? = null, - val aNullableFloatArray: DoubleArray? = null, - val nullableNestedList: List?>? = null, - val nullableMapWithAnnotations: Map? = null, - val nullableMapWithObject: Map? = null, - val aNullableEnum: AnEnum? = null, - val aNullableString: String? = null, - val aNullableObject: Any? = null, - val list: List? = null, - val stringList: List? = null, - val intList: List? = null, - val doubleList: List? = null, - val boolList: List? = null, - val map: Map? = null +data class AllNullableTypesWithoutRecursion ( + val aNullableBool: Boolean? = null, + val aNullableInt: Long? = null, + val aNullableInt64: Long? = null, + val aNullableDouble: Double? = null, + val aNullableByteArray: ByteArray? = null, + val aNullable4ByteArray: IntArray? = null, + val aNullable8ByteArray: LongArray? = null, + val aNullableFloatArray: DoubleArray? = null, + val nullableNestedList: List?>? = null, + val nullableMapWithAnnotations: Map? = null, + val nullableMapWithObject: Map? = null, + val aNullableEnum: AnEnum? = null, + val aNullableString: String? = null, + val aNullableObject: Any? = null, + val list: List? = null, + val stringList: List? = null, + val intList: List? = null, + val doubleList: List? = null, + val boolList: List? = null, + val map: Map? = null + ) { companion object { @Suppress("LocalVariableName") fun fromList(__pigeon_list: List): AllNullableTypesWithoutRecursion { val aNullableBool = __pigeon_list[0] as Boolean? - val aNullableInt = - __pigeon_list[1].let { num -> if (num is Int) num.toLong() else num as Long? } - val aNullableInt64 = - __pigeon_list[2].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableInt = __pigeon_list[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableInt64 = __pigeon_list[2].let { num -> if (num is Int) num.toLong() else num as Long? } val aNullableDouble = __pigeon_list[3] as Double? val aNullableByteArray = __pigeon_list[4] as ByteArray? val aNullable4ByteArray = __pigeon_list[5] as IntArray? @@ -301,52 +263,31 @@ data class AllNullableTypesWithoutRecursion( val doubleList = __pigeon_list[17] as List? val boolList = __pigeon_list[18] as List? val map = __pigeon_list[19] as Map? - return AllNullableTypesWithoutRecursion( - aNullableBool, - aNullableInt, - aNullableInt64, - aNullableDouble, - aNullableByteArray, - aNullable4ByteArray, - aNullable8ByteArray, - aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, - aNullableEnum, - aNullableString, - aNullableObject, - list, - stringList, - intList, - doubleList, - boolList, - map) + return AllNullableTypesWithoutRecursion(aNullableBool, aNullableInt, aNullableInt64, aNullableDouble, aNullableByteArray, aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, nullableNestedList, nullableMapWithAnnotations, nullableMapWithObject, aNullableEnum, aNullableString, aNullableObject, list, stringList, intList, doubleList, boolList, map) } } - fun toList(): List { return listOf( - aNullableBool, - aNullableInt, - aNullableInt64, - aNullableDouble, - aNullableByteArray, - aNullable4ByteArray, - aNullable8ByteArray, - aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, - aNullableEnum, - aNullableString, - aNullableObject, - list, - stringList, - intList, - doubleList, - boolList, - map, + aNullableBool, + aNullableInt, + aNullableInt64, + aNullableDouble, + aNullableByteArray, + aNullable4ByteArray, + aNullable8ByteArray, + aNullableFloatArray, + nullableNestedList, + nullableMapWithAnnotations, + nullableMapWithObject, + aNullableEnum, + aNullableString, + aNullableObject, + list, + stringList, + intList, + doubleList, + boolList, + map, ) } } @@ -354,16 +295,17 @@ data class AllNullableTypesWithoutRecursion( /** * A class for testing nested class handling. * - * This is needed to test nested nullable and non-nullable classes, `AllNullableTypes` is - * non-nullable here as it is easier to instantiate than `AllTypes` when testing doesn't require - * both (ie. testing null classes). + * This is needed to test nested nullable and non-nullable classes, + * `AllNullableTypes` is non-nullable here as it is easier to instantiate + * than `AllTypes` when testing doesn't require both (ie. testing null classes). * * Generated class from Pigeon that represents data sent in messages. */ -data class AllClassesWrapper( - val allNullableTypes: AllNullableTypes, - val allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = null, - val allTypes: AllTypes? = null +data class AllClassesWrapper ( + val allNullableTypes: AllNullableTypes, + val allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = null, + val allTypes: AllTypes? = null + ) { companion object { @Suppress("LocalVariableName") @@ -374,12 +316,11 @@ data class AllClassesWrapper( return AllClassesWrapper(allNullableTypes, allNullableTypesWithoutRecursion, allTypes) } } - fun toList(): List { return listOf( - allNullableTypes, - allNullableTypesWithoutRecursion, - allTypes, + allNullableTypes, + allNullableTypesWithoutRecursion, + allTypes, ) } } @@ -389,8 +330,10 @@ data class AllClassesWrapper( * * Generated class from Pigeon that represents data sent in messages. */ -data class TestMessage(val testList: List? = null) { +data class TestMessage ( + val testList: List? = null +) { companion object { @Suppress("LocalVariableName") fun fromList(__pigeon_list: List): TestMessage { @@ -398,22 +341,24 @@ data class TestMessage(val testList: List? = null) { return TestMessage(testList) } } - fun toList(): List { return listOf( - testList, + testList, ) } } - private open class CoreTestsPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as? List)?.let { AllTypes.fromList(it) } + return (readValue(buffer) as? List)?.let { + AllTypes.fromList(it) + } } 130.toByte() -> { - return (readValue(buffer) as? List)?.let { AllNullableTypes.fromList(it) } + return (readValue(buffer) as? List)?.let { + AllNullableTypes.fromList(it) + } } 131.toByte() -> { return (readValue(buffer) as? List)?.let { @@ -421,19 +366,24 @@ private open class CoreTestsPigeonCodec : StandardMessageCodec() { } } 132.toByte() -> { - return (readValue(buffer) as? List)?.let { AllClassesWrapper.fromList(it) } + return (readValue(buffer) as? List)?.let { + AllClassesWrapper.fromList(it) + } } 133.toByte() -> { - return (readValue(buffer) as? List)?.let { TestMessage.fromList(it) } + return (readValue(buffer) as? List)?.let { + TestMessage.fromList(it) + } } 134.toByte() -> { - return (readValue(buffer) as Int?)?.let { AnEnum.ofRaw(it) } + return (readValue(buffer) as Int?)?.let { + AnEnum.ofRaw(it) + } } else -> super.readValueOfType(type, buffer) } } - - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is AllTypes -> { stream.write(129) @@ -464,14 +414,18 @@ private open class CoreTestsPigeonCodec : StandardMessageCodec() { } } + /** - * The core interface that each host language plugin must implement in platform_test integration - * tests. + * The core interface that each host language plugin must implement in + * platform_test integration tests. * * Generated interface from Pigeon that represents a handler of messages from Flutter. */ interface HostIntegrationCoreApi { - /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ + /** + * A no-op function taking no arguments and returning no value, to sanity + * test basic calling. + */ fun noop() /** Returns the passed object, to test serialization and deserialization. */ fun echoAllTypes(everything: AllTypes): AllTypes @@ -510,29 +464,21 @@ interface HostIntegrationCoreApi { /** Returns the passed object, to test serialization and deserialization. */ fun echoAllNullableTypes(everything: AllNullableTypes?): AllNullableTypes? /** Returns the passed object, to test serialization and deserialization. */ - fun echoAllNullableTypesWithoutRecursion( - everything: AllNullableTypesWithoutRecursion? - ): AllNullableTypesWithoutRecursion? + fun echoAllNullableTypesWithoutRecursion(everything: AllNullableTypesWithoutRecursion?): AllNullableTypesWithoutRecursion? /** - * Returns the inner `aString` value from the wrapped object, to test sending of nested objects. + * Returns the inner `aString` value from the wrapped object, to test + * sending of nested objects. */ fun extractNestedNullableString(wrapper: AllClassesWrapper): String? /** - * Returns the inner `aString` value from the wrapped object, to test sending of nested objects. + * Returns the inner `aString` value from the wrapped object, to test + * sending of nested objects. */ fun createNestedNullableString(nullableString: String?): AllClassesWrapper /** Returns passed in arguments of multiple types. */ - fun sendMultipleNullableTypes( - aNullableBool: Boolean?, - aNullableInt: Long?, - aNullableString: String? - ): AllNullableTypes + fun sendMultipleNullableTypes(aNullableBool: Boolean?, aNullableInt: Long?, aNullableString: String?): AllNullableTypes /** Returns passed in arguments of multiple types. */ - fun sendMultipleNullableTypesWithoutRecursion( - aNullableBool: Boolean?, - aNullableInt: Long?, - aNullableString: String? - ): AllNullableTypesWithoutRecursion + fun sendMultipleNullableTypesWithoutRecursion(aNullableBool: Boolean?, aNullableInt: Long?, aNullableString: String?): AllNullableTypesWithoutRecursion /** Returns passed in int. */ fun echoNullableInt(aNullableInt: Long?): Long? /** Returns passed in double. */ @@ -549,15 +495,14 @@ interface HostIntegrationCoreApi { fun echoNullableList(aNullableList: List?): List? /** Returns the passed map, to test serialization and deserialization. */ fun echoNullableMap(aNullableMap: Map?): Map? - fun echoNullableEnum(anEnum: AnEnum?): AnEnum? /** Returns passed in int. */ fun echoOptionalNullableInt(aNullableInt: Long?): Long? /** Returns the passed in string. */ fun echoNamedNullableString(aNullableString: String?): String? /** - * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous - * calling. + * A no-op function taking no arguments and returning no value, to sanity + * test basic asynchronous calling. */ fun noopAsync(callback: (Result) -> Unit) /** Returns passed in int asynchronously. */ @@ -587,15 +532,9 @@ interface HostIntegrationCoreApi { /** Returns the passed object, to test async serialization and deserialization. */ fun echoAsyncAllTypes(everything: AllTypes, callback: (Result) -> Unit) /** Returns the passed object, to test serialization and deserialization. */ - fun echoAsyncNullableAllNullableTypes( - everything: AllNullableTypes?, - callback: (Result) -> Unit - ) + fun echoAsyncNullableAllNullableTypes(everything: AllNullableTypes?, callback: (Result) -> Unit) /** Returns the passed object, to test serialization and deserialization. */ - fun echoAsyncNullableAllNullableTypesWithoutRecursion( - everything: AllNullableTypesWithoutRecursion?, - callback: (Result) -> Unit - ) + fun echoAsyncNullableAllNullableTypesWithoutRecursion(everything: AllNullableTypesWithoutRecursion?, callback: (Result) -> Unit) /** Returns passed in int asynchronously. */ fun echoAsyncNullableInt(anInt: Long?, callback: (Result) -> Unit) /** Returns passed in double asynchronously. */ @@ -611,112 +550,54 @@ interface HostIntegrationCoreApi { /** Returns the passed list, to test asynchronous serialization and deserialization. */ fun echoAsyncNullableList(list: List?, callback: (Result?>) -> Unit) /** Returns the passed map, to test asynchronous serialization and deserialization. */ - fun echoAsyncNullableMap( - aMap: Map?, - callback: (Result?>) -> Unit - ) + fun echoAsyncNullableMap(aMap: Map?, callback: (Result?>) -> Unit) /** Returns the passed enum, to test asynchronous serialization and deserialization. */ fun echoAsyncNullableEnum(anEnum: AnEnum?, callback: (Result) -> Unit) - fun callFlutterNoop(callback: (Result) -> Unit) - fun callFlutterThrowError(callback: (Result) -> Unit) - fun callFlutterThrowErrorFromVoid(callback: (Result) -> Unit) - fun callFlutterEchoAllTypes(everything: AllTypes, callback: (Result) -> Unit) - - fun callFlutterEchoAllNullableTypes( - everything: AllNullableTypes?, - callback: (Result) -> Unit - ) - - fun callFlutterSendMultipleNullableTypes( - aNullableBool: Boolean?, - aNullableInt: Long?, - aNullableString: String?, - callback: (Result) -> Unit - ) - - fun callFlutterEchoAllNullableTypesWithoutRecursion( - everything: AllNullableTypesWithoutRecursion?, - callback: (Result) -> Unit - ) - - fun callFlutterSendMultipleNullableTypesWithoutRecursion( - aNullableBool: Boolean?, - aNullableInt: Long?, - aNullableString: String?, - callback: (Result) -> Unit - ) - + fun callFlutterEchoAllNullableTypes(everything: AllNullableTypes?, callback: (Result) -> Unit) + fun callFlutterSendMultipleNullableTypes(aNullableBool: Boolean?, aNullableInt: Long?, aNullableString: String?, callback: (Result) -> Unit) + fun callFlutterEchoAllNullableTypesWithoutRecursion(everything: AllNullableTypesWithoutRecursion?, callback: (Result) -> Unit) + fun callFlutterSendMultipleNullableTypesWithoutRecursion(aNullableBool: Boolean?, aNullableInt: Long?, aNullableString: String?, callback: (Result) -> Unit) fun callFlutterEchoBool(aBool: Boolean, callback: (Result) -> Unit) - fun callFlutterEchoInt(anInt: Long, callback: (Result) -> Unit) - fun callFlutterEchoDouble(aDouble: Double, callback: (Result) -> Unit) - fun callFlutterEchoString(aString: String, callback: (Result) -> Unit) - fun callFlutterEchoUint8List(list: ByteArray, callback: (Result) -> Unit) - fun callFlutterEchoList(list: List, callback: (Result>) -> Unit) - fun callFlutterEchoMap(aMap: Map, callback: (Result>) -> Unit) - fun callFlutterEchoEnum(anEnum: AnEnum, callback: (Result) -> Unit) - fun callFlutterEchoNullableBool(aBool: Boolean?, callback: (Result) -> Unit) - fun callFlutterEchoNullableInt(anInt: Long?, callback: (Result) -> Unit) - fun callFlutterEchoNullableDouble(aDouble: Double?, callback: (Result) -> Unit) - fun callFlutterEchoNullableString(aString: String?, callback: (Result) -> Unit) - fun callFlutterEchoNullableUint8List(list: ByteArray?, callback: (Result) -> Unit) - fun callFlutterEchoNullableList(list: List?, callback: (Result?>) -> Unit) - - fun callFlutterEchoNullableMap( - aMap: Map?, - callback: (Result?>) -> Unit - ) - + fun callFlutterEchoNullableMap(aMap: Map?, callback: (Result?>) -> Unit) fun callFlutterEchoNullableEnum(anEnum: AnEnum?, callback: (Result) -> Unit) - fun callFlutterSmallApiEchoString(aString: String, callback: (Result) -> Unit) companion object { /** The codec used by HostIntegrationCoreApi. */ - val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } - /** - * Sets up an instance of `HostIntegrationCoreApi` to handle messages through the - * `binaryMessenger`. - */ + val codec: MessageCodec by lazy { + CoreTestsPigeonCodec() + } + /** Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binaryMessenger`. */ @JvmOverloads - fun setUp( - binaryMessenger: BinaryMessenger, - api: HostIntegrationCoreApi?, - messageChannelSuffix: String = "" - ) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop$separatedMessageChannelSuffix", - codec) + fun setUp(binaryMessenger: BinaryMessenger, api: HostIntegrationCoreApi?, messageChannelSuffix: String = "") { + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = - try { - api.noop() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.noop() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -724,21 +605,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val everythingArg = args[0] as AllTypes - val wrapped: List = - try { - listOf(api.echoAllTypes(everythingArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoAllTypes(everythingArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -746,19 +622,14 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = - try { - listOf(api.throwError()) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.throwError()) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -766,20 +637,15 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = - try { - api.throwErrorFromVoid() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.throwErrorFromVoid() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -787,19 +653,14 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = - try { - listOf(api.throwFlutterError()) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.throwFlutterError()) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -807,21 +668,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val anIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = - try { - listOf(api.echoInt(anIntArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoInt(anIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -829,21 +685,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aDoubleArg = args[0] as Double - val wrapped: List = - try { - listOf(api.echoDouble(aDoubleArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoDouble(aDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -851,21 +702,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aBoolArg = args[0] as Boolean - val wrapped: List = - try { - listOf(api.echoBool(aBoolArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoBool(aBoolArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -873,21 +719,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aStringArg = args[0] as String - val wrapped: List = - try { - listOf(api.echoString(aStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoString(aStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -895,21 +736,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aUint8ListArg = args[0] as ByteArray - val wrapped: List = - try { - listOf(api.echoUint8List(aUint8ListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoUint8List(aUint8ListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -917,21 +753,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val anObjectArg = args[0] as Any - val wrapped: List = - try { - listOf(api.echoObject(anObjectArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoObject(anObjectArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -939,21 +770,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val listArg = args[0] as List - val wrapped: List = - try { - listOf(api.echoList(listArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoList(listArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -961,21 +787,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aMapArg = args[0] as Map - val wrapped: List = - try { - listOf(api.echoMap(aMapArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoMap(aMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -983,21 +804,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val wrapperArg = args[0] as AllClassesWrapper - val wrapped: List = - try { - listOf(api.echoClassWrapper(wrapperArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoClassWrapper(wrapperArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1005,21 +821,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val anEnumArg = args[0] as AnEnum - val wrapped: List = - try { - listOf(api.echoEnum(anEnumArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoEnum(anEnumArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1027,21 +838,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aStringArg = args[0] as String - val wrapped: List = - try { - listOf(api.echoNamedDefaultString(aStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNamedDefaultString(aStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1049,21 +855,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aDoubleArg = args[0] as Double - val wrapped: List = - try { - listOf(api.echoOptionalDefaultDouble(aDoubleArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoOptionalDefaultDouble(aDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1071,21 +872,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val anIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = - try { - listOf(api.echoRequiredInt(anIntArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoRequiredInt(anIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1093,21 +889,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val everythingArg = args[0] as AllNullableTypes? - val wrapped: List = - try { - listOf(api.echoAllNullableTypes(everythingArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoAllNullableTypes(everythingArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1115,21 +906,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val everythingArg = args[0] as AllNullableTypesWithoutRecursion? - val wrapped: List = - try { - listOf(api.echoAllNullableTypesWithoutRecursion(everythingArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoAllNullableTypesWithoutRecursion(everythingArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1137,21 +923,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val wrapperArg = args[0] as AllClassesWrapper - val wrapped: List = - try { - listOf(api.extractNestedNullableString(wrapperArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.extractNestedNullableString(wrapperArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1159,21 +940,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val nullableStringArg = args[0] as String? - val wrapped: List = - try { - listOf(api.createNestedNullableString(nullableStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.createNestedNullableString(nullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1181,26 +957,18 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableBoolArg = args[0] as Boolean? - val aNullableIntArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long? } val aNullableStringArg = args[2] as String? - val wrapped: List = - try { - listOf( - api.sendMultipleNullableTypes( - aNullableBoolArg, aNullableIntArg, aNullableStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.sendMultipleNullableTypes(aNullableBoolArg, aNullableIntArg, aNullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1208,26 +976,18 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableBoolArg = args[0] as Boolean? - val aNullableIntArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long? } val aNullableStringArg = args[2] as String? - val wrapped: List = - try { - listOf( - api.sendMultipleNullableTypesWithoutRecursion( - aNullableBoolArg, aNullableIntArg, aNullableStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.sendMultipleNullableTypesWithoutRecursion(aNullableBoolArg, aNullableIntArg, aNullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1235,22 +995,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableIntArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long? } - val wrapped: List = - try { - listOf(api.echoNullableInt(aNullableIntArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val aNullableIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long? } + val wrapped: List = try { + listOf(api.echoNullableInt(aNullableIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1258,21 +1012,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableDoubleArg = args[0] as Double? - val wrapped: List = - try { - listOf(api.echoNullableDouble(aNullableDoubleArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableDouble(aNullableDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1280,21 +1029,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableBoolArg = args[0] as Boolean? - val wrapped: List = - try { - listOf(api.echoNullableBool(aNullableBoolArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableBool(aNullableBoolArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1302,21 +1046,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableStringArg = args[0] as String? - val wrapped: List = - try { - listOf(api.echoNullableString(aNullableStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableString(aNullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1324,21 +1063,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableUint8ListArg = args[0] as ByteArray? - val wrapped: List = - try { - listOf(api.echoNullableUint8List(aNullableUint8ListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableUint8List(aNullableUint8ListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1346,21 +1080,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableObjectArg = args[0] - val wrapped: List = - try { - listOf(api.echoNullableObject(aNullableObjectArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableObject(aNullableObjectArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1368,21 +1097,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableListArg = args[0] as List? - val wrapped: List = - try { - listOf(api.echoNullableList(aNullableListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableList(aNullableListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1390,21 +1114,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableMapArg = args[0] as Map? - val wrapped: List = - try { - listOf(api.echoNullableMap(aNullableMapArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableMap(aNullableMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1412,21 +1131,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val anEnumArg = args[0] as AnEnum? - val wrapped: List = - try { - listOf(api.echoNullableEnum(anEnumArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableEnum(anEnumArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1434,22 +1148,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableIntArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long? } - val wrapped: List = - try { - listOf(api.echoOptionalNullableInt(aNullableIntArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val aNullableIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long? } + val wrapped: List = try { + listOf(api.echoOptionalNullableInt(aNullableIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1457,21 +1165,16 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableStringArg = args[0] as String? - val wrapped: List = - try { - listOf(api.echoNamedNullableString(aNullableStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNamedNullableString(aNullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1479,14 +1182,10 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.noopAsync { result: Result -> + api.noopAsync{ result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1500,11 +1199,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1524,11 +1219,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1548,11 +1239,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1572,11 +1259,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1596,11 +1279,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1620,11 +1299,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1644,11 +1319,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1668,11 +1339,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1692,11 +1359,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1716,14 +1379,10 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.throwAsyncError { result: Result -> + api.throwAsyncError{ result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1738,14 +1397,10 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.throwAsyncErrorFromVoid { result: Result -> + api.throwAsyncErrorFromVoid{ result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1759,14 +1414,10 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.throwAsyncFlutterError { result: Result -> + api.throwAsyncFlutterError{ result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1781,11 +1432,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1805,17 +1452,12 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val everythingArg = args[0] as AllNullableTypes? - api.echoAsyncNullableAllNullableTypes(everythingArg) { result: Result - -> + api.echoAsyncNullableAllNullableTypes(everythingArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1830,17 +1472,12 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val everythingArg = args[0] as AllNullableTypesWithoutRecursion? - api.echoAsyncNullableAllNullableTypesWithoutRecursion(everythingArg) { - result: Result -> + api.echoAsyncNullableAllNullableTypesWithoutRecursion(everythingArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1855,11 +1492,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1879,11 +1512,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1903,11 +1532,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1927,11 +1552,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1951,11 +1572,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1975,11 +1592,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1999,11 +1612,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2023,11 +1632,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2047,11 +1652,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2071,14 +1672,10 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.callFlutterNoop { result: Result -> + api.callFlutterNoop{ result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2092,14 +1689,10 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.callFlutterThrowError { result: Result -> + api.callFlutterThrowError{ result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2114,14 +1707,10 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.callFlutterThrowErrorFromVoid { result: Result -> + api.callFlutterThrowErrorFromVoid{ result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2135,11 +1724,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2159,17 +1744,12 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val everythingArg = args[0] as AllNullableTypes? - api.callFlutterEchoAllNullableTypes(everythingArg) { result: Result - -> + api.callFlutterEchoAllNullableTypes(everythingArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2184,46 +1764,34 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableBoolArg = args[0] as Boolean? - val aNullableIntArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long? } val aNullableStringArg = args[2] as String? - api.callFlutterSendMultipleNullableTypes( - aNullableBoolArg, aNullableIntArg, aNullableStringArg) { - result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + api.callFlutterSendMultipleNullableTypes(aNullableBoolArg, aNullableIntArg, aNullableStringArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } } } else { channel.setMessageHandler(null) } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val everythingArg = args[0] as AllNullableTypesWithoutRecursion? - api.callFlutterEchoAllNullableTypesWithoutRecursion(everythingArg) { - result: Result -> + api.callFlutterEchoAllNullableTypesWithoutRecursion(everythingArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2238,40 +1806,29 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableBoolArg = args[0] as Boolean? - val aNullableIntArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long? } val aNullableStringArg = args[2] as String? - api.callFlutterSendMultipleNullableTypesWithoutRecursion( - aNullableBoolArg, aNullableIntArg, aNullableStringArg) { - result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + api.callFlutterSendMultipleNullableTypesWithoutRecursion(aNullableBoolArg, aNullableIntArg, aNullableStringArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } } } else { channel.setMessageHandler(null) } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2291,11 +1848,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2315,11 +1868,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2339,11 +1888,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2363,11 +1908,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2387,11 +1928,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2411,11 +1948,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2435,11 +1968,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2459,11 +1988,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2483,11 +2008,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2507,11 +2028,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2531,11 +2048,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2555,11 +2068,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2579,11 +2088,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2603,11 +2108,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2627,11 +2128,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2651,11 +2148,7 @@ interface HostIntegrationCoreApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2678,25 +2171,26 @@ interface HostIntegrationCoreApi { } } /** - * The core interface that the Dart platform_test code implements for host integration tests to call - * into. + * The core interface that the Dart platform_test code implements for host + * integration tests to call into. * * Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. */ -class FlutterIntegrationCoreApi( - private val binaryMessenger: BinaryMessenger, - private val messageChannelSuffix: String = "" -) { +class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, private val messageChannelSuffix: String = "") { companion object { /** The codec used by FlutterIntegrationCoreApi. */ - val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } + val codec: MessageCodec by lazy { + CoreTestsPigeonCodec() + } } - /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ - fun noop(callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop$separatedMessageChannelSuffix" + /** + * A no-op function taking no arguments and returning no value, to sanity + * test basic calling. + */ + fun noop(callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(null) { if (it is List<*>) { @@ -2707,15 +2201,14 @@ class FlutterIntegrationCoreApi( } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Responds with an error from an async function returning a value. */ - fun throwError(callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError$separatedMessageChannelSuffix" + fun throwError(callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(null) { if (it is List<*>) { @@ -2727,15 +2220,14 @@ class FlutterIntegrationCoreApi( } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Responds with an error from an async void function. */ - fun throwErrorFromVoid(callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid$separatedMessageChannelSuffix" + fun throwErrorFromVoid(callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(null) { if (it is List<*>) { @@ -2746,45 +2238,35 @@ class FlutterIntegrationCoreApi( } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed object, to test serialization and deserialization. */ - fun echoAllTypes(everythingArg: AllTypes, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes$separatedMessageChannelSuffix" + fun echoAllTypes(everythingArg: AllTypes, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(everythingArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as AllTypes callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed object, to test serialization and deserialization. */ - fun echoAllNullableTypes( - everythingArg: AllNullableTypes?, - callback: (Result) -> Unit - ) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes$separatedMessageChannelSuffix" + fun echoAllNullableTypes(everythingArg: AllNullableTypes?, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(everythingArg)) { if (it is List<*>) { @@ -2796,7 +2278,7 @@ class FlutterIntegrationCoreApi( } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** @@ -2804,46 +2286,31 @@ class FlutterIntegrationCoreApi( * * Tests multiple-arity FlutterApi handling. */ - fun sendMultipleNullableTypes( - aNullableBoolArg: Boolean?, - aNullableIntArg: Long?, - aNullableStringArg: String?, - callback: (Result) -> Unit - ) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes$separatedMessageChannelSuffix" + fun sendMultipleNullableTypes(aNullableBoolArg: Boolean?, aNullableIntArg: Long?, aNullableStringArg: String?, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aNullableBoolArg, aNullableIntArg, aNullableStringArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as AllNullableTypes callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed object, to test serialization and deserialization. */ - fun echoAllNullableTypesWithoutRecursion( - everythingArg: AllNullableTypesWithoutRecursion?, - callback: (Result) -> Unit - ) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix" + fun echoAllNullableTypesWithoutRecursion(everythingArg: AllNullableTypesWithoutRecursion?, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(everythingArg)) { if (it is List<*>) { @@ -2855,7 +2322,7 @@ class FlutterIntegrationCoreApi( } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** @@ -2863,259 +2330,199 @@ class FlutterIntegrationCoreApi( * * Tests multiple-arity FlutterApi handling. */ - fun sendMultipleNullableTypesWithoutRecursion( - aNullableBoolArg: Boolean?, - aNullableIntArg: Long?, - aNullableStringArg: String?, - callback: (Result) -> Unit - ) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix" + fun sendMultipleNullableTypesWithoutRecursion(aNullableBoolArg: Boolean?, aNullableIntArg: Long?, aNullableStringArg: String?, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aNullableBoolArg, aNullableIntArg, aNullableStringArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as AllNullableTypesWithoutRecursion callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed boolean, to test serialization and deserialization. */ - fun echoBool(aBoolArg: Boolean, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool$separatedMessageChannelSuffix" + fun echoBool(aBoolArg: Boolean, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aBoolArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as Boolean callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed int, to test serialization and deserialization. */ - fun echoInt(anIntArg: Long, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt$separatedMessageChannelSuffix" + fun echoInt(anIntArg: Long, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(anIntArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0].let { num -> if (num is Int) num.toLong() else num as Long } callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed double, to test serialization and deserialization. */ - fun echoDouble(aDoubleArg: Double, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble$separatedMessageChannelSuffix" + fun echoDouble(aDoubleArg: Double, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aDoubleArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as Double callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed string, to test serialization and deserialization. */ - fun echoString(aStringArg: String, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString$separatedMessageChannelSuffix" + fun echoString(aStringArg: String, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aStringArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as String callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed byte list, to test serialization and deserialization. */ - fun echoUint8List(listArg: ByteArray, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List$separatedMessageChannelSuffix" + fun echoUint8List(listArg: ByteArray, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(listArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as ByteArray callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed list, to test serialization and deserialization. */ - fun echoList(listArg: List, callback: (Result>) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList$separatedMessageChannelSuffix" + fun echoList(listArg: List, callback: (Result>) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(listArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as List callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed map, to test serialization and deserialization. */ - fun echoMap(aMapArg: Map, callback: (Result>) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap$separatedMessageChannelSuffix" + fun echoMap(aMapArg: Map, callback: (Result>) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aMapArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as Map callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed enum to test serialization and deserialization. */ - fun echoEnum(anEnumArg: AnEnum, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum$separatedMessageChannelSuffix" + fun echoEnum(anEnumArg: AnEnum, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(anEnumArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as AnEnum callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed boolean, to test serialization and deserialization. */ - fun echoNullableBool(aBoolArg: Boolean?, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool$separatedMessageChannelSuffix" + fun echoNullableBool(aBoolArg: Boolean?, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aBoolArg)) { if (it is List<*>) { @@ -3127,15 +2534,14 @@ class FlutterIntegrationCoreApi( } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed int, to test serialization and deserialization. */ - fun echoNullableInt(anIntArg: Long?, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt$separatedMessageChannelSuffix" + fun echoNullableInt(anIntArg: Long?, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(anIntArg)) { if (it is List<*>) { @@ -3147,15 +2553,14 @@ class FlutterIntegrationCoreApi( } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed double, to test serialization and deserialization. */ - fun echoNullableDouble(aDoubleArg: Double?, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble$separatedMessageChannelSuffix" + fun echoNullableDouble(aDoubleArg: Double?, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aDoubleArg)) { if (it is List<*>) { @@ -3167,15 +2572,14 @@ class FlutterIntegrationCoreApi( } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed string, to test serialization and deserialization. */ - fun echoNullableString(aStringArg: String?, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString$separatedMessageChannelSuffix" + fun echoNullableString(aStringArg: String?, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aStringArg)) { if (it is List<*>) { @@ -3187,15 +2591,14 @@ class FlutterIntegrationCoreApi( } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed byte list, to test serialization and deserialization. */ - fun echoNullableUint8List(listArg: ByteArray?, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List$separatedMessageChannelSuffix" + fun echoNullableUint8List(listArg: ByteArray?, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(listArg)) { if (it is List<*>) { @@ -3207,15 +2610,14 @@ class FlutterIntegrationCoreApi( } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed list, to test serialization and deserialization. */ - fun echoNullableList(listArg: List?, callback: (Result?>) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList$separatedMessageChannelSuffix" + fun echoNullableList(listArg: List?, callback: (Result?>) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(listArg)) { if (it is List<*>) { @@ -3227,18 +2629,14 @@ class FlutterIntegrationCoreApi( } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed map, to test serialization and deserialization. */ - fun echoNullableMap( - aMapArg: Map?, - callback: (Result?>) -> Unit - ) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap$separatedMessageChannelSuffix" + fun echoNullableMap(aMapArg: Map?, callback: (Result?>) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aMapArg)) { if (it is List<*>) { @@ -3250,15 +2648,14 @@ class FlutterIntegrationCoreApi( } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed enum to test serialization and deserialization. */ - fun echoNullableEnum(anEnumArg: AnEnum?, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum$separatedMessageChannelSuffix" + fun echoNullableEnum(anEnumArg: AnEnum?, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(anEnumArg)) { if (it is List<*>) { @@ -3270,18 +2667,17 @@ class FlutterIntegrationCoreApi( } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous - * calling. + * A no-op function taking no arguments and returning no value, to sanity + * test basic asynchronous calling. */ - fun noopAsync(callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync$separatedMessageChannelSuffix" + fun noopAsync(callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(null) { if (it is List<*>) { @@ -3292,34 +2688,28 @@ class FlutterIntegrationCoreApi( } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed in generic Object asynchronously. */ - fun echoAsyncString(aStringArg: String, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString$separatedMessageChannelSuffix" + fun echoAsyncString(aStringArg: String, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aStringArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as String callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } } @@ -3333,31 +2723,23 @@ interface HostTrivialApi { companion object { /** The codec used by HostTrivialApi. */ - val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } + val codec: MessageCodec by lazy { + CoreTestsPigeonCodec() + } /** Sets up an instance of `HostTrivialApi` to handle messages through the `binaryMessenger`. */ @JvmOverloads - fun setUp( - binaryMessenger: BinaryMessenger, - api: HostTrivialApi?, - messageChannelSuffix: String = "" - ) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop$separatedMessageChannelSuffix", - codec) + fun setUp(binaryMessenger: BinaryMessenger, api: HostTrivialApi?, messageChannelSuffix: String = "") { + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = - try { - api.noop() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.noop() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3374,27 +2756,19 @@ interface HostTrivialApi { */ interface HostSmallApi { fun echo(aString: String, callback: (Result) -> Unit) - fun voidVoid(callback: (Result) -> Unit) companion object { /** The codec used by HostSmallApi. */ - val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } + val codec: MessageCodec by lazy { + CoreTestsPigeonCodec() + } /** Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. */ @JvmOverloads - fun setUp( - binaryMessenger: BinaryMessenger, - api: HostSmallApi?, - messageChannelSuffix: String = "" - ) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + fun setUp(binaryMessenger: BinaryMessenger, api: HostSmallApi?, messageChannelSuffix: String = "") { + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -3414,14 +2788,10 @@ interface HostSmallApi { } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid$separatedMessageChannelSuffix", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid$separatedMessageChannelSuffix", codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.voidVoid { result: Result -> + api.voidVoid{ result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -3442,66 +2812,51 @@ interface HostSmallApi { * * Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. */ -class FlutterSmallApi( - private val binaryMessenger: BinaryMessenger, - private val messageChannelSuffix: String = "" -) { +class FlutterSmallApi(private val binaryMessenger: BinaryMessenger, private val messageChannelSuffix: String = "") { companion object { /** The codec used by FlutterSmallApi. */ - val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } + val codec: MessageCodec by lazy { + CoreTestsPigeonCodec() + } } - - fun echoWrappedList(msgArg: TestMessage, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList$separatedMessageChannelSuffix" + fun echoWrappedList(msgArg: TestMessage, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(msgArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as TestMessage callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - - fun echoString(aStringArg: String, callback: (Result) -> Unit) { - val separatedMessageChannelSuffix = - if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString$separatedMessageChannelSuffix" + fun echoString(aStringArg: String, callback: (Result) -> Unit) +{ + val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aStringArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - FlutterError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as String callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } } diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index d460c004861d..aec0f93af621 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -22,52 +22,52 @@ private fun wrapResult(result: Any?): List { private fun wrapError(exception: Throwable): List { return if (exception is ProxyApiTestsError) { - listOf(exception.code, exception.message, exception.details) + listOf( + exception.code, + exception.message, + exception.details + ) } else { listOf( - exception.javaClass.simpleName, - exception.toString(), - "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)) + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) + ) } } private fun createConnectionError(channelName: String): ProxyApiTestsError { - return ProxyApiTestsError( - "channel-error", "Unable to establish connection on channel: '$channelName'.", "") -} + return ProxyApiTestsError("channel-error", "Unable to establish connection on channel: '$channelName'.", "")} /** * Error class for passing custom error details to Flutter via a thrown PlatformException. - * * @property code The error code. * @property message The error message. * @property details The error details. Must be a datatype supported by the api codec. */ -class ProxyApiTestsError( - val code: String, - override val message: String? = null, - val details: Any? = null +class ProxyApiTestsError ( + val code: String, + override val message: String? = null, + val details: Any? = null ) : Throwable() /** * Maintains instances used to communicate with the corresponding objects in Dart. * - * Objects stored in this container are represented by an object in Dart that is also stored in an - * InstanceManager with the same identifier. + * Objects stored in this container are represented by an object in Dart that is also stored in + * an InstanceManager with the same identifier. * * When an instance is added with an identifier, either can be used to retrieve the other. * - * Added instances are added as a weak reference and a strong reference. When the strong reference - * is removed with [remove] and the weak reference is deallocated, the - * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the - * strong reference is removed and then the identifier is retrieved with the intention to pass the - * identifier to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the - * instance is recreated. The strong reference will then need to be removed manually again. + * Added instances are added as a weak reference and a strong reference. When the strong + * reference is removed with [remove] and the weak reference is deallocated, the + * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the strong + * reference is removed and then the identifier is retrieved with the intention to pass the identifier + * to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the instance + * is recreated. The strong reference will then need to be removed manually again. */ @Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") -class ProxyApiTestsPigeonInstanceManager( - private val finalizationListener: PigeonFinalizationListener -) { - /** Interface for listening when a weak reference of an instance is removed from the manager. */ +class ProxyApiTestsPigeonInstanceManager(private val finalizationListener: PigeonFinalizationListener) { + /** Interface for listening when a weak reference of an instance is removed from the manager. */ interface PigeonFinalizationListener { fun onFinalize(identifier: Long) } @@ -93,7 +93,10 @@ class ProxyApiTestsPigeonInstanceManager( } init { - handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) + handler.postDelayed( + { releaseAllFinalizedInstances() }, + clearFinalizedWeakReferencesInterval + ) } companion object { @@ -105,20 +108,19 @@ class ProxyApiTestsPigeonInstanceManager( private const val tag = "PigeonInstanceManager" /** - * Instantiate a new manager with a listener for garbage collected weak references. + * Instantiate a new manager with a listener for garbage collected weak + * references. * * When the manager is no longer needed, [stopFinalizationListener] must be called. */ - fun create( - finalizationListener: PigeonFinalizationListener - ): ProxyApiTestsPigeonInstanceManager { + fun create(finalizationListener: PigeonFinalizationListener): ProxyApiTestsPigeonInstanceManager { return ProxyApiTestsPigeonInstanceManager(finalizationListener) } } /** - * Removes `identifier` and return its associated strongly referenced instance, if present, from - * the manager. + * Removes `identifier` and return its associated strongly referenced instance, if present, + * from the manager. */ fun remove(identifier: Long): T? { logWarningIfFinalizationListenerHasStopped() @@ -128,13 +130,15 @@ class ProxyApiTestsPigeonInstanceManager( /** * Retrieves the identifier paired with an instance, if present, otherwise `null`. * + * * If the manager contains a strong reference to `instance`, it will return the identifier * associated with `instance`. If the manager contains only a weak reference to `instance`, a new * strong reference to `instance` will be added and will need to be removed again with [remove]. * + * * If this method returns a nonnull identifier, this method also expects the Dart - * `ProxyApiTestsPigeonInstanceManager` to have, or recreate, a weak reference to the Dart - * instance the identifier is associated with. + * `ProxyApiTestsPigeonInstanceManager` to have, or recreate, a weak reference to the Dart instance the + * identifier is associated with. */ fun getIdentifierForStrongReference(instance: Any?): Long? { logWarningIfFinalizationListenerHasStopped() @@ -148,9 +152,9 @@ class ProxyApiTestsPigeonInstanceManager( /** * Adds a new instance that was instantiated from Dart. * - * The same instance can be added multiple times, but each identifier must be unique. This allows - * two objects that are equivalent (e.g. the `equals` method returns true and their hashcodes are - * equal) to both be added. + * The same instance can be added multiple times, but each identifier must be unique. This + * allows two objects that are equivalent (e.g. the `equals` method returns true and their + * hashcodes are equal) to both be added. * * [identifier] must be >= 0 and unique. */ @@ -166,9 +170,7 @@ class ProxyApiTestsPigeonInstanceManager( */ fun addHostCreatedInstance(instance: Any): Long { logWarningIfFinalizationListenerHasStopped() - require(!containsInstance(instance)) { - "Instance of ${instance.javaClass} has already been added." - } + require(!containsInstance(instance)) { "Instance of ${instance.javaClass} has already been added." } val identifier = nextIdentifier++ addInstance(instance, identifier) return identifier @@ -226,8 +228,7 @@ class ProxyApiTestsPigeonInstanceManager( return } var reference: java.lang.ref.WeakReference? - while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != - null) { + while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != null) { val identifier = weakReferencesToIdentifiers.remove(reference) if (identifier != null) { weakInstances.remove(identifier) @@ -235,7 +236,10 @@ class ProxyApiTestsPigeonInstanceManager( finalizationListener.onFinalize(identifier) } } - handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) + handler.postDelayed( + { releaseAllFinalizedInstances() }, + clearFinalizedWeakReferencesInterval + ) } private fun addInstance(instance: Any, identifier: Long) { @@ -253,43 +257,39 @@ class ProxyApiTestsPigeonInstanceManager( private fun logWarningIfFinalizationListenerHasStopped() { if (hasFinalizationListenerStopped()) { Log.w( - tag, - "The manager was used after calls to the PigeonFinalizationListener has been stopped.") + tag, + "The manager was used after calls to the PigeonFinalizationListener has been stopped." + ) } } } -/** Generated API for managing the Dart and native `PigeonInstanceManager`s. */ + +/**Generated API for managing the Dart and native `PigeonInstanceManager`s. */ private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { companion object { - /** The codec used by ProxyApiTestsPigeonInstanceManagerApi. */ - val codec: MessageCodec by lazy { StandardMessageCodec() } + /**The codec used by ProxyApiTestsPigeonInstanceManagerApi. */ + val codec: MessageCodec by lazy { + StandardMessageCodec() + } /** * Sets up an instance of `ProxyApiTestsPigeonInstanceManagerApi` to handle messages from the * `binaryMessenger`. */ - fun setUpMessageHandlers( - binaryMessenger: BinaryMessenger, - instanceManager: ProxyApiTestsPigeonInstanceManager? - ) { + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: ProxyApiTestsPigeonInstanceManager?) { run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.removeStrongReference", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.removeStrongReference", codec) if (instanceManager != null) { channel.setMessageHandler { message, reply -> val args = message as List val identifierArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = - try { - instanceManager.remove(identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + instanceManager.remove(identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -297,20 +297,15 @@ private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryM } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.clear", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.clear", codec) if (instanceManager != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = - try { - instanceManager.clear() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + instanceManager.clear() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -320,28 +315,26 @@ private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryM } } - fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.removeStrongReference" + fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) +{ + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.removeStrongReference" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } } /** - * Provides implementations for each ProxyApi implementation and provides access to resources needed - * by any implementation. + * Provides implementations for each ProxyApi implementation and provides access to resources + * needed by any implementation. */ abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { val instanceManager: ProxyApiTestsPigeonInstanceManager @@ -356,19 +349,20 @@ abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryM init { val api = ProxyApiTestsPigeonInstanceManagerApi(binaryMessenger) - instanceManager = - ProxyApiTestsPigeonInstanceManager.create( - object : ProxyApiTestsPigeonInstanceManager.PigeonFinalizationListener { - override fun onFinalize(identifier: Long) { - api.removeStrongReference(identifier) { - if (it.isFailure) { - Log.e( - "PigeonProxyApiRegistrar", - "Failed to remove Dart strong reference with identifier: $identifier") - } - } - } - }) + instanceManager = ProxyApiTestsPigeonInstanceManager.create( + object : ProxyApiTestsPigeonInstanceManager.PigeonFinalizationListener { + override fun onFinalize(identifier: Long) { + api.removeStrongReference(identifier) { + if (it.isFailure) { + Log.e( + "PigeonProxyApiRegistrar", + "Failed to remove Dart strong reference with identifier: $identifier" + ) + } + } + } + } + ) } /** * An implementation of [PigeonApiProxyApiTestClass] used to add a new Dart instance of @@ -386,7 +380,8 @@ abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryM * An implementation of [PigeonApiProxyApiInterface] used to add a new Dart instance of * `ProxyApiInterface` to the Dart `InstanceManager`. */ - open fun getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { + open fun getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface + { return PigeonApiProxyApiInterface(this) } @@ -398,14 +393,10 @@ abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryM fun setUp() { ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager) - PigeonApiProxyApiTestClass.setUpMessageHandlers( - binaryMessenger, getPigeonApiProxyApiTestClass()) - PigeonApiProxyApiSuperClass.setUpMessageHandlers( - binaryMessenger, getPigeonApiProxyApiSuperClass()) - PigeonApiClassWithApiRequirement.setUpMessageHandlers( - binaryMessenger, getPigeonApiClassWithApiRequirement()) + PigeonApiProxyApiTestClass.setUpMessageHandlers(binaryMessenger, getPigeonApiProxyApiTestClass()) + PigeonApiProxyApiSuperClass.setUpMessageHandlers(binaryMessenger, getPigeonApiProxyApiSuperClass()) + PigeonApiClassWithApiRequirement.setUpMessageHandlers(binaryMessenger, getPigeonApiClassWithApiRequirement()) } - fun tearDown() { ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null) PigeonApiProxyApiTestClass.setUpMessageHandlers(binaryMessenger, null) @@ -413,10 +404,7 @@ abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryM PigeonApiClassWithApiRequirement.setUpMessageHandlers(binaryMessenger, null) } } - -private class ProxyApiTestsPigeonProxyApiBaseCodec( - val registrar: ProxyApiTestsPigeonProxyApiRegistrar -) : ProxyApiTestsPigeonCodec() { +private class ProxyApiTestsPigeonProxyApiBaseCodec(val registrar: ProxyApiTestsPigeonProxyApiRegistrar) : ProxyApiTestsPigeonCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { @@ -429,13 +417,16 @@ private class ProxyApiTestsPigeonProxyApiBaseCodec( override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { if (value is ProxyApiTestClass) { - registrar.getPigeonApiProxyApiTestClass().pigeon_newInstance(value) {} - } else if (value is com.example.test_plugin.ProxyApiSuperClass) { - registrar.getPigeonApiProxyApiSuperClass().pigeon_newInstance(value) {} - } else if (value is ProxyApiInterface) { - registrar.getPigeonApiProxyApiInterface().pigeon_newInstance(value) {} - } else if (android.os.Build.VERSION.SDK_INT >= 25 && value is ClassWithApiRequirement) { - registrar.getPigeonApiClassWithApiRequirement().pigeon_newInstance(value) {} + registrar.getPigeonApiProxyApiTestClass().pigeon_newInstance(value) { } + } + else if (value is com.example.test_plugin.ProxyApiSuperClass) { + registrar.getPigeonApiProxyApiSuperClass().pigeon_newInstance(value) { } + } + else if (value is ProxyApiInterface) { + registrar.getPigeonApiProxyApiInterface().pigeon_newInstance(value) { } + } + else if (android.os.Build.VERSION.SDK_INT >= 25 && value is ClassWithApiRequirement) { + registrar.getPigeonApiClassWithApiRequirement().pigeon_newInstance(value) { } } when { @@ -459,18 +450,18 @@ enum class ProxyApiTestEnum(val raw: Int) { } } } - private open class ProxyApiTestsPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as Int?)?.let { ProxyApiTestEnum.ofRaw(it) } + return (readValue(buffer) as Int?)?.let { + ProxyApiTestEnum.ofRaw(it) + } } else -> super.readValueOfType(type, buffer) } } - - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is ProxyApiTestEnum -> { stream.write(129) @@ -482,55 +473,14 @@ private open class ProxyApiTestsPigeonCodec : StandardMessageCodec() { } /** - * The core ProxyApi test class that each supported host language must implement in platform_tests - * integration tests. + * The core ProxyApi test class that each supported host language must + * implement in platform_tests integration tests. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiTestClass( - open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar -) { - abstract fun pigeon_defaultConstructor( - aBool: Boolean, - anInt: Long, - aDouble: Double, - aString: String, - aUint8List: ByteArray, - aList: List, - aMap: Map, - anEnum: ProxyApiTestEnum, - aProxyApi: com.example.test_plugin.ProxyApiSuperClass, - aNullableBool: Boolean?, - aNullableInt: Long?, - aNullableDouble: Double?, - aNullableString: String?, - aNullableUint8List: ByteArray?, - aNullableList: List?, - aNullableMap: Map?, - aNullableEnum: ProxyApiTestEnum?, - aNullableProxyApi: com.example.test_plugin.ProxyApiSuperClass?, - boolParam: Boolean, - intParam: Long, - doubleParam: Double, - stringParam: String, - aUint8ListParam: ByteArray, - listParam: List, - mapParam: Map, - enumParam: ProxyApiTestEnum, - proxyApiParam: com.example.test_plugin.ProxyApiSuperClass, - nullableBoolParam: Boolean?, - nullableIntParam: Long?, - nullableDoubleParam: Double?, - nullableStringParam: String?, - nullableUint8ListParam: ByteArray?, - nullableListParam: List?, - nullableMapParam: Map?, - nullableEnumParam: ProxyApiTestEnum?, - nullableProxyApiParam: com.example.test_plugin.ProxyApiSuperClass? - ): ProxyApiTestClass - - abstract fun attachedField( - pigeon_instance: ProxyApiTestClass - ): com.example.test_plugin.ProxyApiSuperClass +abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { + abstract fun pigeon_defaultConstructor(aBool: Boolean, anInt: Long, aDouble: Double, aString: String, aUint8List: ByteArray, aList: List, aMap: Map, anEnum: ProxyApiTestEnum, aProxyApi: com.example.test_plugin.ProxyApiSuperClass, aNullableBool: Boolean?, aNullableInt: Long?, aNullableDouble: Double?, aNullableString: String?, aNullableUint8List: ByteArray?, aNullableList: List?, aNullableMap: Map?, aNullableEnum: ProxyApiTestEnum?, aNullableProxyApi: com.example.test_plugin.ProxyApiSuperClass?, boolParam: Boolean, intParam: Long, doubleParam: Double, stringParam: String, aUint8ListParam: ByteArray, listParam: List, mapParam: Map, enumParam: ProxyApiTestEnum, proxyApiParam: com.example.test_plugin.ProxyApiSuperClass, nullableBoolParam: Boolean?, nullableIntParam: Long?, nullableDoubleParam: Double?, nullableStringParam: String?, nullableUint8ListParam: ByteArray?, nullableListParam: List?, nullableMapParam: Map?, nullableEnumParam: ProxyApiTestEnum?, nullableProxyApiParam: com.example.test_plugin.ProxyApiSuperClass?): ProxyApiTestClass + + abstract fun attachedField(pigeon_instance: ProxyApiTestClass): com.example.test_plugin.ProxyApiSuperClass abstract fun staticAttachedField(): com.example.test_plugin.ProxyApiSuperClass @@ -550,9 +500,7 @@ abstract class PigeonApiProxyApiTestClass( abstract fun anEnum(pigeon_instance: ProxyApiTestClass): ProxyApiTestEnum - abstract fun aProxyApi( - pigeon_instance: ProxyApiTestClass - ): com.example.test_plugin.ProxyApiSuperClass + abstract fun aProxyApi(pigeon_instance: ProxyApiTestClass): com.example.test_plugin.ProxyApiSuperClass abstract fun aNullableBool(pigeon_instance: ProxyApiTestClass): Boolean? @@ -570,11 +518,12 @@ abstract class PigeonApiProxyApiTestClass( abstract fun aNullableEnum(pigeon_instance: ProxyApiTestClass): ProxyApiTestEnum? - abstract fun aNullableProxyApi( - pigeon_instance: ProxyApiTestClass - ): com.example.test_plugin.ProxyApiSuperClass? + abstract fun aNullableProxyApi(pigeon_instance: ProxyApiTestClass): com.example.test_plugin.ProxyApiSuperClass? - /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ + /** + * A no-op function taking no arguments and returning no value, to sanity + * test basic calling. + */ abstract fun noop(pigeon_instance: ProxyApiTestClass) /** Returns an error, to test error handling. */ @@ -607,235 +556,124 @@ abstract class PigeonApiProxyApiTestClass( /** Returns the passed list, to test serialization and deserialization. */ abstract fun echoList(pigeon_instance: ProxyApiTestClass, aList: List): List - /** Returns the passed list with ProxyApis, to test serialization and deserialization. */ - abstract fun echoProxyApiList( - pigeon_instance: ProxyApiTestClass, - aList: List - ): List + /** + * Returns the passed list with ProxyApis, to test serialization and + * deserialization. + */ + abstract fun echoProxyApiList(pigeon_instance: ProxyApiTestClass, aList: List): List /** Returns the passed map, to test serialization and deserialization. */ - abstract fun echoMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map - ): Map + abstract fun echoMap(pigeon_instance: ProxyApiTestClass, aMap: Map): Map - /** Returns the passed map with ProxyApis, to test serialization and deserialization. */ - abstract fun echoProxyApiMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map - ): Map + /** + * Returns the passed map with ProxyApis, to test serialization and + * deserialization. + */ + abstract fun echoProxyApiMap(pigeon_instance: ProxyApiTestClass, aMap: Map): Map /** Returns the passed enum to test serialization and deserialization. */ - abstract fun echoEnum( - pigeon_instance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum - ): ProxyApiTestEnum + abstract fun echoEnum(pigeon_instance: ProxyApiTestClass, anEnum: ProxyApiTestEnum): ProxyApiTestEnum /** Returns the passed ProxyApi to test serialization and deserialization. */ - abstract fun echoProxyApi( - pigeon_instance: ProxyApiTestClass, - aProxyApi: com.example.test_plugin.ProxyApiSuperClass - ): com.example.test_plugin.ProxyApiSuperClass + abstract fun echoProxyApi(pigeon_instance: ProxyApiTestClass, aProxyApi: com.example.test_plugin.ProxyApiSuperClass): com.example.test_plugin.ProxyApiSuperClass /** Returns passed in int. */ abstract fun echoNullableInt(pigeon_instance: ProxyApiTestClass, aNullableInt: Long?): Long? /** Returns passed in double. */ - abstract fun echoNullableDouble( - pigeon_instance: ProxyApiTestClass, - aNullableDouble: Double? - ): Double? + abstract fun echoNullableDouble(pigeon_instance: ProxyApiTestClass, aNullableDouble: Double?): Double? /** Returns the passed in boolean. */ - abstract fun echoNullableBool( - pigeon_instance: ProxyApiTestClass, - aNullableBool: Boolean? - ): Boolean? + abstract fun echoNullableBool(pigeon_instance: ProxyApiTestClass, aNullableBool: Boolean?): Boolean? /** Returns the passed in string. */ - abstract fun echoNullableString( - pigeon_instance: ProxyApiTestClass, - aNullableString: String? - ): String? + abstract fun echoNullableString(pigeon_instance: ProxyApiTestClass, aNullableString: String?): String? /** Returns the passed in Uint8List. */ - abstract fun echoNullableUint8List( - pigeon_instance: ProxyApiTestClass, - aNullableUint8List: ByteArray? - ): ByteArray? + abstract fun echoNullableUint8List(pigeon_instance: ProxyApiTestClass, aNullableUint8List: ByteArray?): ByteArray? /** Returns the passed in generic Object. */ abstract fun echoNullableObject(pigeon_instance: ProxyApiTestClass, aNullableObject: Any?): Any? /** Returns the passed list, to test serialization and deserialization. */ - abstract fun echoNullableList( - pigeon_instance: ProxyApiTestClass, - aNullableList: List? - ): List? + abstract fun echoNullableList(pigeon_instance: ProxyApiTestClass, aNullableList: List?): List? /** Returns the passed map, to test serialization and deserialization. */ - abstract fun echoNullableMap( - pigeon_instance: ProxyApiTestClass, - aNullableMap: Map? - ): Map? + abstract fun echoNullableMap(pigeon_instance: ProxyApiTestClass, aNullableMap: Map?): Map? - abstract fun echoNullableEnum( - pigeon_instance: ProxyApiTestClass, - aNullableEnum: ProxyApiTestEnum? - ): ProxyApiTestEnum? + abstract fun echoNullableEnum(pigeon_instance: ProxyApiTestClass, aNullableEnum: ProxyApiTestEnum?): ProxyApiTestEnum? /** Returns the passed ProxyApi to test serialization and deserialization. */ - abstract fun echoNullableProxyApi( - pigeon_instance: ProxyApiTestClass, - aNullableProxyApi: com.example.test_plugin.ProxyApiSuperClass? - ): com.example.test_plugin.ProxyApiSuperClass? + abstract fun echoNullableProxyApi(pigeon_instance: ProxyApiTestClass, aNullableProxyApi: com.example.test_plugin.ProxyApiSuperClass?): com.example.test_plugin.ProxyApiSuperClass? /** - * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous - * calling. + * A no-op function taking no arguments and returning no value, to sanity + * test basic asynchronous calling. */ abstract fun noopAsync(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) /** Returns passed in int asynchronously. */ - abstract fun echoAsyncInt( - pigeon_instance: ProxyApiTestClass, - anInt: Long, - callback: (Result) -> Unit - ) + abstract fun echoAsyncInt(pigeon_instance: ProxyApiTestClass, anInt: Long, callback: (Result) -> Unit) /** Returns passed in double asynchronously. */ - abstract fun echoAsyncDouble( - pigeon_instance: ProxyApiTestClass, - aDouble: Double, - callback: (Result) -> Unit - ) + abstract fun echoAsyncDouble(pigeon_instance: ProxyApiTestClass, aDouble: Double, callback: (Result) -> Unit) /** Returns the passed in boolean asynchronously. */ - abstract fun echoAsyncBool( - pigeon_instance: ProxyApiTestClass, - aBool: Boolean, - callback: (Result) -> Unit - ) + abstract fun echoAsyncBool(pigeon_instance: ProxyApiTestClass, aBool: Boolean, callback: (Result) -> Unit) /** Returns the passed string asynchronously. */ - abstract fun echoAsyncString( - pigeon_instance: ProxyApiTestClass, - aString: String, - callback: (Result) -> Unit - ) + abstract fun echoAsyncString(pigeon_instance: ProxyApiTestClass, aString: String, callback: (Result) -> Unit) /** Returns the passed in Uint8List asynchronously. */ - abstract fun echoAsyncUint8List( - pigeon_instance: ProxyApiTestClass, - aUint8List: ByteArray, - callback: (Result) -> Unit - ) + abstract fun echoAsyncUint8List(pigeon_instance: ProxyApiTestClass, aUint8List: ByteArray, callback: (Result) -> Unit) /** Returns the passed in generic Object asynchronously. */ - abstract fun echoAsyncObject( - pigeon_instance: ProxyApiTestClass, - anObject: Any, - callback: (Result) -> Unit - ) + abstract fun echoAsyncObject(pigeon_instance: ProxyApiTestClass, anObject: Any, callback: (Result) -> Unit) /** Returns the passed list, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncList( - pigeon_instance: ProxyApiTestClass, - aList: List, - callback: (Result>) -> Unit - ) + abstract fun echoAsyncList(pigeon_instance: ProxyApiTestClass, aList: List, callback: (Result>) -> Unit) /** Returns the passed map, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map, - callback: (Result>) -> Unit - ) + abstract fun echoAsyncMap(pigeon_instance: ProxyApiTestClass, aMap: Map, callback: (Result>) -> Unit) /** Returns the passed enum, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncEnum( - pigeon_instance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum, - callback: (Result) -> Unit - ) + abstract fun echoAsyncEnum(pigeon_instance: ProxyApiTestClass, anEnum: ProxyApiTestEnum, callback: (Result) -> Unit) /** Responds with an error from an async function returning a value. */ abstract fun throwAsyncError(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) /** Responds with an error from an async void function. */ - abstract fun throwAsyncErrorFromVoid( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit - ) + abstract fun throwAsyncErrorFromVoid(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) /** Responds with a Flutter error from an async function returning a value. */ - abstract fun throwAsyncFlutterError( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit - ) + abstract fun throwAsyncFlutterError(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) /** Returns passed in int asynchronously. */ - abstract fun echoAsyncNullableInt( - pigeon_instance: ProxyApiTestClass, - anInt: Long?, - callback: (Result) -> Unit - ) + abstract fun echoAsyncNullableInt(pigeon_instance: ProxyApiTestClass, anInt: Long?, callback: (Result) -> Unit) /** Returns passed in double asynchronously. */ - abstract fun echoAsyncNullableDouble( - pigeon_instance: ProxyApiTestClass, - aDouble: Double?, - callback: (Result) -> Unit - ) + abstract fun echoAsyncNullableDouble(pigeon_instance: ProxyApiTestClass, aDouble: Double?, callback: (Result) -> Unit) /** Returns the passed in boolean asynchronously. */ - abstract fun echoAsyncNullableBool( - pigeon_instance: ProxyApiTestClass, - aBool: Boolean?, - callback: (Result) -> Unit - ) + abstract fun echoAsyncNullableBool(pigeon_instance: ProxyApiTestClass, aBool: Boolean?, callback: (Result) -> Unit) /** Returns the passed string asynchronously. */ - abstract fun echoAsyncNullableString( - pigeon_instance: ProxyApiTestClass, - aString: String?, - callback: (Result) -> Unit - ) + abstract fun echoAsyncNullableString(pigeon_instance: ProxyApiTestClass, aString: String?, callback: (Result) -> Unit) /** Returns the passed in Uint8List asynchronously. */ - abstract fun echoAsyncNullableUint8List( - pigeon_instance: ProxyApiTestClass, - aUint8List: ByteArray?, - callback: (Result) -> Unit - ) + abstract fun echoAsyncNullableUint8List(pigeon_instance: ProxyApiTestClass, aUint8List: ByteArray?, callback: (Result) -> Unit) /** Returns the passed in generic Object asynchronously. */ - abstract fun echoAsyncNullableObject( - pigeon_instance: ProxyApiTestClass, - anObject: Any?, - callback: (Result) -> Unit - ) + abstract fun echoAsyncNullableObject(pigeon_instance: ProxyApiTestClass, anObject: Any?, callback: (Result) -> Unit) /** Returns the passed list, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncNullableList( - pigeon_instance: ProxyApiTestClass, - aList: List?, - callback: (Result?>) -> Unit - ) + abstract fun echoAsyncNullableList(pigeon_instance: ProxyApiTestClass, aList: List?, callback: (Result?>) -> Unit) /** Returns the passed map, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncNullableMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map?, - callback: (Result?>) -> Unit - ) + abstract fun echoAsyncNullableMap(pigeon_instance: ProxyApiTestClass, aMap: Map?, callback: (Result?>) -> Unit) /** Returns the passed enum, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncNullableEnum( - pigeon_instance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum?, - callback: (Result) -> Unit - ) + abstract fun echoAsyncNullableEnum(pigeon_instance: ProxyApiTestClass, anEnum: ProxyApiTestEnum?, callback: (Result) -> Unit) abstract fun staticNoop() @@ -845,162 +683,64 @@ abstract class PigeonApiProxyApiTestClass( abstract fun callFlutterNoop(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) - abstract fun callFlutterThrowError( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit - ) - - abstract fun callFlutterThrowErrorFromVoid( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoBool( - pigeon_instance: ProxyApiTestClass, - aBool: Boolean, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoInt( - pigeon_instance: ProxyApiTestClass, - anInt: Long, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoDouble( - pigeon_instance: ProxyApiTestClass, - aDouble: Double, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoString( - pigeon_instance: ProxyApiTestClass, - aString: String, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoUint8List( - pigeon_instance: ProxyApiTestClass, - aUint8List: ByteArray, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoList( - pigeon_instance: ProxyApiTestClass, - aList: List, - callback: (Result>) -> Unit - ) - - abstract fun callFlutterEchoProxyApiList( - pigeon_instance: ProxyApiTestClass, - aList: List, - callback: (Result>) -> Unit - ) - - abstract fun callFlutterEchoMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map, - callback: (Result>) -> Unit - ) - - abstract fun callFlutterEchoProxyApiMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map, - callback: (Result>) -> Unit - ) - - abstract fun callFlutterEchoEnum( - pigeon_instance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoProxyApi( - pigeon_instance: ProxyApiTestClass, - aProxyApi: com.example.test_plugin.ProxyApiSuperClass, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoNullableBool( - pigeon_instance: ProxyApiTestClass, - aBool: Boolean?, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoNullableInt( - pigeon_instance: ProxyApiTestClass, - anInt: Long?, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoNullableDouble( - pigeon_instance: ProxyApiTestClass, - aDouble: Double?, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoNullableString( - pigeon_instance: ProxyApiTestClass, - aString: String?, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoNullableUint8List( - pigeon_instance: ProxyApiTestClass, - aUint8List: ByteArray?, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoNullableList( - pigeon_instance: ProxyApiTestClass, - aList: List?, - callback: (Result?>) -> Unit - ) - - abstract fun callFlutterEchoNullableMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map?, - callback: (Result?>) -> Unit - ) - - abstract fun callFlutterEchoNullableEnum( - pigeon_instance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum?, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoNullableProxyApi( - pigeon_instance: ProxyApiTestClass, - aProxyApi: com.example.test_plugin.ProxyApiSuperClass?, - callback: (Result) -> Unit - ) - - abstract fun callFlutterNoopAsync( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoAsyncString( - pigeon_instance: ProxyApiTestClass, - aString: String, - callback: (Result) -> Unit - ) + abstract fun callFlutterThrowError(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) + + abstract fun callFlutterThrowErrorFromVoid(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) + + abstract fun callFlutterEchoBool(pigeon_instance: ProxyApiTestClass, aBool: Boolean, callback: (Result) -> Unit) + + abstract fun callFlutterEchoInt(pigeon_instance: ProxyApiTestClass, anInt: Long, callback: (Result) -> Unit) + + abstract fun callFlutterEchoDouble(pigeon_instance: ProxyApiTestClass, aDouble: Double, callback: (Result) -> Unit) + + abstract fun callFlutterEchoString(pigeon_instance: ProxyApiTestClass, aString: String, callback: (Result) -> Unit) + + abstract fun callFlutterEchoUint8List(pigeon_instance: ProxyApiTestClass, aUint8List: ByteArray, callback: (Result) -> Unit) + + abstract fun callFlutterEchoList(pigeon_instance: ProxyApiTestClass, aList: List, callback: (Result>) -> Unit) + + abstract fun callFlutterEchoProxyApiList(pigeon_instance: ProxyApiTestClass, aList: List, callback: (Result>) -> Unit) + + abstract fun callFlutterEchoMap(pigeon_instance: ProxyApiTestClass, aMap: Map, callback: (Result>) -> Unit) + + abstract fun callFlutterEchoProxyApiMap(pigeon_instance: ProxyApiTestClass, aMap: Map, callback: (Result>) -> Unit) + + abstract fun callFlutterEchoEnum(pigeon_instance: ProxyApiTestClass, anEnum: ProxyApiTestEnum, callback: (Result) -> Unit) + + abstract fun callFlutterEchoProxyApi(pigeon_instance: ProxyApiTestClass, aProxyApi: com.example.test_plugin.ProxyApiSuperClass, callback: (Result) -> Unit) + + abstract fun callFlutterEchoNullableBool(pigeon_instance: ProxyApiTestClass, aBool: Boolean?, callback: (Result) -> Unit) + + abstract fun callFlutterEchoNullableInt(pigeon_instance: ProxyApiTestClass, anInt: Long?, callback: (Result) -> Unit) + + abstract fun callFlutterEchoNullableDouble(pigeon_instance: ProxyApiTestClass, aDouble: Double?, callback: (Result) -> Unit) + + abstract fun callFlutterEchoNullableString(pigeon_instance: ProxyApiTestClass, aString: String?, callback: (Result) -> Unit) + + abstract fun callFlutterEchoNullableUint8List(pigeon_instance: ProxyApiTestClass, aUint8List: ByteArray?, callback: (Result) -> Unit) + + abstract fun callFlutterEchoNullableList(pigeon_instance: ProxyApiTestClass, aList: List?, callback: (Result?>) -> Unit) + + abstract fun callFlutterEchoNullableMap(pigeon_instance: ProxyApiTestClass, aMap: Map?, callback: (Result?>) -> Unit) + + abstract fun callFlutterEchoNullableEnum(pigeon_instance: ProxyApiTestClass, anEnum: ProxyApiTestEnum?, callback: (Result) -> Unit) + + abstract fun callFlutterEchoNullableProxyApi(pigeon_instance: ProxyApiTestClass, aProxyApi: com.example.test_plugin.ProxyApiSuperClass?, callback: (Result) -> Unit) + + abstract fun callFlutterNoopAsync(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) + + abstract fun callFlutterEchoAsyncString(pigeon_instance: ProxyApiTestClass, aString: String, callback: (Result) -> Unit) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiTestClass?) { val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_defaultConstructor", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_defaultConstructor", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val pigeon_identifierArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } val aBoolArg = args[1] as Boolean val anIntArg = args[2].let { num -> if (num is Int) num.toLong() else num as Long } val aDoubleArg = args[3] as Double @@ -1011,8 +751,7 @@ abstract class PigeonApiProxyApiTestClass( val anEnumArg = args[8] as ProxyApiTestEnum val aProxyApiArg = args[9] as com.example.test_plugin.ProxyApiSuperClass val aNullableBoolArg = args[10] as Boolean? - val aNullableIntArg = - args[11].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = args[11].let { num -> if (num is Int) num.toLong() else num as Long? } val aNullableDoubleArg = args[12] as Double? val aNullableStringArg = args[13] as String? val aNullableUint8ListArg = args[14] as ByteArray? @@ -1030,8 +769,7 @@ abstract class PigeonApiProxyApiTestClass( val enumParamArg = args[26] as ProxyApiTestEnum val proxyApiParamArg = args[27] as com.example.test_plugin.ProxyApiSuperClass val nullableBoolParamArg = args[28] as Boolean? - val nullableIntParamArg = - args[29].let { num -> if (num is Int) num.toLong() else num as Long? } + val nullableIntParamArg = args[29].let { num -> if (num is Int) num.toLong() else num as Long? } val nullableDoubleParamArg = args[30] as Double? val nullableStringParamArg = args[31] as String? val nullableUint8ListParamArg = args[32] as ByteArray? @@ -1039,51 +777,12 @@ abstract class PigeonApiProxyApiTestClass( val nullableMapParamArg = args[34] as Map? val nullableEnumParamArg = args[35] as ProxyApiTestEnum? val nullableProxyApiParamArg = args[36] as com.example.test_plugin.ProxyApiSuperClass? - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.pigeon_defaultConstructor( - aBoolArg, - anIntArg, - aDoubleArg, - aStringArg, - aUint8ListArg, - aListArg, - aMapArg, - anEnumArg, - aProxyApiArg, - aNullableBoolArg, - aNullableIntArg, - aNullableDoubleArg, - aNullableStringArg, - aNullableUint8ListArg, - aNullableListArg, - aNullableMapArg, - aNullableEnumArg, - aNullableProxyApiArg, - boolParamArg, - intParamArg, - doubleParamArg, - stringParamArg, - aUint8ListParamArg, - listParamArg, - mapParamArg, - enumParamArg, - proxyApiParamArg, - nullableBoolParamArg, - nullableIntParamArg, - nullableDoubleParamArg, - nullableStringParamArg, - nullableUint8ListParamArg, - nullableListParamArg, - nullableMapParamArg, - nullableEnumParamArg, - nullableProxyApiParamArg), - pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(aBoolArg,anIntArg,aDoubleArg,aStringArg,aUint8ListArg,aListArg,aMapArg,anEnumArg,aProxyApiArg,aNullableBoolArg,aNullableIntArg,aNullableDoubleArg,aNullableStringArg,aNullableUint8ListArg,aNullableListArg,aNullableMapArg,aNullableEnumArg,aNullableProxyApiArg,boolParamArg,intParamArg,doubleParamArg,stringParamArg,aUint8ListParamArg,listParamArg,mapParamArg,enumParamArg,proxyApiParamArg,nullableBoolParamArg,nullableIntParamArg,nullableDoubleParamArg,nullableStringParamArg,nullableUint8ListParamArg,nullableListParamArg,nullableMapParamArg,nullableEnumParamArg,nullableProxyApiParamArg), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1091,25 +790,18 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.attachedField", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.attachedField", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val pigeon_identifierArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.attachedField(pigeon_instanceArg), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val pigeon_identifierArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } + val wrapped: List = try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.attachedField(pigeon_instanceArg), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1117,24 +809,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAttachedField", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAttachedField", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.staticAttachedField(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val pigeon_identifierArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val wrapped: List = try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.staticAttachedField(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1142,22 +827,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noop", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noop", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val wrapped: List = - try { - api.noop(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.noop(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1165,21 +845,16 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwError", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwError", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val wrapped: List = - try { - listOf(api.throwError(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.throwError(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1187,22 +862,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwErrorFromVoid", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwErrorFromVoid", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val wrapped: List = - try { - api.throwErrorFromVoid(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.throwErrorFromVoid(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1210,21 +880,16 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwFlutterError", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwFlutterError", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val wrapped: List = - try { - listOf(api.throwFlutterError(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.throwFlutterError(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1232,22 +897,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoInt", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoInt", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val anIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = - try { - listOf(api.echoInt(pigeon_instanceArg, anIntArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoInt(pigeon_instanceArg, anIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1255,22 +915,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoDouble", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoDouble", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aDoubleArg = args[1] as Double - val wrapped: List = - try { - listOf(api.echoDouble(pigeon_instanceArg, aDoubleArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoDouble(pigeon_instanceArg, aDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1278,22 +933,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoBool", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoBool", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aBoolArg = args[1] as Boolean - val wrapped: List = - try { - listOf(api.echoBool(pigeon_instanceArg, aBoolArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoBool(pigeon_instanceArg, aBoolArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1301,22 +951,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoString", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoString", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aStringArg = args[1] as String - val wrapped: List = - try { - listOf(api.echoString(pigeon_instanceArg, aStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoString(pigeon_instanceArg, aStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1324,22 +969,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoUint8List", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoUint8List", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aUint8ListArg = args[1] as ByteArray - val wrapped: List = - try { - listOf(api.echoUint8List(pigeon_instanceArg, aUint8ListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoUint8List(pigeon_instanceArg, aUint8ListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1347,22 +987,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoObject", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoObject", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val anObjectArg = args[1] as Any - val wrapped: List = - try { - listOf(api.echoObject(pigeon_instanceArg, anObjectArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoObject(pigeon_instanceArg, anObjectArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1370,22 +1005,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoList", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoList", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aListArg = args[1] as List - val wrapped: List = - try { - listOf(api.echoList(pigeon_instanceArg, aListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoList(pigeon_instanceArg, aListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1393,22 +1023,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiList", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiList", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aListArg = args[1] as List - val wrapped: List = - try { - listOf(api.echoProxyApiList(pigeon_instanceArg, aListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoProxyApiList(pigeon_instanceArg, aListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1416,22 +1041,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoMap", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoMap", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aMapArg = args[1] as Map - val wrapped: List = - try { - listOf(api.echoMap(pigeon_instanceArg, aMapArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoMap(pigeon_instanceArg, aMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1439,22 +1059,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiMap", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiMap", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aMapArg = args[1] as Map - val wrapped: List = - try { - listOf(api.echoProxyApiMap(pigeon_instanceArg, aMapArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoProxyApiMap(pigeon_instanceArg, aMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1462,22 +1077,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoEnum", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoEnum", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val anEnumArg = args[1] as ProxyApiTestEnum - val wrapped: List = - try { - listOf(api.echoEnum(pigeon_instanceArg, anEnumArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoEnum(pigeon_instanceArg, anEnumArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1485,22 +1095,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApi", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApi", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass - val wrapped: List = - try { - listOf(api.echoProxyApi(pigeon_instanceArg, aProxyApiArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoProxyApi(pigeon_instanceArg, aProxyApiArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1508,23 +1113,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableInt", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableInt", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aNullableIntArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long? } - val wrapped: List = - try { - listOf(api.echoNullableInt(pigeon_instanceArg, aNullableIntArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val aNullableIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val wrapped: List = try { + listOf(api.echoNullableInt(pigeon_instanceArg, aNullableIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1532,22 +1131,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableDouble", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableDouble", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableDoubleArg = args[1] as Double? - val wrapped: List = - try { - listOf(api.echoNullableDouble(pigeon_instanceArg, aNullableDoubleArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableDouble(pigeon_instanceArg, aNullableDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1555,22 +1149,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableBool", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableBool", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableBoolArg = args[1] as Boolean? - val wrapped: List = - try { - listOf(api.echoNullableBool(pigeon_instanceArg, aNullableBoolArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableBool(pigeon_instanceArg, aNullableBoolArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1578,22 +1167,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableString", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableString", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableStringArg = args[1] as String? - val wrapped: List = - try { - listOf(api.echoNullableString(pigeon_instanceArg, aNullableStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableString(pigeon_instanceArg, aNullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1601,22 +1185,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableUint8List", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableUint8List", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableUint8ListArg = args[1] as ByteArray? - val wrapped: List = - try { - listOf(api.echoNullableUint8List(pigeon_instanceArg, aNullableUint8ListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableUint8List(pigeon_instanceArg, aNullableUint8ListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1624,22 +1203,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableObject", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableObject", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableObjectArg = args[1] - val wrapped: List = - try { - listOf(api.echoNullableObject(pigeon_instanceArg, aNullableObjectArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableObject(pigeon_instanceArg, aNullableObjectArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1647,22 +1221,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableList", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableList", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableListArg = args[1] as List? - val wrapped: List = - try { - listOf(api.echoNullableList(pigeon_instanceArg, aNullableListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableList(pigeon_instanceArg, aNullableListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1670,22 +1239,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableMap", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableMap", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableMapArg = args[1] as Map? - val wrapped: List = - try { - listOf(api.echoNullableMap(pigeon_instanceArg, aNullableMapArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableMap(pigeon_instanceArg, aNullableMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1693,22 +1257,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableEnum", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableEnum", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableEnumArg = args[1] as ProxyApiTestEnum? - val wrapped: List = - try { - listOf(api.echoNullableEnum(pigeon_instanceArg, aNullableEnumArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableEnum(pigeon_instanceArg, aNullableEnumArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1716,22 +1275,17 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableProxyApi", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableProxyApi", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass? - val wrapped: List = - try { - listOf(api.echoNullableProxyApi(pigeon_instanceArg, aNullableProxyApiArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoNullableProxyApi(pigeon_instanceArg, aNullableProxyApiArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1739,11 +1293,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noopAsync", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noopAsync", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1762,11 +1312,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncInt", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncInt", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1787,11 +1333,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncDouble", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncDouble", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1812,11 +1354,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncBool", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncBool", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1837,11 +1375,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncString", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncString", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1862,11 +1396,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncUint8List", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncUint8List", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1887,11 +1417,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncObject", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncObject", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1912,11 +1438,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncList", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncList", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1937,11 +1459,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncMap", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncMap", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1962,11 +1480,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncEnum", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncEnum", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1987,11 +1501,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncError", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncError", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2011,11 +1521,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncErrorFromVoid", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncErrorFromVoid", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2034,11 +1540,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncFlutterError", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncFlutterError", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2058,11 +1560,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableInt", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableInt", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2083,11 +1581,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableDouble", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableDouble", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2108,11 +1602,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableBool", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableBool", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2133,11 +1623,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableString", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableString", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2158,18 +1644,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableUint8List", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableUint8List", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aUint8ListArg = args[1] as ByteArray? - api.echoAsyncNullableUint8List(pigeon_instanceArg, aUint8ListArg) { - result: Result -> + api.echoAsyncNullableUint8List(pigeon_instanceArg, aUint8ListArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2184,11 +1665,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableObject", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableObject", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2209,11 +1686,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableList", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableList", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2234,18 +1707,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableMap", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableMap", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aMapArg = args[1] as Map? - api.echoAsyncNullableMap(pigeon_instanceArg, aMapArg) { - result: Result?> -> + api.echoAsyncNullableMap(pigeon_instanceArg, aMapArg) { result: Result?> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2260,18 +1728,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableEnum", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableEnum", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val anEnumArg = args[1] as ProxyApiTestEnum? - api.echoAsyncNullableEnum(pigeon_instanceArg, anEnumArg) { - result: Result -> + api.echoAsyncNullableEnum(pigeon_instanceArg, anEnumArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2286,20 +1749,15 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticNoop", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticNoop", codec) if (api != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = - try { - api.staticNoop() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.staticNoop() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2307,21 +1765,16 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoStaticString", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoStaticString", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aStringArg = args[0] as String - val wrapped: List = - try { - listOf(api.echoStaticString(aStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + listOf(api.echoStaticString(aStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2329,14 +1782,10 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAsyncNoop", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAsyncNoop", codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.staticAsyncNoop { result: Result -> + api.staticAsyncNoop{ result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2350,11 +1799,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoop", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoop", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2373,11 +1818,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowError", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowError", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2397,11 +1838,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowErrorFromVoid", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowErrorFromVoid", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2420,11 +1857,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoBool", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoBool", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2445,11 +1878,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoInt", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoInt", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2470,11 +1899,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoDouble", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoDouble", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2495,11 +1920,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoString", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoString", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2520,18 +1941,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoUint8List", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoUint8List", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aUint8ListArg = args[1] as ByteArray - api.callFlutterEchoUint8List(pigeon_instanceArg, aUint8ListArg) { - result: Result -> + api.callFlutterEchoUint8List(pigeon_instanceArg, aUint8ListArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2546,11 +1962,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoList", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoList", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2571,18 +1983,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiList", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiList", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aListArg = args[1] as List - api.callFlutterEchoProxyApiList(pigeon_instanceArg, aListArg) { - result: Result> -> + api.callFlutterEchoProxyApiList(pigeon_instanceArg, aListArg) { result: Result> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2597,18 +2004,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoMap", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoMap", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aMapArg = args[1] as Map - api.callFlutterEchoMap(pigeon_instanceArg, aMapArg) { result: Result> - -> + api.callFlutterEchoMap(pigeon_instanceArg, aMapArg) { result: Result> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2623,18 +2025,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiMap", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiMap", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aMapArg = args[1] as Map - api.callFlutterEchoProxyApiMap(pigeon_instanceArg, aMapArg) { - result: Result> -> + api.callFlutterEchoProxyApiMap(pigeon_instanceArg, aMapArg) { result: Result> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2649,18 +2046,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoEnum", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoEnum", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val anEnumArg = args[1] as ProxyApiTestEnum - api.callFlutterEchoEnum(pigeon_instanceArg, anEnumArg) { - result: Result -> + api.callFlutterEchoEnum(pigeon_instanceArg, anEnumArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2675,18 +2067,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApi", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApi", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass - api.callFlutterEchoProxyApi(pigeon_instanceArg, aProxyApiArg) { - result: Result -> + api.callFlutterEchoProxyApi(pigeon_instanceArg, aProxyApiArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2701,18 +2088,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableBool", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableBool", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aBoolArg = args[1] as Boolean? - api.callFlutterEchoNullableBool(pigeon_instanceArg, aBoolArg) { result: Result - -> + api.callFlutterEchoNullableBool(pigeon_instanceArg, aBoolArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2727,11 +2109,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableInt", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableInt", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2752,18 +2130,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableDouble", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableDouble", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aDoubleArg = args[1] as Double? - api.callFlutterEchoNullableDouble(pigeon_instanceArg, aDoubleArg) { - result: Result -> + api.callFlutterEchoNullableDouble(pigeon_instanceArg, aDoubleArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2778,18 +2151,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableString", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableString", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aStringArg = args[1] as String? - api.callFlutterEchoNullableString(pigeon_instanceArg, aStringArg) { - result: Result -> + api.callFlutterEchoNullableString(pigeon_instanceArg, aStringArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2804,18 +2172,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableUint8List", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableUint8List", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aUint8ListArg = args[1] as ByteArray? - api.callFlutterEchoNullableUint8List(pigeon_instanceArg, aUint8ListArg) { - result: Result -> + api.callFlutterEchoNullableUint8List(pigeon_instanceArg, aUint8ListArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2830,18 +2193,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableList", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableList", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aListArg = args[1] as List? - api.callFlutterEchoNullableList(pigeon_instanceArg, aListArg) { - result: Result?> -> + api.callFlutterEchoNullableList(pigeon_instanceArg, aListArg) { result: Result?> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2856,18 +2214,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableMap", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableMap", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aMapArg = args[1] as Map? - api.callFlutterEchoNullableMap(pigeon_instanceArg, aMapArg) { - result: Result?> -> + api.callFlutterEchoNullableMap(pigeon_instanceArg, aMapArg) { result: Result?> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2882,18 +2235,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableEnum", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableEnum", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val anEnumArg = args[1] as ProxyApiTestEnum? - api.callFlutterEchoNullableEnum(pigeon_instanceArg, anEnumArg) { - result: Result -> + api.callFlutterEchoNullableEnum(pigeon_instanceArg, anEnumArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2908,18 +2256,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableProxyApi", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableProxyApi", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass? - api.callFlutterEchoNullableProxyApi(pigeon_instanceArg, aProxyApiArg) { - result: Result -> + api.callFlutterEchoNullableProxyApi(pigeon_instanceArg, aProxyApiArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2934,11 +2277,7 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoopAsync", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoopAsync", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2957,18 +2296,13 @@ abstract class PigeonApiProxyApiTestClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoAsyncString", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoAsyncString", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aStringArg = args[1] as String - api.callFlutterEchoAsyncString(pigeon_instanceArg, aStringArg) { result: Result - -> + api.callFlutterEchoAsyncString(pigeon_instanceArg, aStringArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2986,14 +2320,14 @@ abstract class PigeonApiProxyApiTestClass( } @Suppress("LocalVariableName", "FunctionName") - /** Creates a Dart instance of ProxyApiTestClass and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + /**Creates a Dart instance of ProxyApiTestClass and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) +{ if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val aBoolArg = aBool(pigeon_instanceArg) val anIntArg = anInt(pigeon_instanceArg) val aDoubleArg = aDouble(pigeon_instanceArg) @@ -3014,46 +2348,27 @@ abstract class PigeonApiProxyApiTestClass( val aNullableProxyApiArg = aNullableProxyApi(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_newInstance" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send( - listOf( - pigeon_identifierArg, - aBoolArg, - anIntArg, - aDoubleArg, - aStringArg, - aUint8ListArg, - aListArg, - aMapArg, - anEnumArg, - aProxyApiArg, - aNullableBoolArg, - aNullableIntArg, - aNullableDoubleArg, - aNullableStringArg, - aNullableUint8ListArg, - aNullableListArg, - aNullableMapArg, - aNullableEnumArg, - aNullableProxyApiArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } + channel.send(listOf(pigeon_identifierArg, aBoolArg, anIntArg, aDoubleArg, aStringArg, aUint8ListArg, aListArg, aMapArg, anEnumArg, aProxyApiArg, aNullableBoolArg, aNullableIntArg, aNullableDoubleArg, aNullableStringArg, aNullableUint8ListArg, aNullableListArg, aNullableMapArg, aNullableEnumArg, aNullableProxyApiArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } } - /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ - fun flutterNoop(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + /** + * A no-op function taking no arguments and returning no value, to sanity + * test basic calling. + */ + fun flutterNoop(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoop" @@ -3061,106 +2376,83 @@ abstract class PigeonApiProxyApiTestClass( channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Responds with an error from an async function returning a value. */ - fun flutterThrowError(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + fun flutterThrowError(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowError" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowError" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Responds with an error from an async void function. */ - fun flutterThrowErrorFromVoid( - pigeon_instanceArg: ProxyApiTestClass, - callback: (Result) -> Unit - ) { + fun flutterThrowErrorFromVoid(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowErrorFromVoid" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowErrorFromVoid" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed boolean, to test serialization and deserialization. */ - fun flutterEchoBool( - pigeon_instanceArg: ProxyApiTestClass, - aBoolArg: Boolean, - callback: (Result) -> Unit - ) { + fun flutterEchoBool(pigeon_instanceArg: ProxyApiTestClass, aBoolArg: Boolean, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoBool" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoBool" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aBoolArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as Boolean callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed int, to test serialization and deserialization. */ - fun flutterEchoInt( - pigeon_instanceArg: ProxyApiTestClass, - anIntArg: Long, - callback: (Result) -> Unit - ) { + fun flutterEchoInt(pigeon_instanceArg: ProxyApiTestClass, anIntArg: Long, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoInt" @@ -3168,202 +2460,140 @@ abstract class PigeonApiProxyApiTestClass( channel.send(listOf(pigeon_instanceArg, anIntArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0].let { num -> if (num is Int) num.toLong() else num as Long } callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed double, to test serialization and deserialization. */ - fun flutterEchoDouble( - pigeon_instanceArg: ProxyApiTestClass, - aDoubleArg: Double, - callback: (Result) -> Unit - ) { + fun flutterEchoDouble(pigeon_instanceArg: ProxyApiTestClass, aDoubleArg: Double, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoDouble" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoDouble" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aDoubleArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as Double callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed string, to test serialization and deserialization. */ - fun flutterEchoString( - pigeon_instanceArg: ProxyApiTestClass, - aStringArg: String, - callback: (Result) -> Unit - ) { + fun flutterEchoString(pigeon_instanceArg: ProxyApiTestClass, aStringArg: String, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoString" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoString" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aStringArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as String callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed byte list, to test serialization and deserialization. */ - fun flutterEchoUint8List( - pigeon_instanceArg: ProxyApiTestClass, - aListArg: ByteArray, - callback: (Result) -> Unit - ) { + fun flutterEchoUint8List(pigeon_instanceArg: ProxyApiTestClass, aListArg: ByteArray, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoUint8List" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoUint8List" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aListArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as ByteArray callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed list, to test serialization and deserialization. */ - fun flutterEchoList( - pigeon_instanceArg: ProxyApiTestClass, - aListArg: List, - callback: (Result>) -> Unit - ) { + fun flutterEchoList(pigeon_instanceArg: ProxyApiTestClass, aListArg: List, callback: (Result>) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoList" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoList" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aListArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as List callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - /** Returns the passed list with ProxyApis, to test serialization and deserialization. */ - fun flutterEchoProxyApiList( - pigeon_instanceArg: ProxyApiTestClass, - aListArg: List, - callback: (Result>) -> Unit - ) { + /** + * Returns the passed list with ProxyApis, to test serialization and + * deserialization. + */ + fun flutterEchoProxyApiList(pigeon_instanceArg: ProxyApiTestClass, aListArg: List, callback: (Result>) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiList" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiList" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aListArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as List callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed map, to test serialization and deserialization. */ - fun flutterEchoMap( - pigeon_instanceArg: ProxyApiTestClass, - aMapArg: Map, - callback: (Result>) -> Unit - ) { + fun flutterEchoMap(pigeon_instanceArg: ProxyApiTestClass, aMapArg: Map, callback: (Result>) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoMap" @@ -3371,447 +2601,344 @@ abstract class PigeonApiProxyApiTestClass( channel.send(listOf(pigeon_instanceArg, aMapArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as Map callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - /** Returns the passed map with ProxyApis, to test serialization and deserialization. */ - fun flutterEchoProxyApiMap( - pigeon_instanceArg: ProxyApiTestClass, - aMapArg: Map, - callback: (Result>) -> Unit - ) { + /** + * Returns the passed map with ProxyApis, to test serialization and + * deserialization. + */ + fun flutterEchoProxyApiMap(pigeon_instanceArg: ProxyApiTestClass, aMapArg: Map, callback: (Result>) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiMap" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiMap" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aMapArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as Map callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed enum to test serialization and deserialization. */ - fun flutterEchoEnum( - pigeon_instanceArg: ProxyApiTestClass, - anEnumArg: ProxyApiTestEnum, - callback: (Result) -> Unit - ) { + fun flutterEchoEnum(pigeon_instanceArg: ProxyApiTestClass, anEnumArg: ProxyApiTestEnum, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoEnum" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoEnum" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, anEnumArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as ProxyApiTestEnum callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed ProxyApi to test serialization and deserialization. */ - fun flutterEchoProxyApi( - pigeon_instanceArg: ProxyApiTestClass, - aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass, - callback: (Result) -> Unit - ) { + fun flutterEchoProxyApi(pigeon_instanceArg: ProxyApiTestClass, aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApi" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApi" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aProxyApiArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as com.example.test_plugin.ProxyApiSuperClass callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed boolean, to test serialization and deserialization. */ - fun flutterEchoNullableBool( - pigeon_instanceArg: ProxyApiTestClass, - aBoolArg: Boolean?, - callback: (Result) -> Unit - ) { + fun flutterEchoNullableBool(pigeon_instanceArg: ProxyApiTestClass, aBoolArg: Boolean?, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableBool" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableBool" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aBoolArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as Boolean? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed int, to test serialization and deserialization. */ - fun flutterEchoNullableInt( - pigeon_instanceArg: ProxyApiTestClass, - anIntArg: Long?, - callback: (Result) -> Unit - ) { + fun flutterEchoNullableInt(pigeon_instanceArg: ProxyApiTestClass, anIntArg: Long?, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableInt" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableInt" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, anIntArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0].let { num -> if (num is Int) num.toLong() else num as Long? } callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed double, to test serialization and deserialization. */ - fun flutterEchoNullableDouble( - pigeon_instanceArg: ProxyApiTestClass, - aDoubleArg: Double?, - callback: (Result) -> Unit - ) { + fun flutterEchoNullableDouble(pigeon_instanceArg: ProxyApiTestClass, aDoubleArg: Double?, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableDouble" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableDouble" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aDoubleArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as Double? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed string, to test serialization and deserialization. */ - fun flutterEchoNullableString( - pigeon_instanceArg: ProxyApiTestClass, - aStringArg: String?, - callback: (Result) -> Unit - ) { + fun flutterEchoNullableString(pigeon_instanceArg: ProxyApiTestClass, aStringArg: String?, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableString" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableString" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aStringArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as String? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed byte list, to test serialization and deserialization. */ - fun flutterEchoNullableUint8List( - pigeon_instanceArg: ProxyApiTestClass, - aListArg: ByteArray?, - callback: (Result) -> Unit - ) { + fun flutterEchoNullableUint8List(pigeon_instanceArg: ProxyApiTestClass, aListArg: ByteArray?, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableUint8List" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableUint8List" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aListArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as ByteArray? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed list, to test serialization and deserialization. */ - fun flutterEchoNullableList( - pigeon_instanceArg: ProxyApiTestClass, - aListArg: List?, - callback: (Result?>) -> Unit - ) { + fun flutterEchoNullableList(pigeon_instanceArg: ProxyApiTestClass, aListArg: List?, callback: (Result?>) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableList" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableList" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aListArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as List? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed map, to test serialization and deserialization. */ - fun flutterEchoNullableMap( - pigeon_instanceArg: ProxyApiTestClass, - aMapArg: Map?, - callback: (Result?>) -> Unit - ) { + fun flutterEchoNullableMap(pigeon_instanceArg: ProxyApiTestClass, aMapArg: Map?, callback: (Result?>) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableMap" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableMap" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aMapArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as Map? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed enum to test serialization and deserialization. */ - fun flutterEchoNullableEnum( - pigeon_instanceArg: ProxyApiTestClass, - anEnumArg: ProxyApiTestEnum?, - callback: (Result) -> Unit - ) { + fun flutterEchoNullableEnum(pigeon_instanceArg: ProxyApiTestClass, anEnumArg: ProxyApiTestEnum?, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableEnum" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableEnum" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, anEnumArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as ProxyApiTestEnum? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed ProxyApi to test serialization and deserialization. */ - fun flutterEchoNullableProxyApi( - pigeon_instanceArg: ProxyApiTestClass, - aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass?, - callback: (Result) -> Unit - ) { + fun flutterEchoNullableProxyApi(pigeon_instanceArg: ProxyApiTestClass, aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass?, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableProxyApi" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableProxyApi" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aProxyApiArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as com.example.test_plugin.ProxyApiSuperClass? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous - * calling. + * A no-op function taking no arguments and returning no value, to sanity + * test basic asynchronous calling. */ - fun flutterNoopAsync(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + fun flutterNoopAsync(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoopAsync" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoopAsync" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed in generic Object asynchronously. */ - fun flutterEchoAsyncString( - pigeon_instanceArg: ProxyApiTestClass, - aStringArg: String, - callback: (Result) -> Unit - ) { + fun flutterEchoAsyncString(pigeon_instanceArg: ProxyApiTestClass, aStringArg: String, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoAsyncString" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoAsyncString" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aStringArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) + callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) } else { val output = it[0] as String callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } @Suppress("FunctionName") - /** An implementation of [PigeonApiProxyApiSuperClass] used to access callback methods */ - fun pigeon_getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass { + /**An implementation of [PigeonApiProxyApiSuperClass] used to access callback methods */ + fun pigeon_getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass + { return pigeonRegistrar.getPigeonApiProxyApiSuperClass() } @Suppress("FunctionName") - /** An implementation of [PigeonApiProxyApiInterface] used to access callback methods */ - fun pigeon_getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { + /**An implementation of [PigeonApiProxyApiInterface] used to access callback methods */ + fun pigeon_getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface + { return pigeonRegistrar.getPigeonApiProxyApiInterface() } + } /** ProxyApi to serve as a super class to the core ProxyApi class. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiSuperClass( - open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar -) { +abstract class PigeonApiProxyApiSuperClass(open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { abstract fun pigeon_defaultConstructor(): com.example.test_plugin.ProxyApiSuperClass abstract fun aSuperMethod(pigeon_instance: com.example.test_plugin.ProxyApiSuperClass) @@ -3821,24 +2948,17 @@ abstract class PigeonApiProxyApiSuperClass( fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiSuperClass?) { val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_defaultConstructor", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_defaultConstructor", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val pigeon_identifierArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val wrapped: List = try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3846,22 +2966,17 @@ abstract class PigeonApiProxyApiSuperClass( } } run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.aSuperMethod", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.aSuperMethod", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as com.example.test_plugin.ProxyApiSuperClass - val wrapped: List = - try { - api.aSuperMethod(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.aSuperMethod(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -3872,97 +2987,83 @@ abstract class PigeonApiProxyApiSuperClass( } @Suppress("LocalVariableName", "FunctionName") - /** Creates a Dart instance of ProxyApiSuperClass and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: com.example.test_plugin.ProxyApiSuperClass, - callback: (Result) -> Unit - ) { + /**Creates a Dart instance of ProxyApiSuperClass and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance(pigeon_instanceArg: com.example.test_plugin.ProxyApiSuperClass, callback: (Result) -> Unit) +{ if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_newInstance" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } /** ProxyApi to serve as an interface to the core ProxyApi class. */ @Suppress("UNCHECKED_CAST") -open class PigeonApiProxyApiInterface( - open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar -) { +open class PigeonApiProxyApiInterface(open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { @Suppress("LocalVariableName", "FunctionName") - /** Creates a Dart instance of ProxyApiInterface and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { + /**Creates a Dart instance of ProxyApiInterface and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) +{ if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.pigeon_newInstance" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun anInterfaceMethod(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { + fun anInterfaceMethod(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) +{ val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.anInterfaceMethod" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.anInterfaceMethod" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } -} +} @Suppress("UNCHECKED_CAST") -abstract class PigeonApiClassWithApiRequirement( - open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar -) { +abstract class PigeonApiClassWithApiRequirement(open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { @androidx.annotation.RequiresApi(api = 25) abstract fun pigeon_defaultConstructor(): ClassWithApiRequirement @@ -3971,49 +3072,38 @@ abstract class PigeonApiClassWithApiRequirement( companion object { @Suppress("LocalVariableName") - fun setUpMessageHandlers( - binaryMessenger: BinaryMessenger, - api: PigeonApiClassWithApiRequirement? - ) { + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiClassWithApiRequirement?) { val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() if (android.os.Build.VERSION.SDK_INT >= 25) { run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val pigeon_identifierArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val wrapped: List = try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { channel.setMessageHandler(null) } } - } else { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", - codec) + } else { + val channel = BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> - reply.reply( - wrapError( - UnsupportedOperationException( - "Call references class `ClassWithApiRequirement`, which requires api version 25."))) + reply.reply(wrapError(UnsupportedOperationException( + "Call references class `ClassWithApiRequirement`, which requires api version 25." + ))) } } else { channel.setMessageHandler(null) @@ -4021,40 +3111,34 @@ abstract class PigeonApiClassWithApiRequirement( } if (android.os.Build.VERSION.SDK_INT >= 25) { run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", - codec) + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ClassWithApiRequirement - val wrapped: List = - try { - api.aMethod(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = try { + api.aMethod(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { channel.setMessageHandler(null) } } - } else { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", - codec) + } else { + val channel = BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", + codec + ) if (api != null) { channel.setMessageHandler { _, reply -> - reply.reply( - wrapError( - UnsupportedOperationException( - "Call references class `ClassWithApiRequirement`, which requires api version 25."))) + reply.reply(wrapError(UnsupportedOperationException( + "Call references class `ClassWithApiRequirement`, which requires api version 25." + ))) } } else { channel.setMessageHandler(null) @@ -4064,35 +3148,30 @@ abstract class PigeonApiClassWithApiRequirement( } @Suppress("LocalVariableName", "FunctionName") - /** Creates a Dart instance of ClassWithApiRequirement and attaches it to [pigeon_instanceArg]. */ + /**Creates a Dart instance of ClassWithApiRequirement and attaches it to [pigeon_instanceArg]. */ @androidx.annotation.RequiresApi(api = 25) - fun pigeon_newInstance( - pigeon_instanceArg: ClassWithApiRequirement, - callback: (Result) -> Unit - ) { + fun pigeon_newInstance(pigeon_instanceArg: ClassWithApiRequirement, callback: (Result) -> Unit) +{ if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { Result.success(Unit) return } - val pigeon_identifierArg = - pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance" + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } + } diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift index 2b95f040b483..dcb2ad4a0ec9 100644 --- a/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift +++ b/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift @@ -30,7 +30,7 @@ final class PigeonError: Error { var localizedDescription: String { return "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" - } + } } private func wrapResult(_ result: Any?) -> [Any?] { @@ -60,9 +60,7 @@ private func wrapError(_ error: Any) -> [Any?] { } private func createConnectionError(withChannelName channelName: String) -> PigeonError { - return PigeonError( - code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", - details: "") + return PigeonError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "") } private func isNullish(_ value: Any?) -> Bool { @@ -107,10 +105,8 @@ struct AllTypes { // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ __pigeon_list: [Any?]) -> AllTypes? { let aBool = __pigeon_list[0] as! Bool - let anInt = - __pigeon_list[1] is Int64 ? __pigeon_list[1] as! Int64 : Int64(__pigeon_list[1] as! Int32) - let anInt64 = - __pigeon_list[2] is Int64 ? __pigeon_list[2] as! Int64 : Int64(__pigeon_list[2] as! Int32) + let anInt = __pigeon_list[1] is Int64 ? __pigeon_list[1] as! Int64 : Int64(__pigeon_list[1] as! Int32) + let anInt64 = __pigeon_list[2] is Int64 ? __pigeon_list[2] as! Int64 : Int64(__pigeon_list[2] as! Int32) let aDouble = __pigeon_list[3] as! Double let aByteArray = __pigeon_list[4] as! FlutterStandardTypedData let a4ByteArray = __pigeon_list[5] as! FlutterStandardTypedData @@ -246,16 +242,8 @@ class AllNullableTypes { // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ __pigeon_list: [Any?]) -> AllNullableTypes? { let aNullableBool: Bool? = nilOrValue(__pigeon_list[0]) - let aNullableInt: Int64? = - isNullish(__pigeon_list[1]) - ? nil - : (__pigeon_list[1] is Int64? - ? __pigeon_list[1] as! Int64? : Int64(__pigeon_list[1] as! Int32)) - let aNullableInt64: Int64? = - isNullish(__pigeon_list[2]) - ? nil - : (__pigeon_list[2] is Int64? - ? __pigeon_list[2] as! Int64? : Int64(__pigeon_list[2] as! Int32)) + let aNullableInt: Int64? = isNullish(__pigeon_list[1]) ? nil : (__pigeon_list[1] is Int64? ? __pigeon_list[1] as! Int64? : Int64(__pigeon_list[1] as! Int32)) + let aNullableInt64: Int64? = isNullish(__pigeon_list[2]) ? nil : (__pigeon_list[2] is Int64? ? __pigeon_list[2] as! Int64? : Int64(__pigeon_list[2] as! Int32)) let aNullableDouble: Double? = nilOrValue(__pigeon_list[3]) let aNullableByteArray: FlutterStandardTypedData? = nilOrValue(__pigeon_list[4]) let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(__pigeon_list[5]) @@ -359,16 +347,8 @@ struct AllNullableTypesWithoutRecursion { // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ __pigeon_list: [Any?]) -> AllNullableTypesWithoutRecursion? { let aNullableBool: Bool? = nilOrValue(__pigeon_list[0]) - let aNullableInt: Int64? = - isNullish(__pigeon_list[1]) - ? nil - : (__pigeon_list[1] is Int64? - ? __pigeon_list[1] as! Int64? : Int64(__pigeon_list[1] as! Int32)) - let aNullableInt64: Int64? = - isNullish(__pigeon_list[2]) - ? nil - : (__pigeon_list[2] is Int64? - ? __pigeon_list[2] as! Int64? : Int64(__pigeon_list[2] as! Int32)) + let aNullableInt: Int64? = isNullish(__pigeon_list[1]) ? nil : (__pigeon_list[1] is Int64? ? __pigeon_list[1] as! Int64? : Int64(__pigeon_list[1] as! Int32)) + let aNullableInt64: Int64? = isNullish(__pigeon_list[2]) ? nil : (__pigeon_list[2] is Int64? ? __pigeon_list[2] as! Int64? : Int64(__pigeon_list[2] as! Int32)) let aNullableDouble: Double? = nilOrValue(__pigeon_list[3]) let aNullableByteArray: FlutterStandardTypedData? = nilOrValue(__pigeon_list[4]) let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(__pigeon_list[5]) @@ -451,8 +431,7 @@ struct AllClassesWrapper { // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ __pigeon_list: [Any?]) -> AllClassesWrapper? { let allNullableTypes = __pigeon_list[0] as! AllNullableTypes - let allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = nilOrValue( - __pigeon_list[1]) + let allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = nilOrValue(__pigeon_list[1]) let allTypes: AllTypes? = nilOrValue(__pigeon_list[2]) return AllClassesWrapper( @@ -556,6 +535,7 @@ class CoreTestsPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { static let shared = CoreTestsPigeonCodec(readerWriter: CoreTestsPigeonCodecReaderWriter()) } + /// The core interface that each host language plugin must implement in /// platform_test integration tests. /// @@ -601,8 +581,7 @@ protocol HostIntegrationCoreApi { /// Returns the passed object, to test serialization and deserialization. func echo(_ everything: AllNullableTypes?) throws -> AllNullableTypes? /// Returns the passed object, to test serialization and deserialization. - func echo(_ everything: AllNullableTypesWithoutRecursion?) throws - -> AllNullableTypesWithoutRecursion? + func echo(_ everything: AllNullableTypesWithoutRecursion?) throws -> AllNullableTypesWithoutRecursion? /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. func extractNestedNullableString(from wrapper: AllClassesWrapper) throws -> String? @@ -610,13 +589,9 @@ protocol HostIntegrationCoreApi { /// sending of nested objects. func createNestedObject(with nullableString: String?) throws -> AllClassesWrapper /// Returns passed in arguments of multiple types. - func sendMultipleNullableTypes( - aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String? - ) throws -> AllNullableTypes + func sendMultipleNullableTypes(aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?) throws -> AllNullableTypes /// Returns passed in arguments of multiple types. - func sendMultipleNullableTypesWithoutRecursion( - aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String? - ) throws -> AllNullableTypesWithoutRecursion + func sendMultipleNullableTypesWithoutRecursion(aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?) throws -> AllNullableTypesWithoutRecursion /// Returns passed in int. func echo(_ aNullableInt: Int64?) throws -> Int64? /// Returns passed in double. @@ -650,16 +625,13 @@ protocol HostIntegrationCoreApi { /// Returns the passed string asynchronously. func echoAsync(_ aString: String, completion: @escaping (Result) -> Void) /// Returns the passed in Uint8List asynchronously. - func echoAsync( - _ aUint8List: FlutterStandardTypedData, - completion: @escaping (Result) -> Void) + func echoAsync(_ aUint8List: FlutterStandardTypedData, completion: @escaping (Result) -> Void) /// Returns the passed in generic Object asynchronously. func echoAsync(_ anObject: Any, completion: @escaping (Result) -> Void) /// Returns the passed list, to test asynchronous serialization and deserialization. func echoAsync(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsync( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) + func echoAsync(_ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. func echoAsync(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) /// Responds with an error from an async function returning a value. @@ -671,13 +643,9 @@ protocol HostIntegrationCoreApi { /// Returns the passed object, to test async serialization and deserialization. func echoAsync(_ everything: AllTypes, completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echoAsync( - _ everything: AllNullableTypes?, - completion: @escaping (Result) -> Void) + func echoAsync(_ everything: AllNullableTypes?, completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echoAsync( - _ everything: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void) + func echoAsync(_ everything: AllNullableTypesWithoutRecursion?, completion: @escaping (Result) -> Void) /// Returns passed in int asynchronously. func echoAsyncNullable(_ anInt: Int64?, completion: @escaping (Result) -> Void) /// Returns passed in double asynchronously. @@ -687,81 +655,51 @@ protocol HostIntegrationCoreApi { /// Returns the passed string asynchronously. func echoAsyncNullable(_ aString: String?, completion: @escaping (Result) -> Void) /// Returns the passed in Uint8List asynchronously. - func echoAsyncNullable( - _ aUint8List: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void) + func echoAsyncNullable(_ aUint8List: FlutterStandardTypedData?, completion: @escaping (Result) -> Void) /// Returns the passed in generic Object asynchronously. func echoAsyncNullable(_ anObject: Any?, completion: @escaping (Result) -> Void) /// Returns the passed list, to test asynchronous serialization and deserialization. func echoAsyncNullable(_ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsyncNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + func echoAsyncNullable(_ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. func echoAsyncNullable(_ anEnum: AnEnum?, completion: @escaping (Result) -> Void) func callFlutterNoop(completion: @escaping (Result) -> Void) func callFlutterThrowError(completion: @escaping (Result) -> Void) func callFlutterThrowErrorFromVoid(completion: @escaping (Result) -> Void) - func callFlutterEcho( - _ everything: AllTypes, completion: @escaping (Result) -> Void) - func callFlutterEcho( - _ everything: AllNullableTypes?, - completion: @escaping (Result) -> Void) - func callFlutterSendMultipleNullableTypes( - aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, - completion: @escaping (Result) -> Void) - func callFlutterEcho( - _ everything: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void) - func callFlutterSendMultipleNullableTypesWithoutRecursion( - aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, - completion: @escaping (Result) -> Void) + func callFlutterEcho(_ everything: AllTypes, completion: @escaping (Result) -> Void) + func callFlutterEcho(_ everything: AllNullableTypes?, completion: @escaping (Result) -> Void) + func callFlutterSendMultipleNullableTypes(aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, completion: @escaping (Result) -> Void) + func callFlutterEcho(_ everything: AllNullableTypesWithoutRecursion?, completion: @escaping (Result) -> Void) + func callFlutterSendMultipleNullableTypesWithoutRecursion(aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, completion: @escaping (Result) -> Void) func callFlutterEcho(_ aBool: Bool, completion: @escaping (Result) -> Void) func callFlutterEcho(_ anInt: Int64, completion: @escaping (Result) -> Void) func callFlutterEcho(_ aDouble: Double, completion: @escaping (Result) -> Void) func callFlutterEcho(_ aString: String, completion: @escaping (Result) -> Void) - func callFlutterEcho( - _ list: FlutterStandardTypedData, - completion: @escaping (Result) -> Void) + func callFlutterEcho(_ list: FlutterStandardTypedData, completion: @escaping (Result) -> Void) func callFlutterEcho(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) - func callFlutterEcho( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) + func callFlutterEcho(_ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) func callFlutterEcho(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) func callFlutterEchoNullable(_ aBool: Bool?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable( - _ anInt: Int64?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable( - _ aDouble: Double?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable( - _ aString: String?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable( - _ list: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void) - func callFlutterEchoNullable( - _ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) - func callFlutterEchoNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) - func callFlutterNullableEcho( - _ anEnum: AnEnum?, completion: @escaping (Result) -> Void) - func callFlutterSmallApiEcho( - _ aString: String, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable(_ anInt: Int64?, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable(_ aDouble: Double?, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable(_ aString: String?, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable(_ list: FlutterStandardTypedData?, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable(_ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) + func callFlutterEchoNullable(_ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + func callFlutterNullableEcho(_ anEnum: AnEnum?, completion: @escaping (Result) -> Void) + func callFlutterSmallApiEcho(_ aString: String, completion: @escaping (Result) -> Void) } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. class HostIntegrationCoreApiSetup { static var codec: FlutterStandardMessageCodec { CoreTestsPigeonCodec.shared } /// Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binaryMessenger`. - static func setUp( - binaryMessenger: FlutterBinaryMessenger, api: HostIntegrationCoreApi?, - messageChannelSuffix: String = "" - ) { + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: HostIntegrationCoreApi?, messageChannelSuffix: String = "") { let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. - let noopChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let noopChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { noopChannel.setMessageHandler { _, reply in do { @@ -775,10 +713,7 @@ class HostIntegrationCoreApiSetup { noopChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAllTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAllTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAllTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -794,10 +729,7 @@ class HostIntegrationCoreApiSetup { echoAllTypesChannel.setMessageHandler(nil) } /// Returns an error, to test error handling. - let throwErrorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let throwErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwErrorChannel.setMessageHandler { _, reply in do { @@ -811,10 +743,7 @@ class HostIntegrationCoreApiSetup { throwErrorChannel.setMessageHandler(nil) } /// Returns an error from a void function, to test error handling. - let throwErrorFromVoidChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let throwErrorFromVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwErrorFromVoidChannel.setMessageHandler { _, reply in do { @@ -828,10 +757,7 @@ class HostIntegrationCoreApiSetup { throwErrorFromVoidChannel.setMessageHandler(nil) } /// Returns a Flutter error, to test error handling. - let throwFlutterErrorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let throwFlutterErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwFlutterErrorChannel.setMessageHandler { _, reply in do { @@ -845,10 +771,7 @@ class HostIntegrationCoreApiSetup { throwFlutterErrorChannel.setMessageHandler(nil) } /// Returns passed in int. - let echoIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -864,10 +787,7 @@ class HostIntegrationCoreApiSetup { echoIntChannel.setMessageHandler(nil) } /// Returns passed in double. - let echoDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -883,10 +803,7 @@ class HostIntegrationCoreApiSetup { echoDoubleChannel.setMessageHandler(nil) } /// Returns the passed in boolean. - let echoBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -902,10 +819,7 @@ class HostIntegrationCoreApiSetup { echoBoolChannel.setMessageHandler(nil) } /// Returns the passed in string. - let echoStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -921,10 +835,7 @@ class HostIntegrationCoreApiSetup { echoStringChannel.setMessageHandler(nil) } /// Returns the passed in Uint8List. - let echoUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -940,10 +851,7 @@ class HostIntegrationCoreApiSetup { echoUint8ListChannel.setMessageHandler(nil) } /// Returns the passed in generic Object. - let echoObjectChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoObjectChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoObjectChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -959,10 +867,7 @@ class HostIntegrationCoreApiSetup { echoObjectChannel.setMessageHandler(nil) } /// Returns the passed list, to test serialization and deserialization. - let echoListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -978,10 +883,7 @@ class HostIntegrationCoreApiSetup { echoListChannel.setMessageHandler(nil) } /// Returns the passed map, to test serialization and deserialization. - let echoMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -997,10 +899,7 @@ class HostIntegrationCoreApiSetup { echoMapChannel.setMessageHandler(nil) } /// Returns the passed map to test nested class serialization and deserialization. - let echoClassWrapperChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoClassWrapperChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoClassWrapperChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1016,10 +915,7 @@ class HostIntegrationCoreApiSetup { echoClassWrapperChannel.setMessageHandler(nil) } /// Returns the passed enum to test serialization and deserialization. - let echoEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1035,10 +931,7 @@ class HostIntegrationCoreApiSetup { echoEnumChannel.setMessageHandler(nil) } /// Returns the default string. - let echoNamedDefaultStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNamedDefaultStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNamedDefaultStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1054,10 +947,7 @@ class HostIntegrationCoreApiSetup { echoNamedDefaultStringChannel.setMessageHandler(nil) } /// Returns passed in double. - let echoOptionalDefaultDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoOptionalDefaultDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoOptionalDefaultDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1073,10 +963,7 @@ class HostIntegrationCoreApiSetup { echoOptionalDefaultDoubleChannel.setMessageHandler(nil) } /// Returns passed in int. - let echoRequiredIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoRequiredIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoRequiredIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1092,10 +979,7 @@ class HostIntegrationCoreApiSetup { echoRequiredIntChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAllNullableTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAllNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAllNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1111,10 +995,7 @@ class HostIntegrationCoreApiSetup { echoAllNullableTypesChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAllNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1131,10 +1012,7 @@ class HostIntegrationCoreApiSetup { } /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. - let extractNestedNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let extractNestedNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { extractNestedNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1151,10 +1029,7 @@ class HostIntegrationCoreApiSetup { } /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. - let createNestedNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let createNestedNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { createNestedNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1170,21 +1045,15 @@ class HostIntegrationCoreApiSetup { createNestedNullableStringChannel.setMessageHandler(nil) } /// Returns passed in arguments of multiple types. - let sendMultipleNullableTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let sendMultipleNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { sendMultipleNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = - isNullish(args[1]) - ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = isNullish(args[1]) ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) let aNullableStringArg: String? = nilOrValue(args[2]) do { - let result = try api.sendMultipleNullableTypes( - aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) + let result = try api.sendMultipleNullableTypes(aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1194,21 +1063,15 @@ class HostIntegrationCoreApiSetup { sendMultipleNullableTypesChannel.setMessageHandler(nil) } /// Returns passed in arguments of multiple types. - let sendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let sendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { sendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = - isNullish(args[1]) - ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = isNullish(args[1]) ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) let aNullableStringArg: String? = nilOrValue(args[2]) do { - let result = try api.sendMultipleNullableTypesWithoutRecursion( - aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) + let result = try api.sendMultipleNullableTypesWithoutRecursion(aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1218,16 +1081,11 @@ class HostIntegrationCoreApiSetup { sendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler(nil) } /// Returns passed in int. - let echoNullableIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aNullableIntArg: Int64? = - isNullish(args[0]) - ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let aNullableIntArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) do { let result = try api.echo(aNullableIntArg) reply(wrapResult(result)) @@ -1239,10 +1097,7 @@ class HostIntegrationCoreApiSetup { echoNullableIntChannel.setMessageHandler(nil) } /// Returns passed in double. - let echoNullableDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1258,10 +1113,7 @@ class HostIntegrationCoreApiSetup { echoNullableDoubleChannel.setMessageHandler(nil) } /// Returns the passed in boolean. - let echoNullableBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1277,10 +1129,7 @@ class HostIntegrationCoreApiSetup { echoNullableBoolChannel.setMessageHandler(nil) } /// Returns the passed in string. - let echoNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1296,10 +1145,7 @@ class HostIntegrationCoreApiSetup { echoNullableStringChannel.setMessageHandler(nil) } /// Returns the passed in Uint8List. - let echoNullableUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1315,10 +1161,7 @@ class HostIntegrationCoreApiSetup { echoNullableUint8ListChannel.setMessageHandler(nil) } /// Returns the passed in generic Object. - let echoNullableObjectChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableObjectChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableObjectChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1334,10 +1177,7 @@ class HostIntegrationCoreApiSetup { echoNullableObjectChannel.setMessageHandler(nil) } /// Returns the passed list, to test serialization and deserialization. - let echoNullableListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1353,10 +1193,7 @@ class HostIntegrationCoreApiSetup { echoNullableListChannel.setMessageHandler(nil) } /// Returns the passed map, to test serialization and deserialization. - let echoNullableMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1371,10 +1208,7 @@ class HostIntegrationCoreApiSetup { } else { echoNullableMapChannel.setMessageHandler(nil) } - let echoNullableEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1390,16 +1224,11 @@ class HostIntegrationCoreApiSetup { echoNullableEnumChannel.setMessageHandler(nil) } /// Returns passed in int. - let echoOptionalNullableIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoOptionalNullableIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoOptionalNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aNullableIntArg: Int64? = - isNullish(args[0]) - ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let aNullableIntArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) do { let result = try api.echoOptional(aNullableIntArg) reply(wrapResult(result)) @@ -1411,10 +1240,7 @@ class HostIntegrationCoreApiSetup { echoOptionalNullableIntChannel.setMessageHandler(nil) } /// Returns the passed in string. - let echoNamedNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNamedNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNamedNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1431,10 +1257,7 @@ class HostIntegrationCoreApiSetup { } /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. - let noopAsyncChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let noopAsyncChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { noopAsyncChannel.setMessageHandler { _, reply in api.noopAsync { result in @@ -1450,10 +1273,7 @@ class HostIntegrationCoreApiSetup { noopAsyncChannel.setMessageHandler(nil) } /// Returns passed in int asynchronously. - let echoAsyncIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1471,10 +1291,7 @@ class HostIntegrationCoreApiSetup { echoAsyncIntChannel.setMessageHandler(nil) } /// Returns passed in double asynchronously. - let echoAsyncDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1492,10 +1309,7 @@ class HostIntegrationCoreApiSetup { echoAsyncDoubleChannel.setMessageHandler(nil) } /// Returns the passed in boolean asynchronously. - let echoAsyncBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1513,10 +1327,7 @@ class HostIntegrationCoreApiSetup { echoAsyncBoolChannel.setMessageHandler(nil) } /// Returns the passed string asynchronously. - let echoAsyncStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1534,10 +1345,7 @@ class HostIntegrationCoreApiSetup { echoAsyncStringChannel.setMessageHandler(nil) } /// Returns the passed in Uint8List asynchronously. - let echoAsyncUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1555,10 +1363,7 @@ class HostIntegrationCoreApiSetup { echoAsyncUint8ListChannel.setMessageHandler(nil) } /// Returns the passed in generic Object asynchronously. - let echoAsyncObjectChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncObjectChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncObjectChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1576,10 +1381,7 @@ class HostIntegrationCoreApiSetup { echoAsyncObjectChannel.setMessageHandler(nil) } /// Returns the passed list, to test asynchronous serialization and deserialization. - let echoAsyncListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1597,10 +1399,7 @@ class HostIntegrationCoreApiSetup { echoAsyncListChannel.setMessageHandler(nil) } /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1618,10 +1417,7 @@ class HostIntegrationCoreApiSetup { echoAsyncMapChannel.setMessageHandler(nil) } /// Returns the passed enum, to test asynchronous serialization and deserialization. - let echoAsyncEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1639,10 +1435,7 @@ class HostIntegrationCoreApiSetup { echoAsyncEnumChannel.setMessageHandler(nil) } /// Responds with an error from an async function returning a value. - let throwAsyncErrorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let throwAsyncErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwAsyncErrorChannel.setMessageHandler { _, reply in api.throwAsyncError { result in @@ -1658,10 +1451,7 @@ class HostIntegrationCoreApiSetup { throwAsyncErrorChannel.setMessageHandler(nil) } /// Responds with an error from an async void function. - let throwAsyncErrorFromVoidChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let throwAsyncErrorFromVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwAsyncErrorFromVoidChannel.setMessageHandler { _, reply in api.throwAsyncErrorFromVoid { result in @@ -1677,10 +1467,7 @@ class HostIntegrationCoreApiSetup { throwAsyncErrorFromVoidChannel.setMessageHandler(nil) } /// Responds with a Flutter error from an async function returning a value. - let throwAsyncFlutterErrorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let throwAsyncFlutterErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwAsyncFlutterErrorChannel.setMessageHandler { _, reply in api.throwAsyncFlutterError { result in @@ -1696,10 +1483,7 @@ class HostIntegrationCoreApiSetup { throwAsyncFlutterErrorChannel.setMessageHandler(nil) } /// Returns the passed object, to test async serialization and deserialization. - let echoAsyncAllTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncAllTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncAllTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1717,10 +1501,7 @@ class HostIntegrationCoreApiSetup { echoAsyncAllTypesChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAsyncNullableAllNullableTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableAllNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableAllNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1738,10 +1519,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableAllNullableTypesChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAsyncNullableAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableAllNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1759,16 +1537,11 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableAllNullableTypesWithoutRecursionChannel.setMessageHandler(nil) } /// Returns passed in int asynchronously. - let echoAsyncNullableIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg: Int64? = - isNullish(args[0]) - ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let anIntArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) api.echoAsyncNullable(anIntArg) { result in switch result { case .success(let res): @@ -1782,10 +1555,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableIntChannel.setMessageHandler(nil) } /// Returns passed in double asynchronously. - let echoAsyncNullableDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1803,10 +1573,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableDoubleChannel.setMessageHandler(nil) } /// Returns the passed in boolean asynchronously. - let echoAsyncNullableBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1824,10 +1591,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableBoolChannel.setMessageHandler(nil) } /// Returns the passed string asynchronously. - let echoAsyncNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1845,10 +1609,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableStringChannel.setMessageHandler(nil) } /// Returns the passed in Uint8List asynchronously. - let echoAsyncNullableUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1866,10 +1627,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableUint8ListChannel.setMessageHandler(nil) } /// Returns the passed in generic Object asynchronously. - let echoAsyncNullableObjectChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableObjectChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableObjectChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1887,10 +1645,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableObjectChannel.setMessageHandler(nil) } /// Returns the passed list, to test asynchronous serialization and deserialization. - let echoAsyncNullableListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1908,10 +1663,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableListChannel.setMessageHandler(nil) } /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncNullableMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1929,10 +1681,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableMapChannel.setMessageHandler(nil) } /// Returns the passed enum, to test asynchronous serialization and deserialization. - let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1949,10 +1698,7 @@ class HostIntegrationCoreApiSetup { } else { echoAsyncNullableEnumChannel.setMessageHandler(nil) } - let callFlutterNoopChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterNoopChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterNoopChannel.setMessageHandler { _, reply in api.callFlutterNoop { result in @@ -1967,10 +1713,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterNoopChannel.setMessageHandler(nil) } - let callFlutterThrowErrorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterThrowErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterThrowErrorChannel.setMessageHandler { _, reply in api.callFlutterThrowError { result in @@ -1985,10 +1728,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterThrowErrorChannel.setMessageHandler(nil) } - let callFlutterThrowErrorFromVoidChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterThrowErrorFromVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterThrowErrorFromVoidChannel.setMessageHandler { _, reply in api.callFlutterThrowErrorFromVoid { result in @@ -2003,10 +1743,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterThrowErrorFromVoidChannel.setMessageHandler(nil) } - let callFlutterEchoAllTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoAllTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoAllTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2023,10 +1760,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoAllTypesChannel.setMessageHandler(nil) } - let callFlutterEchoAllNullableTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoAllNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoAllNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2043,21 +1777,14 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoAllNullableTypesChannel.setMessageHandler(nil) } - let callFlutterSendMultipleNullableTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterSendMultipleNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterSendMultipleNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = - isNullish(args[1]) - ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = isNullish(args[1]) ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) let aNullableStringArg: String? = nilOrValue(args[2]) - api.callFlutterSendMultipleNullableTypes( - aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg - ) { result in + api.callFlutterSendMultipleNullableTypes(aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2069,10 +1796,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterSendMultipleNullableTypesChannel.setMessageHandler(nil) } - let callFlutterEchoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoAllNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2089,22 +1813,14 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoAllNullableTypesWithoutRecursionChannel.setMessageHandler(nil) } - let callFlutterSendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterSendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterSendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler { - message, reply in + callFlutterSendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = - isNullish(args[1]) - ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = isNullish(args[1]) ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) let aNullableStringArg: String? = nilOrValue(args[2]) - api.callFlutterSendMultipleNullableTypesWithoutRecursion( - aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg - ) { result in + api.callFlutterSendMultipleNullableTypesWithoutRecursion(aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2116,10 +1832,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterSendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler(nil) } - let callFlutterEchoBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2136,10 +1849,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoBoolChannel.setMessageHandler(nil) } - let callFlutterEchoIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2156,10 +1866,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoIntChannel.setMessageHandler(nil) } - let callFlutterEchoDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2176,10 +1883,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoDoubleChannel.setMessageHandler(nil) } - let callFlutterEchoStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2196,10 +1900,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoStringChannel.setMessageHandler(nil) } - let callFlutterEchoUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2216,10 +1917,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoUint8ListChannel.setMessageHandler(nil) } - let callFlutterEchoListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2236,10 +1934,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoListChannel.setMessageHandler(nil) } - let callFlutterEchoMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2256,10 +1951,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoMapChannel.setMessageHandler(nil) } - let callFlutterEchoEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2276,10 +1968,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoEnumChannel.setMessageHandler(nil) } - let callFlutterEchoNullableBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2296,16 +1985,11 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableBoolChannel.setMessageHandler(nil) } - let callFlutterEchoNullableIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg: Int64? = - isNullish(args[0]) - ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let anIntArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) api.callFlutterEchoNullable(anIntArg) { result in switch result { case .success(let res): @@ -2318,10 +2002,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableIntChannel.setMessageHandler(nil) } - let callFlutterEchoNullableDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2338,10 +2019,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableDoubleChannel.setMessageHandler(nil) } - let callFlutterEchoNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2358,10 +2036,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableStringChannel.setMessageHandler(nil) } - let callFlutterEchoNullableUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2378,10 +2053,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableUint8ListChannel.setMessageHandler(nil) } - let callFlutterEchoNullableListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2398,10 +2070,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableListChannel.setMessageHandler(nil) } - let callFlutterEchoNullableMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2418,10 +2087,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2438,10 +2104,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableEnumChannel.setMessageHandler(nil) } - let callFlutterSmallApiEchoStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterSmallApiEchoStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterSmallApiEchoStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2473,30 +2136,19 @@ protocol FlutterIntegrationCoreApiProtocol { /// Responds with an error from an async void function. func throwErrorFromVoid(completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echo( - _ everythingArg: AllTypes, completion: @escaping (Result) -> Void) + func echo(_ everythingArg: AllTypes, completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echoNullable( - _ everythingArg: AllNullableTypes?, - completion: @escaping (Result) -> Void) + func echoNullable(_ everythingArg: AllNullableTypes?, completion: @escaping (Result) -> Void) /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypes( - aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, - aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void) + func sendMultipleNullableTypes(aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echoNullable( - _ everythingArg: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void) + func echoNullable(_ everythingArg: AllNullableTypesWithoutRecursion?, completion: @escaping (Result) -> Void) /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypesWithoutRecursion( - aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, - aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void) + func sendMultipleNullableTypesWithoutRecursion(aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, completion: @escaping (Result) -> Void) /// Returns the passed boolean, to test serialization and deserialization. func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) /// Returns the passed int, to test serialization and deserialization. @@ -2506,15 +2158,11 @@ protocol FlutterIntegrationCoreApiProtocol { /// Returns the passed string, to test serialization and deserialization. func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) /// Returns the passed byte list, to test serialization and deserialization. - func echo( - _ listArg: FlutterStandardTypedData, - completion: @escaping (Result) -> Void) + func echo(_ listArg: FlutterStandardTypedData, completion: @escaping (Result) -> Void) /// Returns the passed list, to test serialization and deserialization. func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) /// Returns the passed map, to test serialization and deserialization. - func echo( - _ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void - ) + func echo(_ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void) /// Returns the passed enum to test serialization and deserialization. func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) /// Returns the passed boolean, to test serialization and deserialization. @@ -2522,25 +2170,17 @@ protocol FlutterIntegrationCoreApiProtocol { /// Returns the passed int, to test serialization and deserialization. func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) /// Returns the passed double, to test serialization and deserialization. - func echoNullable( - _ aDoubleArg: Double?, completion: @escaping (Result) -> Void) + func echoNullable(_ aDoubleArg: Double?, completion: @escaping (Result) -> Void) /// Returns the passed string, to test serialization and deserialization. - func echoNullable( - _ aStringArg: String?, completion: @escaping (Result) -> Void) + func echoNullable(_ aStringArg: String?, completion: @escaping (Result) -> Void) /// Returns the passed byte list, to test serialization and deserialization. - func echoNullable( - _ listArg: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void) + func echoNullable(_ listArg: FlutterStandardTypedData?, completion: @escaping (Result) -> Void) /// Returns the passed list, to test serialization and deserialization. - func echoNullable( - _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) + func echoNullable(_ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - _ aMapArg: [String?: Any?]?, - completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void) + func echoNullable(_ aMapArg: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void) /// Returns the passed enum to test serialization and deserialization. - func echoNullable( - _ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) + func echoNullable(_ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. func noopAsync(completion: @escaping (Result) -> Void) @@ -2560,10 +2200,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. func noop(completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2581,10 +2219,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Responds with an error from an async function returning a value. func throwError(completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2603,10 +2239,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Responds with an error from an async void function. func throwErrorFromVoid(completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2623,13 +2257,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed object, to test serialization and deserialization. - func echo( - _ everythingArg: AllTypes, completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo(_ everythingArg: AllTypes, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([everythingArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2641,11 +2271,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! AllTypes completion(.success(result)) @@ -2653,14 +2279,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed object, to test serialization and deserialization. - func echoNullable( - _ everythingArg: AllNullableTypes?, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ everythingArg: AllNullableTypes?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([everythingArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2680,17 +2301,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypes( - aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, - aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { - response in + func sendMultipleNullableTypes(aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2701,11 +2315,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! AllNullableTypes completion(.success(result)) @@ -2713,14 +2323,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed object, to test serialization and deserialization. - func echoNullable( - _ everythingArg: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ everythingArg: AllNullableTypesWithoutRecursion?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([everythingArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2740,17 +2345,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypesWithoutRecursion( - aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, - aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { - response in + func sendMultipleNullableTypesWithoutRecursion(aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2761,11 +2359,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! AllNullableTypesWithoutRecursion completion(.success(result)) @@ -2774,10 +2368,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed boolean, to test serialization and deserialization. func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aBoolArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2789,11 +2381,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! Bool completion(.success(result)) @@ -2802,10 +2390,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed int, to test serialization and deserialization. func echo(_ anIntArg: Int64, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anIntArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2817,24 +2403,17 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = - listResponse[0] is Int64 ? listResponse[0] as! Int64 : Int64(listResponse[0] as! Int32) + let result = listResponse[0] is Int64 ? listResponse[0] as! Int64 : Int64(listResponse[0] as! Int32) completion(.success(result)) } } } /// Returns the passed double, to test serialization and deserialization. func echo(_ aDoubleArg: Double, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aDoubleArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2846,11 +2425,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! Double completion(.success(result)) @@ -2859,10 +2434,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed string, to test serialization and deserialization. func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2874,11 +2447,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! String completion(.success(result)) @@ -2886,14 +2455,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed byte list, to test serialization and deserialization. - func echo( - _ listArg: FlutterStandardTypedData, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo(_ listArg: FlutterStandardTypedData, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2905,11 +2469,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! FlutterStandardTypedData completion(.success(result)) @@ -2918,10 +2478,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed list, to test serialization and deserialization. func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2933,11 +2491,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! [Any?] completion(.success(result)) @@ -2945,13 +2499,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed map, to test serialization and deserialization. - func echo( - _ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo(_ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2963,11 +2513,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! [String?: Any?] completion(.success(result)) @@ -2976,10 +2522,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed enum to test serialization and deserialization. func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anEnumArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2991,11 +2535,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! AnEnum completion(.success(result)) @@ -3004,10 +2544,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed boolean, to test serialization and deserialization. func echoNullable(_ aBoolArg: Bool?, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aBoolArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3025,12 +2563,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed int, to test serialization and deserialization. - func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) - { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anIntArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3042,23 +2577,15 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: Int64? = - isNullish(listResponse[0]) - ? nil - : (listResponse[0] is Int64? - ? listResponse[0] as! Int64? : Int64(listResponse[0] as! Int32)) + let result: Int64? = isNullish(listResponse[0]) ? nil : (listResponse[0] is Int64? ? listResponse[0] as! Int64? : Int64(listResponse[0] as! Int32)) completion(.success(result)) } } } /// Returns the passed double, to test serialization and deserialization. - func echoNullable( - _ aDoubleArg: Double?, completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ aDoubleArg: Double?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aDoubleArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3076,13 +2603,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed string, to test serialization and deserialization. - func echoNullable( - _ aStringArg: String?, completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ aStringArg: String?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3100,14 +2623,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed byte list, to test serialization and deserialization. - func echoNullable( - _ listArg: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ listArg: FlutterStandardTypedData?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3125,13 +2643,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed list, to test serialization and deserialization. - func echoNullable( - _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3149,14 +2663,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - _ aMapArg: [String?: Any?]?, - completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ aMapArg: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3174,13 +2683,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed enum to test serialization and deserialization. - func echoNullable( - _ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anEnumArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3200,10 +2705,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. func noopAsync(completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3220,12 +2723,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed in generic Object asynchronously. - func echoAsync(_ aStringArg: String, completion: @escaping (Result) -> Void) - { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoAsync(_ aStringArg: String, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3237,11 +2737,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! String completion(.success(result)) @@ -3260,13 +2756,9 @@ protocol HostTrivialApi { class HostTrivialApiSetup { static var codec: FlutterStandardMessageCodec { CoreTestsPigeonCodec.shared } /// Sets up an instance of `HostTrivialApi` to handle messages through the `binaryMessenger`. - static func setUp( - binaryMessenger: FlutterBinaryMessenger, api: HostTrivialApi?, messageChannelSuffix: String = "" - ) { + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: HostTrivialApi?, messageChannelSuffix: String = "") { let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" - let noopChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let noopChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { noopChannel.setMessageHandler { _, reply in do { @@ -3293,13 +2785,9 @@ protocol HostSmallApi { class HostSmallApiSetup { static var codec: FlutterStandardMessageCodec { CoreTestsPigeonCodec.shared } /// Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. - static func setUp( - binaryMessenger: FlutterBinaryMessenger, api: HostSmallApi?, messageChannelSuffix: String = "" - ) { + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: HostSmallApi?, messageChannelSuffix: String = "") { let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" - let echoChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -3316,9 +2804,7 @@ class HostSmallApiSetup { } else { echoChannel.setMessageHandler(nil) } - let voidVoidChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let voidVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { voidVoidChannel.setMessageHandler { _, reply in api.voidVoid { result in @@ -3352,12 +2838,9 @@ class FlutterSmallApi: FlutterSmallApiProtocol { var codec: CoreTestsPigeonCodec { return CoreTestsPigeonCodec.shared } - func echo(_ msgArg: TestMessage, completion: @escaping (Result) -> Void) - { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo(_ msgArg: TestMessage, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([msgArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3369,23 +2852,16 @@ class FlutterSmallApi: FlutterSmallApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! TestMessage completion(.success(result)) } } } - func echo(string aStringArg: String, completion: @escaping (Result) -> Void) - { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo(string aStringArg: String, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3397,11 +2873,7 @@ class FlutterSmallApi: FlutterSmallApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! String completion(.success(result)) diff --git a/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift index 2b95f040b483..dcb2ad4a0ec9 100644 --- a/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift +++ b/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift @@ -30,7 +30,7 @@ final class PigeonError: Error { var localizedDescription: String { return "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" - } + } } private func wrapResult(_ result: Any?) -> [Any?] { @@ -60,9 +60,7 @@ private func wrapError(_ error: Any) -> [Any?] { } private func createConnectionError(withChannelName channelName: String) -> PigeonError { - return PigeonError( - code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", - details: "") + return PigeonError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "") } private func isNullish(_ value: Any?) -> Bool { @@ -107,10 +105,8 @@ struct AllTypes { // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ __pigeon_list: [Any?]) -> AllTypes? { let aBool = __pigeon_list[0] as! Bool - let anInt = - __pigeon_list[1] is Int64 ? __pigeon_list[1] as! Int64 : Int64(__pigeon_list[1] as! Int32) - let anInt64 = - __pigeon_list[2] is Int64 ? __pigeon_list[2] as! Int64 : Int64(__pigeon_list[2] as! Int32) + let anInt = __pigeon_list[1] is Int64 ? __pigeon_list[1] as! Int64 : Int64(__pigeon_list[1] as! Int32) + let anInt64 = __pigeon_list[2] is Int64 ? __pigeon_list[2] as! Int64 : Int64(__pigeon_list[2] as! Int32) let aDouble = __pigeon_list[3] as! Double let aByteArray = __pigeon_list[4] as! FlutterStandardTypedData let a4ByteArray = __pigeon_list[5] as! FlutterStandardTypedData @@ -246,16 +242,8 @@ class AllNullableTypes { // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ __pigeon_list: [Any?]) -> AllNullableTypes? { let aNullableBool: Bool? = nilOrValue(__pigeon_list[0]) - let aNullableInt: Int64? = - isNullish(__pigeon_list[1]) - ? nil - : (__pigeon_list[1] is Int64? - ? __pigeon_list[1] as! Int64? : Int64(__pigeon_list[1] as! Int32)) - let aNullableInt64: Int64? = - isNullish(__pigeon_list[2]) - ? nil - : (__pigeon_list[2] is Int64? - ? __pigeon_list[2] as! Int64? : Int64(__pigeon_list[2] as! Int32)) + let aNullableInt: Int64? = isNullish(__pigeon_list[1]) ? nil : (__pigeon_list[1] is Int64? ? __pigeon_list[1] as! Int64? : Int64(__pigeon_list[1] as! Int32)) + let aNullableInt64: Int64? = isNullish(__pigeon_list[2]) ? nil : (__pigeon_list[2] is Int64? ? __pigeon_list[2] as! Int64? : Int64(__pigeon_list[2] as! Int32)) let aNullableDouble: Double? = nilOrValue(__pigeon_list[3]) let aNullableByteArray: FlutterStandardTypedData? = nilOrValue(__pigeon_list[4]) let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(__pigeon_list[5]) @@ -359,16 +347,8 @@ struct AllNullableTypesWithoutRecursion { // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ __pigeon_list: [Any?]) -> AllNullableTypesWithoutRecursion? { let aNullableBool: Bool? = nilOrValue(__pigeon_list[0]) - let aNullableInt: Int64? = - isNullish(__pigeon_list[1]) - ? nil - : (__pigeon_list[1] is Int64? - ? __pigeon_list[1] as! Int64? : Int64(__pigeon_list[1] as! Int32)) - let aNullableInt64: Int64? = - isNullish(__pigeon_list[2]) - ? nil - : (__pigeon_list[2] is Int64? - ? __pigeon_list[2] as! Int64? : Int64(__pigeon_list[2] as! Int32)) + let aNullableInt: Int64? = isNullish(__pigeon_list[1]) ? nil : (__pigeon_list[1] is Int64? ? __pigeon_list[1] as! Int64? : Int64(__pigeon_list[1] as! Int32)) + let aNullableInt64: Int64? = isNullish(__pigeon_list[2]) ? nil : (__pigeon_list[2] is Int64? ? __pigeon_list[2] as! Int64? : Int64(__pigeon_list[2] as! Int32)) let aNullableDouble: Double? = nilOrValue(__pigeon_list[3]) let aNullableByteArray: FlutterStandardTypedData? = nilOrValue(__pigeon_list[4]) let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(__pigeon_list[5]) @@ -451,8 +431,7 @@ struct AllClassesWrapper { // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ __pigeon_list: [Any?]) -> AllClassesWrapper? { let allNullableTypes = __pigeon_list[0] as! AllNullableTypes - let allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = nilOrValue( - __pigeon_list[1]) + let allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = nilOrValue(__pigeon_list[1]) let allTypes: AllTypes? = nilOrValue(__pigeon_list[2]) return AllClassesWrapper( @@ -556,6 +535,7 @@ class CoreTestsPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { static let shared = CoreTestsPigeonCodec(readerWriter: CoreTestsPigeonCodecReaderWriter()) } + /// The core interface that each host language plugin must implement in /// platform_test integration tests. /// @@ -601,8 +581,7 @@ protocol HostIntegrationCoreApi { /// Returns the passed object, to test serialization and deserialization. func echo(_ everything: AllNullableTypes?) throws -> AllNullableTypes? /// Returns the passed object, to test serialization and deserialization. - func echo(_ everything: AllNullableTypesWithoutRecursion?) throws - -> AllNullableTypesWithoutRecursion? + func echo(_ everything: AllNullableTypesWithoutRecursion?) throws -> AllNullableTypesWithoutRecursion? /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. func extractNestedNullableString(from wrapper: AllClassesWrapper) throws -> String? @@ -610,13 +589,9 @@ protocol HostIntegrationCoreApi { /// sending of nested objects. func createNestedObject(with nullableString: String?) throws -> AllClassesWrapper /// Returns passed in arguments of multiple types. - func sendMultipleNullableTypes( - aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String? - ) throws -> AllNullableTypes + func sendMultipleNullableTypes(aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?) throws -> AllNullableTypes /// Returns passed in arguments of multiple types. - func sendMultipleNullableTypesWithoutRecursion( - aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String? - ) throws -> AllNullableTypesWithoutRecursion + func sendMultipleNullableTypesWithoutRecursion(aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?) throws -> AllNullableTypesWithoutRecursion /// Returns passed in int. func echo(_ aNullableInt: Int64?) throws -> Int64? /// Returns passed in double. @@ -650,16 +625,13 @@ protocol HostIntegrationCoreApi { /// Returns the passed string asynchronously. func echoAsync(_ aString: String, completion: @escaping (Result) -> Void) /// Returns the passed in Uint8List asynchronously. - func echoAsync( - _ aUint8List: FlutterStandardTypedData, - completion: @escaping (Result) -> Void) + func echoAsync(_ aUint8List: FlutterStandardTypedData, completion: @escaping (Result) -> Void) /// Returns the passed in generic Object asynchronously. func echoAsync(_ anObject: Any, completion: @escaping (Result) -> Void) /// Returns the passed list, to test asynchronous serialization and deserialization. func echoAsync(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsync( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) + func echoAsync(_ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. func echoAsync(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) /// Responds with an error from an async function returning a value. @@ -671,13 +643,9 @@ protocol HostIntegrationCoreApi { /// Returns the passed object, to test async serialization and deserialization. func echoAsync(_ everything: AllTypes, completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echoAsync( - _ everything: AllNullableTypes?, - completion: @escaping (Result) -> Void) + func echoAsync(_ everything: AllNullableTypes?, completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echoAsync( - _ everything: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void) + func echoAsync(_ everything: AllNullableTypesWithoutRecursion?, completion: @escaping (Result) -> Void) /// Returns passed in int asynchronously. func echoAsyncNullable(_ anInt: Int64?, completion: @escaping (Result) -> Void) /// Returns passed in double asynchronously. @@ -687,81 +655,51 @@ protocol HostIntegrationCoreApi { /// Returns the passed string asynchronously. func echoAsyncNullable(_ aString: String?, completion: @escaping (Result) -> Void) /// Returns the passed in Uint8List asynchronously. - func echoAsyncNullable( - _ aUint8List: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void) + func echoAsyncNullable(_ aUint8List: FlutterStandardTypedData?, completion: @escaping (Result) -> Void) /// Returns the passed in generic Object asynchronously. func echoAsyncNullable(_ anObject: Any?, completion: @escaping (Result) -> Void) /// Returns the passed list, to test asynchronous serialization and deserialization. func echoAsyncNullable(_ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsyncNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + func echoAsyncNullable(_ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. func echoAsyncNullable(_ anEnum: AnEnum?, completion: @escaping (Result) -> Void) func callFlutterNoop(completion: @escaping (Result) -> Void) func callFlutterThrowError(completion: @escaping (Result) -> Void) func callFlutterThrowErrorFromVoid(completion: @escaping (Result) -> Void) - func callFlutterEcho( - _ everything: AllTypes, completion: @escaping (Result) -> Void) - func callFlutterEcho( - _ everything: AllNullableTypes?, - completion: @escaping (Result) -> Void) - func callFlutterSendMultipleNullableTypes( - aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, - completion: @escaping (Result) -> Void) - func callFlutterEcho( - _ everything: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void) - func callFlutterSendMultipleNullableTypesWithoutRecursion( - aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, - completion: @escaping (Result) -> Void) + func callFlutterEcho(_ everything: AllTypes, completion: @escaping (Result) -> Void) + func callFlutterEcho(_ everything: AllNullableTypes?, completion: @escaping (Result) -> Void) + func callFlutterSendMultipleNullableTypes(aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, completion: @escaping (Result) -> Void) + func callFlutterEcho(_ everything: AllNullableTypesWithoutRecursion?, completion: @escaping (Result) -> Void) + func callFlutterSendMultipleNullableTypesWithoutRecursion(aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, completion: @escaping (Result) -> Void) func callFlutterEcho(_ aBool: Bool, completion: @escaping (Result) -> Void) func callFlutterEcho(_ anInt: Int64, completion: @escaping (Result) -> Void) func callFlutterEcho(_ aDouble: Double, completion: @escaping (Result) -> Void) func callFlutterEcho(_ aString: String, completion: @escaping (Result) -> Void) - func callFlutterEcho( - _ list: FlutterStandardTypedData, - completion: @escaping (Result) -> Void) + func callFlutterEcho(_ list: FlutterStandardTypedData, completion: @escaping (Result) -> Void) func callFlutterEcho(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) - func callFlutterEcho( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) + func callFlutterEcho(_ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) func callFlutterEcho(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) func callFlutterEchoNullable(_ aBool: Bool?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable( - _ anInt: Int64?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable( - _ aDouble: Double?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable( - _ aString: String?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable( - _ list: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void) - func callFlutterEchoNullable( - _ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) - func callFlutterEchoNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) - func callFlutterNullableEcho( - _ anEnum: AnEnum?, completion: @escaping (Result) -> Void) - func callFlutterSmallApiEcho( - _ aString: String, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable(_ anInt: Int64?, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable(_ aDouble: Double?, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable(_ aString: String?, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable(_ list: FlutterStandardTypedData?, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable(_ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) + func callFlutterEchoNullable(_ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + func callFlutterNullableEcho(_ anEnum: AnEnum?, completion: @escaping (Result) -> Void) + func callFlutterSmallApiEcho(_ aString: String, completion: @escaping (Result) -> Void) } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. class HostIntegrationCoreApiSetup { static var codec: FlutterStandardMessageCodec { CoreTestsPigeonCodec.shared } /// Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binaryMessenger`. - static func setUp( - binaryMessenger: FlutterBinaryMessenger, api: HostIntegrationCoreApi?, - messageChannelSuffix: String = "" - ) { + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: HostIntegrationCoreApi?, messageChannelSuffix: String = "") { let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. - let noopChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let noopChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { noopChannel.setMessageHandler { _, reply in do { @@ -775,10 +713,7 @@ class HostIntegrationCoreApiSetup { noopChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAllTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAllTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAllTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -794,10 +729,7 @@ class HostIntegrationCoreApiSetup { echoAllTypesChannel.setMessageHandler(nil) } /// Returns an error, to test error handling. - let throwErrorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let throwErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwErrorChannel.setMessageHandler { _, reply in do { @@ -811,10 +743,7 @@ class HostIntegrationCoreApiSetup { throwErrorChannel.setMessageHandler(nil) } /// Returns an error from a void function, to test error handling. - let throwErrorFromVoidChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let throwErrorFromVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwErrorFromVoidChannel.setMessageHandler { _, reply in do { @@ -828,10 +757,7 @@ class HostIntegrationCoreApiSetup { throwErrorFromVoidChannel.setMessageHandler(nil) } /// Returns a Flutter error, to test error handling. - let throwFlutterErrorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let throwFlutterErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwFlutterErrorChannel.setMessageHandler { _, reply in do { @@ -845,10 +771,7 @@ class HostIntegrationCoreApiSetup { throwFlutterErrorChannel.setMessageHandler(nil) } /// Returns passed in int. - let echoIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -864,10 +787,7 @@ class HostIntegrationCoreApiSetup { echoIntChannel.setMessageHandler(nil) } /// Returns passed in double. - let echoDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -883,10 +803,7 @@ class HostIntegrationCoreApiSetup { echoDoubleChannel.setMessageHandler(nil) } /// Returns the passed in boolean. - let echoBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -902,10 +819,7 @@ class HostIntegrationCoreApiSetup { echoBoolChannel.setMessageHandler(nil) } /// Returns the passed in string. - let echoStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -921,10 +835,7 @@ class HostIntegrationCoreApiSetup { echoStringChannel.setMessageHandler(nil) } /// Returns the passed in Uint8List. - let echoUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -940,10 +851,7 @@ class HostIntegrationCoreApiSetup { echoUint8ListChannel.setMessageHandler(nil) } /// Returns the passed in generic Object. - let echoObjectChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoObjectChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoObjectChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -959,10 +867,7 @@ class HostIntegrationCoreApiSetup { echoObjectChannel.setMessageHandler(nil) } /// Returns the passed list, to test serialization and deserialization. - let echoListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -978,10 +883,7 @@ class HostIntegrationCoreApiSetup { echoListChannel.setMessageHandler(nil) } /// Returns the passed map, to test serialization and deserialization. - let echoMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -997,10 +899,7 @@ class HostIntegrationCoreApiSetup { echoMapChannel.setMessageHandler(nil) } /// Returns the passed map to test nested class serialization and deserialization. - let echoClassWrapperChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoClassWrapperChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoClassWrapperChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1016,10 +915,7 @@ class HostIntegrationCoreApiSetup { echoClassWrapperChannel.setMessageHandler(nil) } /// Returns the passed enum to test serialization and deserialization. - let echoEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1035,10 +931,7 @@ class HostIntegrationCoreApiSetup { echoEnumChannel.setMessageHandler(nil) } /// Returns the default string. - let echoNamedDefaultStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNamedDefaultStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNamedDefaultStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1054,10 +947,7 @@ class HostIntegrationCoreApiSetup { echoNamedDefaultStringChannel.setMessageHandler(nil) } /// Returns passed in double. - let echoOptionalDefaultDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoOptionalDefaultDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoOptionalDefaultDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1073,10 +963,7 @@ class HostIntegrationCoreApiSetup { echoOptionalDefaultDoubleChannel.setMessageHandler(nil) } /// Returns passed in int. - let echoRequiredIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoRequiredIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoRequiredIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1092,10 +979,7 @@ class HostIntegrationCoreApiSetup { echoRequiredIntChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAllNullableTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAllNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAllNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1111,10 +995,7 @@ class HostIntegrationCoreApiSetup { echoAllNullableTypesChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAllNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1131,10 +1012,7 @@ class HostIntegrationCoreApiSetup { } /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. - let extractNestedNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let extractNestedNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { extractNestedNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1151,10 +1029,7 @@ class HostIntegrationCoreApiSetup { } /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. - let createNestedNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let createNestedNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { createNestedNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1170,21 +1045,15 @@ class HostIntegrationCoreApiSetup { createNestedNullableStringChannel.setMessageHandler(nil) } /// Returns passed in arguments of multiple types. - let sendMultipleNullableTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let sendMultipleNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { sendMultipleNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = - isNullish(args[1]) - ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = isNullish(args[1]) ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) let aNullableStringArg: String? = nilOrValue(args[2]) do { - let result = try api.sendMultipleNullableTypes( - aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) + let result = try api.sendMultipleNullableTypes(aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1194,21 +1063,15 @@ class HostIntegrationCoreApiSetup { sendMultipleNullableTypesChannel.setMessageHandler(nil) } /// Returns passed in arguments of multiple types. - let sendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let sendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { sendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = - isNullish(args[1]) - ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = isNullish(args[1]) ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) let aNullableStringArg: String? = nilOrValue(args[2]) do { - let result = try api.sendMultipleNullableTypesWithoutRecursion( - aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) + let result = try api.sendMultipleNullableTypesWithoutRecursion(aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1218,16 +1081,11 @@ class HostIntegrationCoreApiSetup { sendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler(nil) } /// Returns passed in int. - let echoNullableIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aNullableIntArg: Int64? = - isNullish(args[0]) - ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let aNullableIntArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) do { let result = try api.echo(aNullableIntArg) reply(wrapResult(result)) @@ -1239,10 +1097,7 @@ class HostIntegrationCoreApiSetup { echoNullableIntChannel.setMessageHandler(nil) } /// Returns passed in double. - let echoNullableDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1258,10 +1113,7 @@ class HostIntegrationCoreApiSetup { echoNullableDoubleChannel.setMessageHandler(nil) } /// Returns the passed in boolean. - let echoNullableBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1277,10 +1129,7 @@ class HostIntegrationCoreApiSetup { echoNullableBoolChannel.setMessageHandler(nil) } /// Returns the passed in string. - let echoNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1296,10 +1145,7 @@ class HostIntegrationCoreApiSetup { echoNullableStringChannel.setMessageHandler(nil) } /// Returns the passed in Uint8List. - let echoNullableUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1315,10 +1161,7 @@ class HostIntegrationCoreApiSetup { echoNullableUint8ListChannel.setMessageHandler(nil) } /// Returns the passed in generic Object. - let echoNullableObjectChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableObjectChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableObjectChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1334,10 +1177,7 @@ class HostIntegrationCoreApiSetup { echoNullableObjectChannel.setMessageHandler(nil) } /// Returns the passed list, to test serialization and deserialization. - let echoNullableListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1353,10 +1193,7 @@ class HostIntegrationCoreApiSetup { echoNullableListChannel.setMessageHandler(nil) } /// Returns the passed map, to test serialization and deserialization. - let echoNullableMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1371,10 +1208,7 @@ class HostIntegrationCoreApiSetup { } else { echoNullableMapChannel.setMessageHandler(nil) } - let echoNullableEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNullableEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1390,16 +1224,11 @@ class HostIntegrationCoreApiSetup { echoNullableEnumChannel.setMessageHandler(nil) } /// Returns passed in int. - let echoOptionalNullableIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoOptionalNullableIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoOptionalNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aNullableIntArg: Int64? = - isNullish(args[0]) - ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let aNullableIntArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) do { let result = try api.echoOptional(aNullableIntArg) reply(wrapResult(result)) @@ -1411,10 +1240,7 @@ class HostIntegrationCoreApiSetup { echoOptionalNullableIntChannel.setMessageHandler(nil) } /// Returns the passed in string. - let echoNamedNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoNamedNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNamedNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1431,10 +1257,7 @@ class HostIntegrationCoreApiSetup { } /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. - let noopAsyncChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let noopAsyncChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { noopAsyncChannel.setMessageHandler { _, reply in api.noopAsync { result in @@ -1450,10 +1273,7 @@ class HostIntegrationCoreApiSetup { noopAsyncChannel.setMessageHandler(nil) } /// Returns passed in int asynchronously. - let echoAsyncIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1471,10 +1291,7 @@ class HostIntegrationCoreApiSetup { echoAsyncIntChannel.setMessageHandler(nil) } /// Returns passed in double asynchronously. - let echoAsyncDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1492,10 +1309,7 @@ class HostIntegrationCoreApiSetup { echoAsyncDoubleChannel.setMessageHandler(nil) } /// Returns the passed in boolean asynchronously. - let echoAsyncBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1513,10 +1327,7 @@ class HostIntegrationCoreApiSetup { echoAsyncBoolChannel.setMessageHandler(nil) } /// Returns the passed string asynchronously. - let echoAsyncStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1534,10 +1345,7 @@ class HostIntegrationCoreApiSetup { echoAsyncStringChannel.setMessageHandler(nil) } /// Returns the passed in Uint8List asynchronously. - let echoAsyncUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1555,10 +1363,7 @@ class HostIntegrationCoreApiSetup { echoAsyncUint8ListChannel.setMessageHandler(nil) } /// Returns the passed in generic Object asynchronously. - let echoAsyncObjectChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncObjectChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncObjectChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1576,10 +1381,7 @@ class HostIntegrationCoreApiSetup { echoAsyncObjectChannel.setMessageHandler(nil) } /// Returns the passed list, to test asynchronous serialization and deserialization. - let echoAsyncListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1597,10 +1399,7 @@ class HostIntegrationCoreApiSetup { echoAsyncListChannel.setMessageHandler(nil) } /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1618,10 +1417,7 @@ class HostIntegrationCoreApiSetup { echoAsyncMapChannel.setMessageHandler(nil) } /// Returns the passed enum, to test asynchronous serialization and deserialization. - let echoAsyncEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1639,10 +1435,7 @@ class HostIntegrationCoreApiSetup { echoAsyncEnumChannel.setMessageHandler(nil) } /// Responds with an error from an async function returning a value. - let throwAsyncErrorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let throwAsyncErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwAsyncErrorChannel.setMessageHandler { _, reply in api.throwAsyncError { result in @@ -1658,10 +1451,7 @@ class HostIntegrationCoreApiSetup { throwAsyncErrorChannel.setMessageHandler(nil) } /// Responds with an error from an async void function. - let throwAsyncErrorFromVoidChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let throwAsyncErrorFromVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwAsyncErrorFromVoidChannel.setMessageHandler { _, reply in api.throwAsyncErrorFromVoid { result in @@ -1677,10 +1467,7 @@ class HostIntegrationCoreApiSetup { throwAsyncErrorFromVoidChannel.setMessageHandler(nil) } /// Responds with a Flutter error from an async function returning a value. - let throwAsyncFlutterErrorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let throwAsyncFlutterErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwAsyncFlutterErrorChannel.setMessageHandler { _, reply in api.throwAsyncFlutterError { result in @@ -1696,10 +1483,7 @@ class HostIntegrationCoreApiSetup { throwAsyncFlutterErrorChannel.setMessageHandler(nil) } /// Returns the passed object, to test async serialization and deserialization. - let echoAsyncAllTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncAllTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncAllTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1717,10 +1501,7 @@ class HostIntegrationCoreApiSetup { echoAsyncAllTypesChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAsyncNullableAllNullableTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableAllNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableAllNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1738,10 +1519,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableAllNullableTypesChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAsyncNullableAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableAllNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1759,16 +1537,11 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableAllNullableTypesWithoutRecursionChannel.setMessageHandler(nil) } /// Returns passed in int asynchronously. - let echoAsyncNullableIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg: Int64? = - isNullish(args[0]) - ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let anIntArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) api.echoAsyncNullable(anIntArg) { result in switch result { case .success(let res): @@ -1782,10 +1555,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableIntChannel.setMessageHandler(nil) } /// Returns passed in double asynchronously. - let echoAsyncNullableDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1803,10 +1573,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableDoubleChannel.setMessageHandler(nil) } /// Returns the passed in boolean asynchronously. - let echoAsyncNullableBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1824,10 +1591,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableBoolChannel.setMessageHandler(nil) } /// Returns the passed string asynchronously. - let echoAsyncNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1845,10 +1609,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableStringChannel.setMessageHandler(nil) } /// Returns the passed in Uint8List asynchronously. - let echoAsyncNullableUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1866,10 +1627,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableUint8ListChannel.setMessageHandler(nil) } /// Returns the passed in generic Object asynchronously. - let echoAsyncNullableObjectChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableObjectChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableObjectChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1887,10 +1645,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableObjectChannel.setMessageHandler(nil) } /// Returns the passed list, to test asynchronous serialization and deserialization. - let echoAsyncNullableListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1908,10 +1663,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableListChannel.setMessageHandler(nil) } /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncNullableMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1929,10 +1681,7 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableMapChannel.setMessageHandler(nil) } /// Returns the passed enum, to test asynchronous serialization and deserialization. - let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1949,10 +1698,7 @@ class HostIntegrationCoreApiSetup { } else { echoAsyncNullableEnumChannel.setMessageHandler(nil) } - let callFlutterNoopChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterNoopChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterNoopChannel.setMessageHandler { _, reply in api.callFlutterNoop { result in @@ -1967,10 +1713,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterNoopChannel.setMessageHandler(nil) } - let callFlutterThrowErrorChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterThrowErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterThrowErrorChannel.setMessageHandler { _, reply in api.callFlutterThrowError { result in @@ -1985,10 +1728,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterThrowErrorChannel.setMessageHandler(nil) } - let callFlutterThrowErrorFromVoidChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterThrowErrorFromVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterThrowErrorFromVoidChannel.setMessageHandler { _, reply in api.callFlutterThrowErrorFromVoid { result in @@ -2003,10 +1743,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterThrowErrorFromVoidChannel.setMessageHandler(nil) } - let callFlutterEchoAllTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoAllTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoAllTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2023,10 +1760,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoAllTypesChannel.setMessageHandler(nil) } - let callFlutterEchoAllNullableTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoAllNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoAllNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2043,21 +1777,14 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoAllNullableTypesChannel.setMessageHandler(nil) } - let callFlutterSendMultipleNullableTypesChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterSendMultipleNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterSendMultipleNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = - isNullish(args[1]) - ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = isNullish(args[1]) ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) let aNullableStringArg: String? = nilOrValue(args[2]) - api.callFlutterSendMultipleNullableTypes( - aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg - ) { result in + api.callFlutterSendMultipleNullableTypes(aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2069,10 +1796,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterSendMultipleNullableTypesChannel.setMessageHandler(nil) } - let callFlutterEchoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoAllNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2089,22 +1813,14 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoAllNullableTypesWithoutRecursionChannel.setMessageHandler(nil) } - let callFlutterSendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterSendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterSendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler { - message, reply in + callFlutterSendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = - isNullish(args[1]) - ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = isNullish(args[1]) ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) let aNullableStringArg: String? = nilOrValue(args[2]) - api.callFlutterSendMultipleNullableTypesWithoutRecursion( - aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg - ) { result in + api.callFlutterSendMultipleNullableTypesWithoutRecursion(aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2116,10 +1832,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterSendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler(nil) } - let callFlutterEchoBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2136,10 +1849,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoBoolChannel.setMessageHandler(nil) } - let callFlutterEchoIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2156,10 +1866,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoIntChannel.setMessageHandler(nil) } - let callFlutterEchoDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2176,10 +1883,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoDoubleChannel.setMessageHandler(nil) } - let callFlutterEchoStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2196,10 +1900,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoStringChannel.setMessageHandler(nil) } - let callFlutterEchoUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2216,10 +1917,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoUint8ListChannel.setMessageHandler(nil) } - let callFlutterEchoListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2236,10 +1934,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoListChannel.setMessageHandler(nil) } - let callFlutterEchoMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2256,10 +1951,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoMapChannel.setMessageHandler(nil) } - let callFlutterEchoEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2276,10 +1968,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoEnumChannel.setMessageHandler(nil) } - let callFlutterEchoNullableBoolChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2296,16 +1985,11 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableBoolChannel.setMessageHandler(nil) } - let callFlutterEchoNullableIntChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg: Int64? = - isNullish(args[0]) - ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let anIntArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) api.callFlutterEchoNullable(anIntArg) { result in switch result { case .success(let res): @@ -2318,10 +2002,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableIntChannel.setMessageHandler(nil) } - let callFlutterEchoNullableDoubleChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2338,10 +2019,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableDoubleChannel.setMessageHandler(nil) } - let callFlutterEchoNullableStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2358,10 +2036,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableStringChannel.setMessageHandler(nil) } - let callFlutterEchoNullableUint8ListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2378,10 +2053,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableUint8ListChannel.setMessageHandler(nil) } - let callFlutterEchoNullableListChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2398,10 +2070,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableListChannel.setMessageHandler(nil) } - let callFlutterEchoNullableMapChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2418,10 +2087,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2438,10 +2104,7 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableEnumChannel.setMessageHandler(nil) } - let callFlutterSmallApiEchoStringChannel = FlutterBasicMessageChannel( - name: - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let callFlutterSmallApiEchoStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterSmallApiEchoStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2473,30 +2136,19 @@ protocol FlutterIntegrationCoreApiProtocol { /// Responds with an error from an async void function. func throwErrorFromVoid(completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echo( - _ everythingArg: AllTypes, completion: @escaping (Result) -> Void) + func echo(_ everythingArg: AllTypes, completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echoNullable( - _ everythingArg: AllNullableTypes?, - completion: @escaping (Result) -> Void) + func echoNullable(_ everythingArg: AllNullableTypes?, completion: @escaping (Result) -> Void) /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypes( - aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, - aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void) + func sendMultipleNullableTypes(aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echoNullable( - _ everythingArg: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void) + func echoNullable(_ everythingArg: AllNullableTypesWithoutRecursion?, completion: @escaping (Result) -> Void) /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypesWithoutRecursion( - aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, - aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void) + func sendMultipleNullableTypesWithoutRecursion(aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, completion: @escaping (Result) -> Void) /// Returns the passed boolean, to test serialization and deserialization. func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) /// Returns the passed int, to test serialization and deserialization. @@ -2506,15 +2158,11 @@ protocol FlutterIntegrationCoreApiProtocol { /// Returns the passed string, to test serialization and deserialization. func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) /// Returns the passed byte list, to test serialization and deserialization. - func echo( - _ listArg: FlutterStandardTypedData, - completion: @escaping (Result) -> Void) + func echo(_ listArg: FlutterStandardTypedData, completion: @escaping (Result) -> Void) /// Returns the passed list, to test serialization and deserialization. func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) /// Returns the passed map, to test serialization and deserialization. - func echo( - _ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void - ) + func echo(_ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void) /// Returns the passed enum to test serialization and deserialization. func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) /// Returns the passed boolean, to test serialization and deserialization. @@ -2522,25 +2170,17 @@ protocol FlutterIntegrationCoreApiProtocol { /// Returns the passed int, to test serialization and deserialization. func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) /// Returns the passed double, to test serialization and deserialization. - func echoNullable( - _ aDoubleArg: Double?, completion: @escaping (Result) -> Void) + func echoNullable(_ aDoubleArg: Double?, completion: @escaping (Result) -> Void) /// Returns the passed string, to test serialization and deserialization. - func echoNullable( - _ aStringArg: String?, completion: @escaping (Result) -> Void) + func echoNullable(_ aStringArg: String?, completion: @escaping (Result) -> Void) /// Returns the passed byte list, to test serialization and deserialization. - func echoNullable( - _ listArg: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void) + func echoNullable(_ listArg: FlutterStandardTypedData?, completion: @escaping (Result) -> Void) /// Returns the passed list, to test serialization and deserialization. - func echoNullable( - _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) + func echoNullable(_ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - _ aMapArg: [String?: Any?]?, - completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void) + func echoNullable(_ aMapArg: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void) /// Returns the passed enum to test serialization and deserialization. - func echoNullable( - _ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) + func echoNullable(_ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. func noopAsync(completion: @escaping (Result) -> Void) @@ -2560,10 +2200,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. func noop(completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2581,10 +2219,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Responds with an error from an async function returning a value. func throwError(completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2603,10 +2239,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Responds with an error from an async void function. func throwErrorFromVoid(completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2623,13 +2257,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed object, to test serialization and deserialization. - func echo( - _ everythingArg: AllTypes, completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo(_ everythingArg: AllTypes, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([everythingArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2641,11 +2271,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! AllTypes completion(.success(result)) @@ -2653,14 +2279,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed object, to test serialization and deserialization. - func echoNullable( - _ everythingArg: AllNullableTypes?, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ everythingArg: AllNullableTypes?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([everythingArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2680,17 +2301,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypes( - aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, - aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { - response in + func sendMultipleNullableTypes(aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2701,11 +2315,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! AllNullableTypes completion(.success(result)) @@ -2713,14 +2323,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed object, to test serialization and deserialization. - func echoNullable( - _ everythingArg: AllNullableTypesWithoutRecursion?, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ everythingArg: AllNullableTypesWithoutRecursion?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([everythingArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2740,17 +2345,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypesWithoutRecursion( - aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, - aString aNullableStringArg: String?, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { - response in + func sendMultipleNullableTypesWithoutRecursion(aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2761,11 +2359,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! AllNullableTypesWithoutRecursion completion(.success(result)) @@ -2774,10 +2368,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed boolean, to test serialization and deserialization. func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aBoolArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2789,11 +2381,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! Bool completion(.success(result)) @@ -2802,10 +2390,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed int, to test serialization and deserialization. func echo(_ anIntArg: Int64, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anIntArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2817,24 +2403,17 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = - listResponse[0] is Int64 ? listResponse[0] as! Int64 : Int64(listResponse[0] as! Int32) + let result = listResponse[0] is Int64 ? listResponse[0] as! Int64 : Int64(listResponse[0] as! Int32) completion(.success(result)) } } } /// Returns the passed double, to test serialization and deserialization. func echo(_ aDoubleArg: Double, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aDoubleArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2846,11 +2425,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! Double completion(.success(result)) @@ -2859,10 +2434,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed string, to test serialization and deserialization. func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2874,11 +2447,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! String completion(.success(result)) @@ -2886,14 +2455,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed byte list, to test serialization and deserialization. - func echo( - _ listArg: FlutterStandardTypedData, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo(_ listArg: FlutterStandardTypedData, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2905,11 +2469,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! FlutterStandardTypedData completion(.success(result)) @@ -2918,10 +2478,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed list, to test serialization and deserialization. func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2933,11 +2491,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! [Any?] completion(.success(result)) @@ -2945,13 +2499,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed map, to test serialization and deserialization. - func echo( - _ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo(_ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2963,11 +2513,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! [String?: Any?] completion(.success(result)) @@ -2976,10 +2522,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed enum to test serialization and deserialization. func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anEnumArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2991,11 +2535,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! AnEnum completion(.success(result)) @@ -3004,10 +2544,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed boolean, to test serialization and deserialization. func echoNullable(_ aBoolArg: Bool?, completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aBoolArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3025,12 +2563,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed int, to test serialization and deserialization. - func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) - { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anIntArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3042,23 +2577,15 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: Int64? = - isNullish(listResponse[0]) - ? nil - : (listResponse[0] is Int64? - ? listResponse[0] as! Int64? : Int64(listResponse[0] as! Int32)) + let result: Int64? = isNullish(listResponse[0]) ? nil : (listResponse[0] is Int64? ? listResponse[0] as! Int64? : Int64(listResponse[0] as! Int32)) completion(.success(result)) } } } /// Returns the passed double, to test serialization and deserialization. - func echoNullable( - _ aDoubleArg: Double?, completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ aDoubleArg: Double?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aDoubleArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3076,13 +2603,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed string, to test serialization and deserialization. - func echoNullable( - _ aStringArg: String?, completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ aStringArg: String?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3100,14 +2623,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed byte list, to test serialization and deserialization. - func echoNullable( - _ listArg: FlutterStandardTypedData?, - completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ listArg: FlutterStandardTypedData?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3125,13 +2643,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed list, to test serialization and deserialization. - func echoNullable( - _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3149,14 +2663,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed map, to test serialization and deserialization. - func echoNullable( - _ aMapArg: [String?: Any?]?, - completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ aMapArg: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3174,13 +2683,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed enum to test serialization and deserialization. - func echoNullable( - _ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void - ) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anEnumArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3200,10 +2705,8 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. func noopAsync(completion: @escaping (Result) -> Void) { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3220,12 +2723,9 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed in generic Object asynchronously. - func echoAsync(_ aStringArg: String, completion: @escaping (Result) -> Void) - { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoAsync(_ aStringArg: String, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3237,11 +2737,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! String completion(.success(result)) @@ -3260,13 +2756,9 @@ protocol HostTrivialApi { class HostTrivialApiSetup { static var codec: FlutterStandardMessageCodec { CoreTestsPigeonCodec.shared } /// Sets up an instance of `HostTrivialApi` to handle messages through the `binaryMessenger`. - static func setUp( - binaryMessenger: FlutterBinaryMessenger, api: HostTrivialApi?, messageChannelSuffix: String = "" - ) { + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: HostTrivialApi?, messageChannelSuffix: String = "") { let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" - let noopChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let noopChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { noopChannel.setMessageHandler { _, reply in do { @@ -3293,13 +2785,9 @@ protocol HostSmallApi { class HostSmallApiSetup { static var codec: FlutterStandardMessageCodec { CoreTestsPigeonCodec.shared } /// Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. - static func setUp( - binaryMessenger: FlutterBinaryMessenger, api: HostSmallApi?, messageChannelSuffix: String = "" - ) { + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: HostSmallApi?, messageChannelSuffix: String = "") { let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" - let echoChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let echoChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -3316,9 +2804,7 @@ class HostSmallApiSetup { } else { echoChannel.setMessageHandler(nil) } - let voidVoidChannel = FlutterBasicMessageChannel( - name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid\(channelSuffix)", - binaryMessenger: binaryMessenger, codec: codec) + let voidVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) if let api = api { voidVoidChannel.setMessageHandler { _, reply in api.voidVoid { result in @@ -3352,12 +2838,9 @@ class FlutterSmallApi: FlutterSmallApiProtocol { var codec: CoreTestsPigeonCodec { return CoreTestsPigeonCodec.shared } - func echo(_ msgArg: TestMessage, completion: @escaping (Result) -> Void) - { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo(_ msgArg: TestMessage, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([msgArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3369,23 +2852,16 @@ class FlutterSmallApi: FlutterSmallApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! TestMessage completion(.success(result)) } } } - func echo(string aStringArg: String, completion: @escaping (Result) -> Void) - { - let channelName: String = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel( - name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo(string aStringArg: String, completion: @escaping (Result) -> Void) { + let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -3397,11 +2873,7 @@ class FlutterSmallApi: FlutterSmallApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion( - .failure( - PigeonError( - code: "null-error", - message: "Flutter api returned null value for non-null return value.", details: ""))) + completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! String completion(.success(result)) diff --git a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp index c97dc064a96b..592260c8e0f5 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp +++ b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp @@ -26,58 +26,85 @@ using flutter::EncodableMap; using flutter::EncodableValue; FlutterError CreateConnectionError(const std::string channel_name) { - return FlutterError( - "channel-error", - "Unable to establish connection on channel: '" + channel_name + "'.", - EncodableValue("")); + return FlutterError( + "channel-error", + "Unable to establish connection on channel: '" + channel_name + "'.", + EncodableValue("")); } // AllTypes -AllTypes::AllTypes(bool a_bool, int64_t an_int, int64_t an_int64, - double a_double, const std::vector& a_byte_array, - const std::vector& a4_byte_array, - const std::vector& a8_byte_array, - const std::vector& a_float_array, - const AnEnum& an_enum, const std::string& a_string, - const EncodableValue& an_object, const EncodableList& list, - const EncodableList& string_list, - const EncodableList& int_list, - const EncodableList& double_list, - const EncodableList& bool_list, const EncodableMap& map) - : a_bool_(a_bool), - an_int_(an_int), - an_int64_(an_int64), - a_double_(a_double), - a_byte_array_(a_byte_array), - a4_byte_array_(a4_byte_array), - a8_byte_array_(a8_byte_array), - a_float_array_(a_float_array), - an_enum_(an_enum), - a_string_(a_string), - an_object_(an_object), - list_(list), - string_list_(string_list), - int_list_(int_list), - double_list_(double_list), - bool_list_(bool_list), - map_(map) {} - -bool AllTypes::a_bool() const { return a_bool_; } - -void AllTypes::set_a_bool(bool value_arg) { a_bool_ = value_arg; } - -int64_t AllTypes::an_int() const { return an_int_; } - -void AllTypes::set_an_int(int64_t value_arg) { an_int_ = value_arg; } - -int64_t AllTypes::an_int64() const { return an_int64_; } - -void AllTypes::set_an_int64(int64_t value_arg) { an_int64_ = value_arg; } - -double AllTypes::a_double() const { return a_double_; } - -void AllTypes::set_a_double(double value_arg) { a_double_ = value_arg; } +AllTypes::AllTypes( + bool a_bool, + int64_t an_int, + int64_t an_int64, + double a_double, + const std::vector& a_byte_array, + const std::vector& a4_byte_array, + const std::vector& a8_byte_array, + const std::vector& a_float_array, + const AnEnum& an_enum, + const std::string& a_string, + const EncodableValue& an_object, + const EncodableList& list, + const EncodableList& string_list, + const EncodableList& int_list, + const EncodableList& double_list, + const EncodableList& bool_list, + const EncodableMap& map) + : a_bool_(a_bool), + an_int_(an_int), + an_int64_(an_int64), + a_double_(a_double), + a_byte_array_(a_byte_array), + a4_byte_array_(a4_byte_array), + a8_byte_array_(a8_byte_array), + a_float_array_(a_float_array), + an_enum_(an_enum), + a_string_(a_string), + an_object_(an_object), + list_(list), + string_list_(string_list), + int_list_(int_list), + double_list_(double_list), + bool_list_(bool_list), + map_(map) {} + +bool AllTypes::a_bool() const { + return a_bool_; +} + +void AllTypes::set_a_bool(bool value_arg) { + a_bool_ = value_arg; +} + + +int64_t AllTypes::an_int() const { + return an_int_; +} + +void AllTypes::set_an_int(int64_t value_arg) { + an_int_ = value_arg; +} + + +int64_t AllTypes::an_int64() const { + return an_int64_; +} + +void AllTypes::set_an_int64(int64_t value_arg) { + an_int64_ = value_arg; +} + + +double AllTypes::a_double() const { + return a_double_; +} + +void AllTypes::set_a_double(double value_arg) { + a_double_ = value_arg; +} + const std::vector& AllTypes::a_byte_array() const { return a_byte_array_; @@ -87,6 +114,7 @@ void AllTypes::set_a_byte_array(const std::vector& value_arg) { a_byte_array_ = value_arg; } + const std::vector& AllTypes::a4_byte_array() const { return a4_byte_array_; } @@ -95,6 +123,7 @@ void AllTypes::set_a4_byte_array(const std::vector& value_arg) { a4_byte_array_ = value_arg; } + const std::vector& AllTypes::a8_byte_array() const { return a8_byte_array_; } @@ -103,6 +132,7 @@ void AllTypes::set_a8_byte_array(const std::vector& value_arg) { a8_byte_array_ = value_arg; } + const std::vector& AllTypes::a_float_array() const { return a_float_array_; } @@ -111,53 +141,87 @@ void AllTypes::set_a_float_array(const std::vector& value_arg) { a_float_array_ = value_arg; } -const AnEnum& AllTypes::an_enum() const { return an_enum_; } -void AllTypes::set_an_enum(const AnEnum& value_arg) { an_enum_ = value_arg; } +const AnEnum& AllTypes::an_enum() const { + return an_enum_; +} + +void AllTypes::set_an_enum(const AnEnum& value_arg) { + an_enum_ = value_arg; +} + -const std::string& AllTypes::a_string() const { return a_string_; } +const std::string& AllTypes::a_string() const { + return a_string_; +} void AllTypes::set_a_string(std::string_view value_arg) { a_string_ = value_arg; } -const EncodableValue& AllTypes::an_object() const { return an_object_; } + +const EncodableValue& AllTypes::an_object() const { + return an_object_; +} void AllTypes::set_an_object(const EncodableValue& value_arg) { an_object_ = value_arg; } -const EncodableList& AllTypes::list() const { return list_; } -void AllTypes::set_list(const EncodableList& value_arg) { list_ = value_arg; } +const EncodableList& AllTypes::list() const { + return list_; +} + +void AllTypes::set_list(const EncodableList& value_arg) { + list_ = value_arg; +} + -const EncodableList& AllTypes::string_list() const { return string_list_; } +const EncodableList& AllTypes::string_list() const { + return string_list_; +} void AllTypes::set_string_list(const EncodableList& value_arg) { string_list_ = value_arg; } -const EncodableList& AllTypes::int_list() const { return int_list_; } + +const EncodableList& AllTypes::int_list() const { + return int_list_; +} void AllTypes::set_int_list(const EncodableList& value_arg) { int_list_ = value_arg; } -const EncodableList& AllTypes::double_list() const { return double_list_; } + +const EncodableList& AllTypes::double_list() const { + return double_list_; +} void AllTypes::set_double_list(const EncodableList& value_arg) { double_list_ = value_arg; } -const EncodableList& AllTypes::bool_list() const { return bool_list_; } + +const EncodableList& AllTypes::bool_list() const { + return bool_list_; +} void AllTypes::set_bool_list(const EncodableList& value_arg) { bool_list_ = value_arg; } -const EncodableMap& AllTypes::map() const { return map_; } -void AllTypes::set_map(const EncodableMap& value_arg) { map_ = value_arg; } +const EncodableMap& AllTypes::map() const { + return map_; +} + +void AllTypes::set_map(const EncodableMap& value_arg) { + map_ = value_arg; +} + EncodableList AllTypes::ToEncodableList() const { EncodableList list; @@ -184,16 +248,23 @@ EncodableList AllTypes::ToEncodableList() const { AllTypes AllTypes::FromEncodableList(const EncodableList& list) { AllTypes decoded( - std::get(list[0]), list[1].LongValue(), list[2].LongValue(), - std::get(list[3]), std::get>(list[4]), - std::get>(list[5]), - std::get>(list[6]), - std::get>(list[7]), - std::any_cast(std::get(list[8])), - std::get(list[9]), list[10], - std::get(list[11]), std::get(list[12]), - std::get(list[13]), std::get(list[14]), - std::get(list[15]), std::get(list[16])); + std::get(list[0]), + list[1].LongValue(), + list[2].LongValue(), + std::get(list[3]), + std::get>(list[4]), + std::get>(list[5]), + std::get>(list[6]), + std::get>(list[7]), + std::any_cast(std::get(list[8])), + std::get(list[9]), + list[10], + std::get(list[11]), + std::get(list[12]), + std::get(list[13]), + std::get(list[14]), + std::get(list[15]), + std::get(list[16])); return decoded; } @@ -202,160 +273,74 @@ AllTypes AllTypes::FromEncodableList(const EncodableList& list) { AllNullableTypes::AllNullableTypes() {} AllNullableTypes::AllNullableTypes( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const int64_t* a_nullable_int64, const double* a_nullable_double, - const std::vector* a_nullable_byte_array, - const std::vector* a_nullable4_byte_array, - const std::vector* a_nullable8_byte_array, - const std::vector* a_nullable_float_array, - const EncodableList* nullable_nested_list, - const EncodableMap* nullable_map_with_annotations, - const EncodableMap* nullable_map_with_object, const AnEnum* a_nullable_enum, - const std::string* a_nullable_string, - const EncodableValue* a_nullable_object, - const AllNullableTypes* all_nullable_types, const EncodableList* list, - const EncodableList* string_list, const EncodableList* int_list, - const EncodableList* double_list, const EncodableList* bool_list, - const EncodableList* nested_class_list, const EncodableMap* map) - : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) - : std::nullopt), - a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) - : std::nullopt), - a_nullable_int64_(a_nullable_int64 - ? std::optional(*a_nullable_int64) - : std::nullopt), - a_nullable_double_(a_nullable_double - ? std::optional(*a_nullable_double) - : std::nullopt), - a_nullable_byte_array_( - a_nullable_byte_array - ? std::optional>(*a_nullable_byte_array) - : std::nullopt), - a_nullable4_byte_array_( - a_nullable4_byte_array - ? std::optional>(*a_nullable4_byte_array) - : std::nullopt), - a_nullable8_byte_array_( - a_nullable8_byte_array - ? std::optional>(*a_nullable8_byte_array) - : std::nullopt), - a_nullable_float_array_( - a_nullable_float_array - ? std::optional>(*a_nullable_float_array) - : std::nullopt), - nullable_nested_list_(nullable_nested_list ? std::optional( - *nullable_nested_list) - : std::nullopt), - nullable_map_with_annotations_( - nullable_map_with_annotations - ? std::optional(*nullable_map_with_annotations) - : std::nullopt), - nullable_map_with_object_( - nullable_map_with_object - ? std::optional(*nullable_map_with_object) - : std::nullopt), - a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) - : std::nullopt), - a_nullable_string_(a_nullable_string - ? std::optional(*a_nullable_string) - : std::nullopt), - a_nullable_object_(a_nullable_object - ? std::optional(*a_nullable_object) - : std::nullopt), - all_nullable_types_( - all_nullable_types - ? std::make_unique(*all_nullable_types) - : nullptr), - list_(list ? std::optional(*list) : std::nullopt), - string_list_(string_list ? std::optional(*string_list) - : std::nullopt), - int_list_(int_list ? std::optional(*int_list) - : std::nullopt), - double_list_(double_list ? std::optional(*double_list) - : std::nullopt), - bool_list_(bool_list ? std::optional(*bool_list) - : std::nullopt), - nested_class_list_(nested_class_list - ? std::optional(*nested_class_list) - : std::nullopt), - map_(map ? std::optional(*map) : std::nullopt) {} + const bool* a_nullable_bool, + const int64_t* a_nullable_int, + const int64_t* a_nullable_int64, + const double* a_nullable_double, + const std::vector* a_nullable_byte_array, + const std::vector* a_nullable4_byte_array, + const std::vector* a_nullable8_byte_array, + const std::vector* a_nullable_float_array, + const EncodableList* nullable_nested_list, + const EncodableMap* nullable_map_with_annotations, + const EncodableMap* nullable_map_with_object, + const AnEnum* a_nullable_enum, + const std::string* a_nullable_string, + const EncodableValue* a_nullable_object, + const AllNullableTypes* all_nullable_types, + const EncodableList* list, + const EncodableList* string_list, + const EncodableList* int_list, + const EncodableList* double_list, + const EncodableList* bool_list, + const EncodableList* nested_class_list, + const EncodableMap* map) + : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) : std::nullopt), + a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) : std::nullopt), + a_nullable_int64_(a_nullable_int64 ? std::optional(*a_nullable_int64) : std::nullopt), + a_nullable_double_(a_nullable_double ? std::optional(*a_nullable_double) : std::nullopt), + a_nullable_byte_array_(a_nullable_byte_array ? std::optional>(*a_nullable_byte_array) : std::nullopt), + a_nullable4_byte_array_(a_nullable4_byte_array ? std::optional>(*a_nullable4_byte_array) : std::nullopt), + a_nullable8_byte_array_(a_nullable8_byte_array ? std::optional>(*a_nullable8_byte_array) : std::nullopt), + a_nullable_float_array_(a_nullable_float_array ? std::optional>(*a_nullable_float_array) : std::nullopt), + nullable_nested_list_(nullable_nested_list ? std::optional(*nullable_nested_list) : std::nullopt), + nullable_map_with_annotations_(nullable_map_with_annotations ? std::optional(*nullable_map_with_annotations) : std::nullopt), + nullable_map_with_object_(nullable_map_with_object ? std::optional(*nullable_map_with_object) : std::nullopt), + a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) : std::nullopt), + a_nullable_string_(a_nullable_string ? std::optional(*a_nullable_string) : std::nullopt), + a_nullable_object_(a_nullable_object ? std::optional(*a_nullable_object) : std::nullopt), + all_nullable_types_(all_nullable_types ? std::make_unique(*all_nullable_types) : nullptr), + list_(list ? std::optional(*list) : std::nullopt), + string_list_(string_list ? std::optional(*string_list) : std::nullopt), + int_list_(int_list ? std::optional(*int_list) : std::nullopt), + double_list_(double_list ? std::optional(*double_list) : std::nullopt), + bool_list_(bool_list ? std::optional(*bool_list) : std::nullopt), + nested_class_list_(nested_class_list ? std::optional(*nested_class_list) : std::nullopt), + map_(map ? std::optional(*map) : std::nullopt) {} AllNullableTypes::AllNullableTypes(const AllNullableTypes& other) - : a_nullable_bool_(other.a_nullable_bool_ - ? std::optional(*other.a_nullable_bool_) - : std::nullopt), - a_nullable_int_(other.a_nullable_int_ - ? std::optional(*other.a_nullable_int_) - : std::nullopt), - a_nullable_int64_(other.a_nullable_int64_ - ? std::optional(*other.a_nullable_int64_) - : std::nullopt), - a_nullable_double_(other.a_nullable_double_ - ? std::optional(*other.a_nullable_double_) - : std::nullopt), - a_nullable_byte_array_(other.a_nullable_byte_array_ - ? std::optional>( - *other.a_nullable_byte_array_) - : std::nullopt), - a_nullable4_byte_array_(other.a_nullable4_byte_array_ - ? std::optional>( - *other.a_nullable4_byte_array_) - : std::nullopt), - a_nullable8_byte_array_(other.a_nullable8_byte_array_ - ? std::optional>( - *other.a_nullable8_byte_array_) - : std::nullopt), - a_nullable_float_array_(other.a_nullable_float_array_ - ? std::optional>( - *other.a_nullable_float_array_) - : std::nullopt), - nullable_nested_list_( - other.nullable_nested_list_ - ? std::optional(*other.nullable_nested_list_) - : std::nullopt), - nullable_map_with_annotations_( - other.nullable_map_with_annotations_ - ? std::optional( - *other.nullable_map_with_annotations_) - : std::nullopt), - nullable_map_with_object_( - other.nullable_map_with_object_ - ? std::optional(*other.nullable_map_with_object_) - : std::nullopt), - a_nullable_enum_(other.a_nullable_enum_ - ? std::optional(*other.a_nullable_enum_) - : std::nullopt), - a_nullable_string_( - other.a_nullable_string_ - ? std::optional(*other.a_nullable_string_) - : std::nullopt), - a_nullable_object_( - other.a_nullable_object_ - ? std::optional(*other.a_nullable_object_) - : std::nullopt), - all_nullable_types_( - other.all_nullable_types_ - ? std::make_unique(*other.all_nullable_types_) - : nullptr), - list_(other.list_ ? std::optional(*other.list_) - : std::nullopt), - string_list_(other.string_list_ - ? std::optional(*other.string_list_) - : std::nullopt), - int_list_(other.int_list_ ? std::optional(*other.int_list_) - : std::nullopt), - double_list_(other.double_list_ - ? std::optional(*other.double_list_) - : std::nullopt), - bool_list_(other.bool_list_ - ? std::optional(*other.bool_list_) - : std::nullopt), - nested_class_list_( - other.nested_class_list_ - ? std::optional(*other.nested_class_list_) - : std::nullopt), - map_(other.map_ ? std::optional(*other.map_) - : std::nullopt) {} + : a_nullable_bool_(other.a_nullable_bool_ ? std::optional(*other.a_nullable_bool_) : std::nullopt), + a_nullable_int_(other.a_nullable_int_ ? std::optional(*other.a_nullable_int_) : std::nullopt), + a_nullable_int64_(other.a_nullable_int64_ ? std::optional(*other.a_nullable_int64_) : std::nullopt), + a_nullable_double_(other.a_nullable_double_ ? std::optional(*other.a_nullable_double_) : std::nullopt), + a_nullable_byte_array_(other.a_nullable_byte_array_ ? std::optional>(*other.a_nullable_byte_array_) : std::nullopt), + a_nullable4_byte_array_(other.a_nullable4_byte_array_ ? std::optional>(*other.a_nullable4_byte_array_) : std::nullopt), + a_nullable8_byte_array_(other.a_nullable8_byte_array_ ? std::optional>(*other.a_nullable8_byte_array_) : std::nullopt), + a_nullable_float_array_(other.a_nullable_float_array_ ? std::optional>(*other.a_nullable_float_array_) : std::nullopt), + nullable_nested_list_(other.nullable_nested_list_ ? std::optional(*other.nullable_nested_list_) : std::nullopt), + nullable_map_with_annotations_(other.nullable_map_with_annotations_ ? std::optional(*other.nullable_map_with_annotations_) : std::nullopt), + nullable_map_with_object_(other.nullable_map_with_object_ ? std::optional(*other.nullable_map_with_object_) : std::nullopt), + a_nullable_enum_(other.a_nullable_enum_ ? std::optional(*other.a_nullable_enum_) : std::nullopt), + a_nullable_string_(other.a_nullable_string_ ? std::optional(*other.a_nullable_string_) : std::nullopt), + a_nullable_object_(other.a_nullable_object_ ? std::optional(*other.a_nullable_object_) : std::nullopt), + all_nullable_types_(other.all_nullable_types_ ? std::make_unique(*other.all_nullable_types_) : nullptr), + list_(other.list_ ? std::optional(*other.list_) : std::nullopt), + string_list_(other.string_list_ ? std::optional(*other.string_list_) : std::nullopt), + int_list_(other.int_list_ ? std::optional(*other.int_list_) : std::nullopt), + double_list_(other.double_list_ ? std::optional(*other.double_list_) : std::nullopt), + bool_list_(other.bool_list_ ? std::optional(*other.bool_list_) : std::nullopt), + nested_class_list_(other.nested_class_list_ ? std::optional(*other.nested_class_list_) : std::nullopt), + map_(other.map_ ? std::optional(*other.map_) : std::nullopt) {} AllNullableTypes& AllNullableTypes::operator=(const AllNullableTypes& other) { a_nullable_bool_ = other.a_nullable_bool_; @@ -372,10 +357,7 @@ AllNullableTypes& AllNullableTypes::operator=(const AllNullableTypes& other) { a_nullable_enum_ = other.a_nullable_enum_; a_nullable_string_ = other.a_nullable_string_; a_nullable_object_ = other.a_nullable_object_; - all_nullable_types_ = - other.all_nullable_types_ - ? std::make_unique(*other.all_nullable_types_) - : nullptr; + all_nullable_types_ = other.all_nullable_types_ ? std::make_unique(*other.all_nullable_types_) : nullptr; list_ = other.list_; string_list_ = other.string_list_; int_list_ = other.int_list_; @@ -398,209 +380,189 @@ void AllNullableTypes::set_a_nullable_bool(bool value_arg) { a_nullable_bool_ = value_arg; } + const int64_t* AllNullableTypes::a_nullable_int() const { return a_nullable_int_ ? &(*a_nullable_int_) : nullptr; } void AllNullableTypes::set_a_nullable_int(const int64_t* value_arg) { - a_nullable_int_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + a_nullable_int_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_int(int64_t value_arg) { a_nullable_int_ = value_arg; } + const int64_t* AllNullableTypes::a_nullable_int64() const { return a_nullable_int64_ ? &(*a_nullable_int64_) : nullptr; } void AllNullableTypes::set_a_nullable_int64(const int64_t* value_arg) { - a_nullable_int64_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + a_nullable_int64_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_int64(int64_t value_arg) { a_nullable_int64_ = value_arg; } + const double* AllNullableTypes::a_nullable_double() const { return a_nullable_double_ ? &(*a_nullable_double_) : nullptr; } void AllNullableTypes::set_a_nullable_double(const double* value_arg) { - a_nullable_double_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + a_nullable_double_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_double(double value_arg) { a_nullable_double_ = value_arg; } + const std::vector* AllNullableTypes::a_nullable_byte_array() const { return a_nullable_byte_array_ ? &(*a_nullable_byte_array_) : nullptr; } -void AllNullableTypes::set_a_nullable_byte_array( - const std::vector* value_arg) { - a_nullable_byte_array_ = value_arg - ? std::optional>(*value_arg) - : std::nullopt; +void AllNullableTypes::set_a_nullable_byte_array(const std::vector* value_arg) { + a_nullable_byte_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; } -void AllNullableTypes::set_a_nullable_byte_array( - const std::vector& value_arg) { +void AllNullableTypes::set_a_nullable_byte_array(const std::vector& value_arg) { a_nullable_byte_array_ = value_arg; } + const std::vector* AllNullableTypes::a_nullable4_byte_array() const { return a_nullable4_byte_array_ ? &(*a_nullable4_byte_array_) : nullptr; } -void AllNullableTypes::set_a_nullable4_byte_array( - const std::vector* value_arg) { - a_nullable4_byte_array_ = - value_arg ? std::optional>(*value_arg) - : std::nullopt; +void AllNullableTypes::set_a_nullable4_byte_array(const std::vector* value_arg) { + a_nullable4_byte_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; } -void AllNullableTypes::set_a_nullable4_byte_array( - const std::vector& value_arg) { +void AllNullableTypes::set_a_nullable4_byte_array(const std::vector& value_arg) { a_nullable4_byte_array_ = value_arg; } + const std::vector* AllNullableTypes::a_nullable8_byte_array() const { return a_nullable8_byte_array_ ? &(*a_nullable8_byte_array_) : nullptr; } -void AllNullableTypes::set_a_nullable8_byte_array( - const std::vector* value_arg) { - a_nullable8_byte_array_ = - value_arg ? std::optional>(*value_arg) - : std::nullopt; +void AllNullableTypes::set_a_nullable8_byte_array(const std::vector* value_arg) { + a_nullable8_byte_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; } -void AllNullableTypes::set_a_nullable8_byte_array( - const std::vector& value_arg) { +void AllNullableTypes::set_a_nullable8_byte_array(const std::vector& value_arg) { a_nullable8_byte_array_ = value_arg; } + const std::vector* AllNullableTypes::a_nullable_float_array() const { return a_nullable_float_array_ ? &(*a_nullable_float_array_) : nullptr; } -void AllNullableTypes::set_a_nullable_float_array( - const std::vector* value_arg) { - a_nullable_float_array_ = - value_arg ? std::optional>(*value_arg) : std::nullopt; +void AllNullableTypes::set_a_nullable_float_array(const std::vector* value_arg) { + a_nullable_float_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; } -void AllNullableTypes::set_a_nullable_float_array( - const std::vector& value_arg) { +void AllNullableTypes::set_a_nullable_float_array(const std::vector& value_arg) { a_nullable_float_array_ = value_arg; } + const EncodableList* AllNullableTypes::nullable_nested_list() const { return nullable_nested_list_ ? &(*nullable_nested_list_) : nullptr; } -void AllNullableTypes::set_nullable_nested_list( - const EncodableList* value_arg) { - nullable_nested_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypes::set_nullable_nested_list(const EncodableList* value_arg) { + nullable_nested_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypes::set_nullable_nested_list( - const EncodableList& value_arg) { +void AllNullableTypes::set_nullable_nested_list(const EncodableList& value_arg) { nullable_nested_list_ = value_arg; } + const EncodableMap* AllNullableTypes::nullable_map_with_annotations() const { - return nullable_map_with_annotations_ ? &(*nullable_map_with_annotations_) - : nullptr; + return nullable_map_with_annotations_ ? &(*nullable_map_with_annotations_) : nullptr; } -void AllNullableTypes::set_nullable_map_with_annotations( - const EncodableMap* value_arg) { - nullable_map_with_annotations_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypes::set_nullable_map_with_annotations(const EncodableMap* value_arg) { + nullable_map_with_annotations_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypes::set_nullable_map_with_annotations( - const EncodableMap& value_arg) { +void AllNullableTypes::set_nullable_map_with_annotations(const EncodableMap& value_arg) { nullable_map_with_annotations_ = value_arg; } + const EncodableMap* AllNullableTypes::nullable_map_with_object() const { return nullable_map_with_object_ ? &(*nullable_map_with_object_) : nullptr; } -void AllNullableTypes::set_nullable_map_with_object( - const EncodableMap* value_arg) { - nullable_map_with_object_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypes::set_nullable_map_with_object(const EncodableMap* value_arg) { + nullable_map_with_object_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypes::set_nullable_map_with_object( - const EncodableMap& value_arg) { +void AllNullableTypes::set_nullable_map_with_object(const EncodableMap& value_arg) { nullable_map_with_object_ = value_arg; } + const AnEnum* AllNullableTypes::a_nullable_enum() const { return a_nullable_enum_ ? &(*a_nullable_enum_) : nullptr; } void AllNullableTypes::set_a_nullable_enum(const AnEnum* value_arg) { - a_nullable_enum_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + a_nullable_enum_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_enum(const AnEnum& value_arg) { a_nullable_enum_ = value_arg; } + const std::string* AllNullableTypes::a_nullable_string() const { return a_nullable_string_ ? &(*a_nullable_string_) : nullptr; } -void AllNullableTypes::set_a_nullable_string( - const std::string_view* value_arg) { - a_nullable_string_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypes::set_a_nullable_string(const std::string_view* value_arg) { + a_nullable_string_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_string(std::string_view value_arg) { a_nullable_string_ = value_arg; } + const EncodableValue* AllNullableTypes::a_nullable_object() const { return a_nullable_object_ ? &(*a_nullable_object_) : nullptr; } void AllNullableTypes::set_a_nullable_object(const EncodableValue* value_arg) { - a_nullable_object_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + a_nullable_object_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_object(const EncodableValue& value_arg) { a_nullable_object_ = value_arg; } + const AllNullableTypes* AllNullableTypes::all_nullable_types() const { return all_nullable_types_.get(); } -void AllNullableTypes::set_all_nullable_types( - const AllNullableTypes* value_arg) { - all_nullable_types_ = - value_arg ? std::make_unique(*value_arg) : nullptr; +void AllNullableTypes::set_all_nullable_types(const AllNullableTypes* value_arg) { + all_nullable_types_ = value_arg ? std::make_unique(*value_arg) : nullptr; } -void AllNullableTypes::set_all_nullable_types( - const AllNullableTypes& value_arg) { +void AllNullableTypes::set_all_nullable_types(const AllNullableTypes& value_arg) { all_nullable_types_ = std::make_unique(value_arg); } + const EncodableList* AllNullableTypes::list() const { return list_ ? &(*list_) : nullptr; } @@ -613,71 +575,72 @@ void AllNullableTypes::set_list(const EncodableList& value_arg) { list_ = value_arg; } + const EncodableList* AllNullableTypes::string_list() const { return string_list_ ? &(*string_list_) : nullptr; } void AllNullableTypes::set_string_list(const EncodableList* value_arg) { - string_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + string_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_string_list(const EncodableList& value_arg) { string_list_ = value_arg; } + const EncodableList* AllNullableTypes::int_list() const { return int_list_ ? &(*int_list_) : nullptr; } void AllNullableTypes::set_int_list(const EncodableList* value_arg) { - int_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + int_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_int_list(const EncodableList& value_arg) { int_list_ = value_arg; } + const EncodableList* AllNullableTypes::double_list() const { return double_list_ ? &(*double_list_) : nullptr; } void AllNullableTypes::set_double_list(const EncodableList* value_arg) { - double_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + double_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_double_list(const EncodableList& value_arg) { double_list_ = value_arg; } + const EncodableList* AllNullableTypes::bool_list() const { return bool_list_ ? &(*bool_list_) : nullptr; } void AllNullableTypes::set_bool_list(const EncodableList* value_arg) { - bool_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + bool_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_bool_list(const EncodableList& value_arg) { bool_list_ = value_arg; } + const EncodableList* AllNullableTypes::nested_class_list() const { return nested_class_list_ ? &(*nested_class_list_) : nullptr; } void AllNullableTypes::set_nested_class_list(const EncodableList* value_arg) { - nested_class_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + nested_class_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_nested_class_list(const EncodableList& value_arg) { nested_class_list_ = value_arg; } + const EncodableMap* AllNullableTypes::map() const { return map_ ? &(*map_) : nullptr; } @@ -690,60 +653,36 @@ void AllNullableTypes::set_map(const EncodableMap& value_arg) { map_ = value_arg; } + EncodableList AllNullableTypes::ToEncodableList() const { EncodableList list; list.reserve(22); - list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) - : EncodableValue()); - list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) - : EncodableValue()); - list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) - : EncodableValue()); - list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) - : EncodableValue()); - list.push_back(a_nullable_byte_array_ - ? EncodableValue(*a_nullable_byte_array_) - : EncodableValue()); - list.push_back(a_nullable4_byte_array_ - ? EncodableValue(*a_nullable4_byte_array_) - : EncodableValue()); - list.push_back(a_nullable8_byte_array_ - ? EncodableValue(*a_nullable8_byte_array_) - : EncodableValue()); - list.push_back(a_nullable_float_array_ - ? EncodableValue(*a_nullable_float_array_) - : EncodableValue()); - list.push_back(nullable_nested_list_ ? EncodableValue(*nullable_nested_list_) - : EncodableValue()); - list.push_back(nullable_map_with_annotations_ - ? EncodableValue(*nullable_map_with_annotations_) - : EncodableValue()); - list.push_back(nullable_map_with_object_ - ? EncodableValue(*nullable_map_with_object_) - : EncodableValue()); - list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) - : EncodableValue()); - list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_) - : EncodableValue()); + list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) : EncodableValue()); + list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) : EncodableValue()); + list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) : EncodableValue()); + list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) : EncodableValue()); + list.push_back(a_nullable_byte_array_ ? EncodableValue(*a_nullable_byte_array_) : EncodableValue()); + list.push_back(a_nullable4_byte_array_ ? EncodableValue(*a_nullable4_byte_array_) : EncodableValue()); + list.push_back(a_nullable8_byte_array_ ? EncodableValue(*a_nullable8_byte_array_) : EncodableValue()); + list.push_back(a_nullable_float_array_ ? EncodableValue(*a_nullable_float_array_) : EncodableValue()); + list.push_back(nullable_nested_list_ ? EncodableValue(*nullable_nested_list_) : EncodableValue()); + list.push_back(nullable_map_with_annotations_ ? EncodableValue(*nullable_map_with_annotations_) : EncodableValue()); + list.push_back(nullable_map_with_object_ ? EncodableValue(*nullable_map_with_object_) : EncodableValue()); + list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) : EncodableValue()); + list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_) : EncodableValue()); list.push_back(a_nullable_object_ ? *a_nullable_object_ : EncodableValue()); - list.push_back(all_nullable_types_ - ? CustomEncodableValue(*all_nullable_types_) - : EncodableValue()); + list.push_back(all_nullable_types_ ? CustomEncodableValue(*all_nullable_types_) : EncodableValue()); list.push_back(list_ ? EncodableValue(*list_) : EncodableValue()); - list.push_back(string_list_ ? EncodableValue(*string_list_) - : EncodableValue()); + list.push_back(string_list_ ? EncodableValue(*string_list_) : EncodableValue()); list.push_back(int_list_ ? EncodableValue(*int_list_) : EncodableValue()); - list.push_back(double_list_ ? EncodableValue(*double_list_) - : EncodableValue()); + list.push_back(double_list_ ? EncodableValue(*double_list_) : EncodableValue()); list.push_back(bool_list_ ? EncodableValue(*bool_list_) : EncodableValue()); - list.push_back(nested_class_list_ ? EncodableValue(*nested_class_list_) - : EncodableValue()); + list.push_back(nested_class_list_ ? EncodableValue(*nested_class_list_) : EncodableValue()); list.push_back(map_ ? EncodableValue(*map_) : EncodableValue()); return list; } -AllNullableTypes AllNullableTypes::FromEncodableList( - const EncodableList& list) { +AllNullableTypes AllNullableTypes::FromEncodableList(const EncodableList& list) { AllNullableTypes decoded; auto& encodable_a_nullable_bool = list[0]; if (!encodable_a_nullable_bool.IsNull()) { @@ -759,53 +698,43 @@ AllNullableTypes AllNullableTypes::FromEncodableList( } auto& encodable_a_nullable_double = list[3]; if (!encodable_a_nullable_double.IsNull()) { - decoded.set_a_nullable_double( - std::get(encodable_a_nullable_double)); + decoded.set_a_nullable_double(std::get(encodable_a_nullable_double)); } auto& encodable_a_nullable_byte_array = list[4]; if (!encodable_a_nullable_byte_array.IsNull()) { - decoded.set_a_nullable_byte_array( - std::get>(encodable_a_nullable_byte_array)); + decoded.set_a_nullable_byte_array(std::get>(encodable_a_nullable_byte_array)); } auto& encodable_a_nullable4_byte_array = list[5]; if (!encodable_a_nullable4_byte_array.IsNull()) { - decoded.set_a_nullable4_byte_array( - std::get>(encodable_a_nullable4_byte_array)); + decoded.set_a_nullable4_byte_array(std::get>(encodable_a_nullable4_byte_array)); } auto& encodable_a_nullable8_byte_array = list[6]; if (!encodable_a_nullable8_byte_array.IsNull()) { - decoded.set_a_nullable8_byte_array( - std::get>(encodable_a_nullable8_byte_array)); + decoded.set_a_nullable8_byte_array(std::get>(encodable_a_nullable8_byte_array)); } auto& encodable_a_nullable_float_array = list[7]; if (!encodable_a_nullable_float_array.IsNull()) { - decoded.set_a_nullable_float_array( - std::get>(encodable_a_nullable_float_array)); + decoded.set_a_nullable_float_array(std::get>(encodable_a_nullable_float_array)); } auto& encodable_nullable_nested_list = list[8]; if (!encodable_nullable_nested_list.IsNull()) { - decoded.set_nullable_nested_list( - std::get(encodable_nullable_nested_list)); + decoded.set_nullable_nested_list(std::get(encodable_nullable_nested_list)); } auto& encodable_nullable_map_with_annotations = list[9]; if (!encodable_nullable_map_with_annotations.IsNull()) { - decoded.set_nullable_map_with_annotations( - std::get(encodable_nullable_map_with_annotations)); + decoded.set_nullable_map_with_annotations(std::get(encodable_nullable_map_with_annotations)); } auto& encodable_nullable_map_with_object = list[10]; if (!encodable_nullable_map_with_object.IsNull()) { - decoded.set_nullable_map_with_object( - std::get(encodable_nullable_map_with_object)); + decoded.set_nullable_map_with_object(std::get(encodable_nullable_map_with_object)); } auto& encodable_a_nullable_enum = list[11]; if (!encodable_a_nullable_enum.IsNull()) { - decoded.set_a_nullable_enum(std::any_cast( - std::get(encodable_a_nullable_enum))); + decoded.set_a_nullable_enum(std::any_cast(std::get(encodable_a_nullable_enum))); } auto& encodable_a_nullable_string = list[12]; if (!encodable_a_nullable_string.IsNull()) { - decoded.set_a_nullable_string( - std::get(encodable_a_nullable_string)); + decoded.set_a_nullable_string(std::get(encodable_a_nullable_string)); } auto& encodable_a_nullable_object = list[13]; if (!encodable_a_nullable_object.IsNull()) { @@ -813,8 +742,7 @@ AllNullableTypes AllNullableTypes::FromEncodableList( } auto& encodable_all_nullable_types = list[14]; if (!encodable_all_nullable_types.IsNull()) { - decoded.set_all_nullable_types(std::any_cast( - std::get(encodable_all_nullable_types))); + decoded.set_all_nullable_types(std::any_cast(std::get(encodable_all_nullable_types))); } auto& encodable_list = list[15]; if (!encodable_list.IsNull()) { @@ -838,8 +766,7 @@ AllNullableTypes AllNullableTypes::FromEncodableList( } auto& encodable_nested_class_list = list[20]; if (!encodable_nested_class_list.IsNull()) { - decoded.set_nested_class_list( - std::get(encodable_nested_class_list)); + decoded.set_nested_class_list(std::get(encodable_nested_class_list)); } auto& encodable_map = list[21]; if (!encodable_map.IsNull()) { @@ -853,82 +780,52 @@ AllNullableTypes AllNullableTypes::FromEncodableList( AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion() {} AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const int64_t* a_nullable_int64, const double* a_nullable_double, - const std::vector* a_nullable_byte_array, - const std::vector* a_nullable4_byte_array, - const std::vector* a_nullable8_byte_array, - const std::vector* a_nullable_float_array, - const EncodableList* nullable_nested_list, - const EncodableMap* nullable_map_with_annotations, - const EncodableMap* nullable_map_with_object, const AnEnum* a_nullable_enum, - const std::string* a_nullable_string, - const EncodableValue* a_nullable_object, const EncodableList* list, - const EncodableList* string_list, const EncodableList* int_list, - const EncodableList* double_list, const EncodableList* bool_list, - const EncodableMap* map) - : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) - : std::nullopt), - a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) - : std::nullopt), - a_nullable_int64_(a_nullable_int64 - ? std::optional(*a_nullable_int64) - : std::nullopt), - a_nullable_double_(a_nullable_double - ? std::optional(*a_nullable_double) - : std::nullopt), - a_nullable_byte_array_( - a_nullable_byte_array - ? std::optional>(*a_nullable_byte_array) - : std::nullopt), - a_nullable4_byte_array_( - a_nullable4_byte_array - ? std::optional>(*a_nullable4_byte_array) - : std::nullopt), - a_nullable8_byte_array_( - a_nullable8_byte_array - ? std::optional>(*a_nullable8_byte_array) - : std::nullopt), - a_nullable_float_array_( - a_nullable_float_array - ? std::optional>(*a_nullable_float_array) - : std::nullopt), - nullable_nested_list_(nullable_nested_list ? std::optional( - *nullable_nested_list) - : std::nullopt), - nullable_map_with_annotations_( - nullable_map_with_annotations - ? std::optional(*nullable_map_with_annotations) - : std::nullopt), - nullable_map_with_object_( - nullable_map_with_object - ? std::optional(*nullable_map_with_object) - : std::nullopt), - a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) - : std::nullopt), - a_nullable_string_(a_nullable_string - ? std::optional(*a_nullable_string) - : std::nullopt), - a_nullable_object_(a_nullable_object - ? std::optional(*a_nullable_object) - : std::nullopt), - list_(list ? std::optional(*list) : std::nullopt), - string_list_(string_list ? std::optional(*string_list) - : std::nullopt), - int_list_(int_list ? std::optional(*int_list) - : std::nullopt), - double_list_(double_list ? std::optional(*double_list) - : std::nullopt), - bool_list_(bool_list ? std::optional(*bool_list) - : std::nullopt), - map_(map ? std::optional(*map) : std::nullopt) {} + const bool* a_nullable_bool, + const int64_t* a_nullable_int, + const int64_t* a_nullable_int64, + const double* a_nullable_double, + const std::vector* a_nullable_byte_array, + const std::vector* a_nullable4_byte_array, + const std::vector* a_nullable8_byte_array, + const std::vector* a_nullable_float_array, + const EncodableList* nullable_nested_list, + const EncodableMap* nullable_map_with_annotations, + const EncodableMap* nullable_map_with_object, + const AnEnum* a_nullable_enum, + const std::string* a_nullable_string, + const EncodableValue* a_nullable_object, + const EncodableList* list, + const EncodableList* string_list, + const EncodableList* int_list, + const EncodableList* double_list, + const EncodableList* bool_list, + const EncodableMap* map) + : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) : std::nullopt), + a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) : std::nullopt), + a_nullable_int64_(a_nullable_int64 ? std::optional(*a_nullable_int64) : std::nullopt), + a_nullable_double_(a_nullable_double ? std::optional(*a_nullable_double) : std::nullopt), + a_nullable_byte_array_(a_nullable_byte_array ? std::optional>(*a_nullable_byte_array) : std::nullopt), + a_nullable4_byte_array_(a_nullable4_byte_array ? std::optional>(*a_nullable4_byte_array) : std::nullopt), + a_nullable8_byte_array_(a_nullable8_byte_array ? std::optional>(*a_nullable8_byte_array) : std::nullopt), + a_nullable_float_array_(a_nullable_float_array ? std::optional>(*a_nullable_float_array) : std::nullopt), + nullable_nested_list_(nullable_nested_list ? std::optional(*nullable_nested_list) : std::nullopt), + nullable_map_with_annotations_(nullable_map_with_annotations ? std::optional(*nullable_map_with_annotations) : std::nullopt), + nullable_map_with_object_(nullable_map_with_object ? std::optional(*nullable_map_with_object) : std::nullopt), + a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) : std::nullopt), + a_nullable_string_(a_nullable_string ? std::optional(*a_nullable_string) : std::nullopt), + a_nullable_object_(a_nullable_object ? std::optional(*a_nullable_object) : std::nullopt), + list_(list ? std::optional(*list) : std::nullopt), + string_list_(string_list ? std::optional(*string_list) : std::nullopt), + int_list_(int_list ? std::optional(*int_list) : std::nullopt), + double_list_(double_list ? std::optional(*double_list) : std::nullopt), + bool_list_(bool_list ? std::optional(*bool_list) : std::nullopt), + map_(map ? std::optional(*map) : std::nullopt) {} const bool* AllNullableTypesWithoutRecursion::a_nullable_bool() const { return a_nullable_bool_ ? &(*a_nullable_bool_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_bool( - const bool* value_arg) { +void AllNullableTypesWithoutRecursion::set_a_nullable_bool(const bool* value_arg) { a_nullable_bool_ = value_arg ? std::optional(*value_arg) : std::nullopt; } @@ -936,284 +833,241 @@ void AllNullableTypesWithoutRecursion::set_a_nullable_bool(bool value_arg) { a_nullable_bool_ = value_arg; } + const int64_t* AllNullableTypesWithoutRecursion::a_nullable_int() const { return a_nullable_int_ ? &(*a_nullable_int_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_int( - const int64_t* value_arg) { - a_nullable_int_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable_int(const int64_t* value_arg) { + a_nullable_int_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypesWithoutRecursion::set_a_nullable_int(int64_t value_arg) { a_nullable_int_ = value_arg; } + const int64_t* AllNullableTypesWithoutRecursion::a_nullable_int64() const { return a_nullable_int64_ ? &(*a_nullable_int64_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_int64( - const int64_t* value_arg) { - a_nullable_int64_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable_int64(const int64_t* value_arg) { + a_nullable_int64_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypesWithoutRecursion::set_a_nullable_int64(int64_t value_arg) { a_nullable_int64_ = value_arg; } + const double* AllNullableTypesWithoutRecursion::a_nullable_double() const { return a_nullable_double_ ? &(*a_nullable_double_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_double( - const double* value_arg) { - a_nullable_double_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable_double(const double* value_arg) { + a_nullable_double_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypesWithoutRecursion::set_a_nullable_double(double value_arg) { a_nullable_double_ = value_arg; } -const std::vector* -AllNullableTypesWithoutRecursion::a_nullable_byte_array() const { + +const std::vector* AllNullableTypesWithoutRecursion::a_nullable_byte_array() const { return a_nullable_byte_array_ ? &(*a_nullable_byte_array_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_byte_array( - const std::vector* value_arg) { - a_nullable_byte_array_ = value_arg - ? std::optional>(*value_arg) - : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable_byte_array(const std::vector* value_arg) { + a_nullable_byte_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_a_nullable_byte_array( - const std::vector& value_arg) { +void AllNullableTypesWithoutRecursion::set_a_nullable_byte_array(const std::vector& value_arg) { a_nullable_byte_array_ = value_arg; } -const std::vector* -AllNullableTypesWithoutRecursion::a_nullable4_byte_array() const { + +const std::vector* AllNullableTypesWithoutRecursion::a_nullable4_byte_array() const { return a_nullable4_byte_array_ ? &(*a_nullable4_byte_array_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable4_byte_array( - const std::vector* value_arg) { - a_nullable4_byte_array_ = - value_arg ? std::optional>(*value_arg) - : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable4_byte_array(const std::vector* value_arg) { + a_nullable4_byte_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_a_nullable4_byte_array( - const std::vector& value_arg) { +void AllNullableTypesWithoutRecursion::set_a_nullable4_byte_array(const std::vector& value_arg) { a_nullable4_byte_array_ = value_arg; } -const std::vector* -AllNullableTypesWithoutRecursion::a_nullable8_byte_array() const { + +const std::vector* AllNullableTypesWithoutRecursion::a_nullable8_byte_array() const { return a_nullable8_byte_array_ ? &(*a_nullable8_byte_array_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable8_byte_array( - const std::vector* value_arg) { - a_nullable8_byte_array_ = - value_arg ? std::optional>(*value_arg) - : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable8_byte_array(const std::vector* value_arg) { + a_nullable8_byte_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_a_nullable8_byte_array( - const std::vector& value_arg) { +void AllNullableTypesWithoutRecursion::set_a_nullable8_byte_array(const std::vector& value_arg) { a_nullable8_byte_array_ = value_arg; } -const std::vector* -AllNullableTypesWithoutRecursion::a_nullable_float_array() const { + +const std::vector* AllNullableTypesWithoutRecursion::a_nullable_float_array() const { return a_nullable_float_array_ ? &(*a_nullable_float_array_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_float_array( - const std::vector* value_arg) { - a_nullable_float_array_ = - value_arg ? std::optional>(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable_float_array(const std::vector* value_arg) { + a_nullable_float_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_a_nullable_float_array( - const std::vector& value_arg) { +void AllNullableTypesWithoutRecursion::set_a_nullable_float_array(const std::vector& value_arg) { a_nullable_float_array_ = value_arg; } -const EncodableList* AllNullableTypesWithoutRecursion::nullable_nested_list() - const { + +const EncodableList* AllNullableTypesWithoutRecursion::nullable_nested_list() const { return nullable_nested_list_ ? &(*nullable_nested_list_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_nullable_nested_list( - const EncodableList* value_arg) { - nullable_nested_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_nullable_nested_list(const EncodableList* value_arg) { + nullable_nested_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_nullable_nested_list( - const EncodableList& value_arg) { +void AllNullableTypesWithoutRecursion::set_nullable_nested_list(const EncodableList& value_arg) { nullable_nested_list_ = value_arg; } -const EncodableMap* -AllNullableTypesWithoutRecursion::nullable_map_with_annotations() const { - return nullable_map_with_annotations_ ? &(*nullable_map_with_annotations_) - : nullptr; + +const EncodableMap* AllNullableTypesWithoutRecursion::nullable_map_with_annotations() const { + return nullable_map_with_annotations_ ? &(*nullable_map_with_annotations_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_nullable_map_with_annotations( - const EncodableMap* value_arg) { - nullable_map_with_annotations_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_nullable_map_with_annotations(const EncodableMap* value_arg) { + nullable_map_with_annotations_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_nullable_map_with_annotations( - const EncodableMap& value_arg) { +void AllNullableTypesWithoutRecursion::set_nullable_map_with_annotations(const EncodableMap& value_arg) { nullable_map_with_annotations_ = value_arg; } -const EncodableMap* AllNullableTypesWithoutRecursion::nullable_map_with_object() - const { + +const EncodableMap* AllNullableTypesWithoutRecursion::nullable_map_with_object() const { return nullable_map_with_object_ ? &(*nullable_map_with_object_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_nullable_map_with_object( - const EncodableMap* value_arg) { - nullable_map_with_object_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_nullable_map_with_object(const EncodableMap* value_arg) { + nullable_map_with_object_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_nullable_map_with_object( - const EncodableMap& value_arg) { +void AllNullableTypesWithoutRecursion::set_nullable_map_with_object(const EncodableMap& value_arg) { nullable_map_with_object_ = value_arg; } + const AnEnum* AllNullableTypesWithoutRecursion::a_nullable_enum() const { return a_nullable_enum_ ? &(*a_nullable_enum_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_enum( - const AnEnum* value_arg) { - a_nullable_enum_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable_enum(const AnEnum* value_arg) { + a_nullable_enum_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_a_nullable_enum( - const AnEnum& value_arg) { +void AllNullableTypesWithoutRecursion::set_a_nullable_enum(const AnEnum& value_arg) { a_nullable_enum_ = value_arg; } + const std::string* AllNullableTypesWithoutRecursion::a_nullable_string() const { return a_nullable_string_ ? &(*a_nullable_string_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_string( - const std::string_view* value_arg) { - a_nullable_string_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable_string(const std::string_view* value_arg) { + a_nullable_string_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_a_nullable_string( - std::string_view value_arg) { +void AllNullableTypesWithoutRecursion::set_a_nullable_string(std::string_view value_arg) { a_nullable_string_ = value_arg; } -const EncodableValue* AllNullableTypesWithoutRecursion::a_nullable_object() - const { + +const EncodableValue* AllNullableTypesWithoutRecursion::a_nullable_object() const { return a_nullable_object_ ? &(*a_nullable_object_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_object( - const EncodableValue* value_arg) { - a_nullable_object_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable_object(const EncodableValue* value_arg) { + a_nullable_object_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_a_nullable_object( - const EncodableValue& value_arg) { +void AllNullableTypesWithoutRecursion::set_a_nullable_object(const EncodableValue& value_arg) { a_nullable_object_ = value_arg; } + const EncodableList* AllNullableTypesWithoutRecursion::list() const { return list_ ? &(*list_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_list( - const EncodableList* value_arg) { +void AllNullableTypesWithoutRecursion::set_list(const EncodableList* value_arg) { list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_list( - const EncodableList& value_arg) { +void AllNullableTypesWithoutRecursion::set_list(const EncodableList& value_arg) { list_ = value_arg; } + const EncodableList* AllNullableTypesWithoutRecursion::string_list() const { return string_list_ ? &(*string_list_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_string_list( - const EncodableList* value_arg) { - string_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_string_list(const EncodableList* value_arg) { + string_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_string_list( - const EncodableList& value_arg) { +void AllNullableTypesWithoutRecursion::set_string_list(const EncodableList& value_arg) { string_list_ = value_arg; } + const EncodableList* AllNullableTypesWithoutRecursion::int_list() const { return int_list_ ? &(*int_list_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_int_list( - const EncodableList* value_arg) { - int_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_int_list(const EncodableList* value_arg) { + int_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_int_list( - const EncodableList& value_arg) { +void AllNullableTypesWithoutRecursion::set_int_list(const EncodableList& value_arg) { int_list_ = value_arg; } + const EncodableList* AllNullableTypesWithoutRecursion::double_list() const { return double_list_ ? &(*double_list_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_double_list( - const EncodableList* value_arg) { - double_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_double_list(const EncodableList* value_arg) { + double_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_double_list( - const EncodableList& value_arg) { +void AllNullableTypesWithoutRecursion::set_double_list(const EncodableList& value_arg) { double_list_ = value_arg; } + const EncodableList* AllNullableTypesWithoutRecursion::bool_list() const { return bool_list_ ? &(*bool_list_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_bool_list( - const EncodableList* value_arg) { - bool_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_bool_list(const EncodableList* value_arg) { + bool_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_bool_list( - const EncodableList& value_arg) { +void AllNullableTypesWithoutRecursion::set_bool_list(const EncodableList& value_arg) { bool_list_ = value_arg; } + const EncodableMap* AllNullableTypesWithoutRecursion::map() const { return map_ ? &(*map_) : nullptr; } @@ -1226,55 +1080,34 @@ void AllNullableTypesWithoutRecursion::set_map(const EncodableMap& value_arg) { map_ = value_arg; } + EncodableList AllNullableTypesWithoutRecursion::ToEncodableList() const { EncodableList list; list.reserve(20); - list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) - : EncodableValue()); - list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) - : EncodableValue()); - list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) - : EncodableValue()); - list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) - : EncodableValue()); - list.push_back(a_nullable_byte_array_ - ? EncodableValue(*a_nullable_byte_array_) - : EncodableValue()); - list.push_back(a_nullable4_byte_array_ - ? EncodableValue(*a_nullable4_byte_array_) - : EncodableValue()); - list.push_back(a_nullable8_byte_array_ - ? EncodableValue(*a_nullable8_byte_array_) - : EncodableValue()); - list.push_back(a_nullable_float_array_ - ? EncodableValue(*a_nullable_float_array_) - : EncodableValue()); - list.push_back(nullable_nested_list_ ? EncodableValue(*nullable_nested_list_) - : EncodableValue()); - list.push_back(nullable_map_with_annotations_ - ? EncodableValue(*nullable_map_with_annotations_) - : EncodableValue()); - list.push_back(nullable_map_with_object_ - ? EncodableValue(*nullable_map_with_object_) - : EncodableValue()); - list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) - : EncodableValue()); - list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_) - : EncodableValue()); + list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) : EncodableValue()); + list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) : EncodableValue()); + list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) : EncodableValue()); + list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) : EncodableValue()); + list.push_back(a_nullable_byte_array_ ? EncodableValue(*a_nullable_byte_array_) : EncodableValue()); + list.push_back(a_nullable4_byte_array_ ? EncodableValue(*a_nullable4_byte_array_) : EncodableValue()); + list.push_back(a_nullable8_byte_array_ ? EncodableValue(*a_nullable8_byte_array_) : EncodableValue()); + list.push_back(a_nullable_float_array_ ? EncodableValue(*a_nullable_float_array_) : EncodableValue()); + list.push_back(nullable_nested_list_ ? EncodableValue(*nullable_nested_list_) : EncodableValue()); + list.push_back(nullable_map_with_annotations_ ? EncodableValue(*nullable_map_with_annotations_) : EncodableValue()); + list.push_back(nullable_map_with_object_ ? EncodableValue(*nullable_map_with_object_) : EncodableValue()); + list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) : EncodableValue()); + list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_) : EncodableValue()); list.push_back(a_nullable_object_ ? *a_nullable_object_ : EncodableValue()); list.push_back(list_ ? EncodableValue(*list_) : EncodableValue()); - list.push_back(string_list_ ? EncodableValue(*string_list_) - : EncodableValue()); + list.push_back(string_list_ ? EncodableValue(*string_list_) : EncodableValue()); list.push_back(int_list_ ? EncodableValue(*int_list_) : EncodableValue()); - list.push_back(double_list_ ? EncodableValue(*double_list_) - : EncodableValue()); + list.push_back(double_list_ ? EncodableValue(*double_list_) : EncodableValue()); list.push_back(bool_list_ ? EncodableValue(*bool_list_) : EncodableValue()); list.push_back(map_ ? EncodableValue(*map_) : EncodableValue()); return list; } -AllNullableTypesWithoutRecursion -AllNullableTypesWithoutRecursion::FromEncodableList(const EncodableList& list) { +AllNullableTypesWithoutRecursion AllNullableTypesWithoutRecursion::FromEncodableList(const EncodableList& list) { AllNullableTypesWithoutRecursion decoded; auto& encodable_a_nullable_bool = list[0]; if (!encodable_a_nullable_bool.IsNull()) { @@ -1290,53 +1123,43 @@ AllNullableTypesWithoutRecursion::FromEncodableList(const EncodableList& list) { } auto& encodable_a_nullable_double = list[3]; if (!encodable_a_nullable_double.IsNull()) { - decoded.set_a_nullable_double( - std::get(encodable_a_nullable_double)); + decoded.set_a_nullable_double(std::get(encodable_a_nullable_double)); } auto& encodable_a_nullable_byte_array = list[4]; if (!encodable_a_nullable_byte_array.IsNull()) { - decoded.set_a_nullable_byte_array( - std::get>(encodable_a_nullable_byte_array)); + decoded.set_a_nullable_byte_array(std::get>(encodable_a_nullable_byte_array)); } auto& encodable_a_nullable4_byte_array = list[5]; if (!encodable_a_nullable4_byte_array.IsNull()) { - decoded.set_a_nullable4_byte_array( - std::get>(encodable_a_nullable4_byte_array)); + decoded.set_a_nullable4_byte_array(std::get>(encodable_a_nullable4_byte_array)); } auto& encodable_a_nullable8_byte_array = list[6]; if (!encodable_a_nullable8_byte_array.IsNull()) { - decoded.set_a_nullable8_byte_array( - std::get>(encodable_a_nullable8_byte_array)); + decoded.set_a_nullable8_byte_array(std::get>(encodable_a_nullable8_byte_array)); } auto& encodable_a_nullable_float_array = list[7]; if (!encodable_a_nullable_float_array.IsNull()) { - decoded.set_a_nullable_float_array( - std::get>(encodable_a_nullable_float_array)); + decoded.set_a_nullable_float_array(std::get>(encodable_a_nullable_float_array)); } auto& encodable_nullable_nested_list = list[8]; if (!encodable_nullable_nested_list.IsNull()) { - decoded.set_nullable_nested_list( - std::get(encodable_nullable_nested_list)); + decoded.set_nullable_nested_list(std::get(encodable_nullable_nested_list)); } auto& encodable_nullable_map_with_annotations = list[9]; if (!encodable_nullable_map_with_annotations.IsNull()) { - decoded.set_nullable_map_with_annotations( - std::get(encodable_nullable_map_with_annotations)); + decoded.set_nullable_map_with_annotations(std::get(encodable_nullable_map_with_annotations)); } auto& encodable_nullable_map_with_object = list[10]; if (!encodable_nullable_map_with_object.IsNull()) { - decoded.set_nullable_map_with_object( - std::get(encodable_nullable_map_with_object)); + decoded.set_nullable_map_with_object(std::get(encodable_nullable_map_with_object)); } auto& encodable_a_nullable_enum = list[11]; if (!encodable_a_nullable_enum.IsNull()) { - decoded.set_a_nullable_enum(std::any_cast( - std::get(encodable_a_nullable_enum))); + decoded.set_a_nullable_enum(std::any_cast(std::get(encodable_a_nullable_enum))); } auto& encodable_a_nullable_string = list[12]; if (!encodable_a_nullable_string.IsNull()) { - decoded.set_a_nullable_string( - std::get(encodable_a_nullable_string)); + decoded.set_a_nullable_string(std::get(encodable_a_nullable_string)); } auto& encodable_a_nullable_object = list[13]; if (!encodable_a_nullable_object.IsNull()) { @@ -1372,46 +1195,25 @@ AllNullableTypesWithoutRecursion::FromEncodableList(const EncodableList& list) { // AllClassesWrapper AllClassesWrapper::AllClassesWrapper(const AllNullableTypes& all_nullable_types) - : all_nullable_types_( - std::make_unique(all_nullable_types)) {} - -AllClassesWrapper::AllClassesWrapper(const AllNullableTypes& all_nullable_types, - const AllNullableTypesWithoutRecursion* - all_nullable_types_without_recursion, - const AllTypes* all_types) - : all_nullable_types_( - std::make_unique(all_nullable_types)), - all_nullable_types_without_recursion_( - all_nullable_types_without_recursion - ? std::make_unique( - *all_nullable_types_without_recursion) - : nullptr), - all_types_(all_types ? std::make_unique(*all_types) : nullptr) { -} + : all_nullable_types_(std::make_unique(all_nullable_types)) {} + +AllClassesWrapper::AllClassesWrapper( + const AllNullableTypes& all_nullable_types, + const AllNullableTypesWithoutRecursion* all_nullable_types_without_recursion, + const AllTypes* all_types) + : all_nullable_types_(std::make_unique(all_nullable_types)), + all_nullable_types_without_recursion_(all_nullable_types_without_recursion ? std::make_unique(*all_nullable_types_without_recursion) : nullptr), + all_types_(all_types ? std::make_unique(*all_types) : nullptr) {} AllClassesWrapper::AllClassesWrapper(const AllClassesWrapper& other) - : all_nullable_types_( - std::make_unique(*other.all_nullable_types_)), - all_nullable_types_without_recursion_( - other.all_nullable_types_without_recursion_ - ? std::make_unique( - *other.all_nullable_types_without_recursion_) - : nullptr), - all_types_(other.all_types_ - ? std::make_unique(*other.all_types_) - : nullptr) {} - -AllClassesWrapper& AllClassesWrapper::operator=( - const AllClassesWrapper& other) { - all_nullable_types_ = - std::make_unique(*other.all_nullable_types_); - all_nullable_types_without_recursion_ = - other.all_nullable_types_without_recursion_ - ? std::make_unique( - *other.all_nullable_types_without_recursion_) - : nullptr; - all_types_ = other.all_types_ ? std::make_unique(*other.all_types_) - : nullptr; + : all_nullable_types_(std::make_unique(*other.all_nullable_types_)), + all_nullable_types_without_recursion_(other.all_nullable_types_without_recursion_ ? std::make_unique(*other.all_nullable_types_without_recursion_) : nullptr), + all_types_(other.all_types_ ? std::make_unique(*other.all_types_) : nullptr) {} + +AllClassesWrapper& AllClassesWrapper::operator=(const AllClassesWrapper& other) { + all_nullable_types_ = std::make_unique(*other.all_nullable_types_); + all_nullable_types_without_recursion_ = other.all_nullable_types_without_recursion_ ? std::make_unique(*other.all_nullable_types_without_recursion_) : nullptr; + all_types_ = other.all_types_ ? std::make_unique(*other.all_types_) : nullptr; return *this; } @@ -1419,29 +1221,24 @@ const AllNullableTypes& AllClassesWrapper::all_nullable_types() const { return *all_nullable_types_; } -void AllClassesWrapper::set_all_nullable_types( - const AllNullableTypes& value_arg) { +void AllClassesWrapper::set_all_nullable_types(const AllNullableTypes& value_arg) { all_nullable_types_ = std::make_unique(value_arg); } -const AllNullableTypesWithoutRecursion* -AllClassesWrapper::all_nullable_types_without_recursion() const { + +const AllNullableTypesWithoutRecursion* AllClassesWrapper::all_nullable_types_without_recursion() const { return all_nullable_types_without_recursion_.get(); } -void AllClassesWrapper::set_all_nullable_types_without_recursion( - const AllNullableTypesWithoutRecursion* value_arg) { - all_nullable_types_without_recursion_ = - value_arg ? std::make_unique(*value_arg) - : nullptr; +void AllClassesWrapper::set_all_nullable_types_without_recursion(const AllNullableTypesWithoutRecursion* value_arg) { + all_nullable_types_without_recursion_ = value_arg ? std::make_unique(*value_arg) : nullptr; } -void AllClassesWrapper::set_all_nullable_types_without_recursion( - const AllNullableTypesWithoutRecursion& value_arg) { - all_nullable_types_without_recursion_ = - std::make_unique(value_arg); +void AllClassesWrapper::set_all_nullable_types_without_recursion(const AllNullableTypesWithoutRecursion& value_arg) { + all_nullable_types_without_recursion_ = std::make_unique(value_arg); } + const AllTypes* AllClassesWrapper::all_types() const { return all_types_.get(); } @@ -1454,34 +1251,26 @@ void AllClassesWrapper::set_all_types(const AllTypes& value_arg) { all_types_ = std::make_unique(value_arg); } + EncodableList AllClassesWrapper::ToEncodableList() const { EncodableList list; list.reserve(3); list.push_back(CustomEncodableValue(*all_nullable_types_)); - list.push_back( - all_nullable_types_without_recursion_ - ? CustomEncodableValue(*all_nullable_types_without_recursion_) - : EncodableValue()); - list.push_back(all_types_ ? CustomEncodableValue(*all_types_) - : EncodableValue()); + list.push_back(all_nullable_types_without_recursion_ ? CustomEncodableValue(*all_nullable_types_without_recursion_) : EncodableValue()); + list.push_back(all_types_ ? CustomEncodableValue(*all_types_) : EncodableValue()); return list; } -AllClassesWrapper AllClassesWrapper::FromEncodableList( - const EncodableList& list) { - AllClassesWrapper decoded(std::any_cast( - std::get(list[0]))); +AllClassesWrapper AllClassesWrapper::FromEncodableList(const EncodableList& list) { + AllClassesWrapper decoded( + std::any_cast(std::get(list[0]))); auto& encodable_all_nullable_types_without_recursion = list[1]; if (!encodable_all_nullable_types_without_recursion.IsNull()) { - decoded.set_all_nullable_types_without_recursion( - std::any_cast( - std::get( - encodable_all_nullable_types_without_recursion))); + decoded.set_all_nullable_types_without_recursion(std::any_cast(std::get(encodable_all_nullable_types_without_recursion))); } auto& encodable_all_types = list[2]; if (!encodable_all_types.IsNull()) { - decoded.set_all_types(std::any_cast( - std::get(encodable_all_types))); + decoded.set_all_types(std::any_cast(std::get(encodable_all_types))); } return decoded; } @@ -1491,22 +1280,21 @@ AllClassesWrapper AllClassesWrapper::FromEncodableList( TestMessage::TestMessage() {} TestMessage::TestMessage(const EncodableList* test_list) - : test_list_(test_list ? std::optional(*test_list) - : std::nullopt) {} + : test_list_(test_list ? std::optional(*test_list) : std::nullopt) {} const EncodableList* TestMessage::test_list() const { return test_list_ ? &(*test_list_) : nullptr; } void TestMessage::set_test_list(const EncodableList* value_arg) { - test_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; + test_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } void TestMessage::set_test_list(const EncodableList& value_arg) { test_list_ = value_arg; } + EncodableList TestMessage::ToEncodableList() const { EncodableList list; list.reserve(1); @@ -1523,87 +1311,66 @@ TestMessage TestMessage::FromEncodableList(const EncodableList& list) { return decoded; } + PigeonCodecSerializer::PigeonCodecSerializer() {} EncodableValue PigeonCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { + uint8_t type, + flutter::ByteStreamReader* stream) const { switch (type) { case 129: - return CustomEncodableValue(AllTypes::FromEncodableList( - std::get(ReadValue(stream)))); + return CustomEncodableValue(AllTypes::FromEncodableList(std::get(ReadValue(stream)))); case 130: - return CustomEncodableValue(AllNullableTypes::FromEncodableList( - std::get(ReadValue(stream)))); + return CustomEncodableValue(AllNullableTypes::FromEncodableList(std::get(ReadValue(stream)))); case 131: - return CustomEncodableValue( - AllNullableTypesWithoutRecursion::FromEncodableList( - std::get(ReadValue(stream)))); + return CustomEncodableValue(AllNullableTypesWithoutRecursion::FromEncodableList(std::get(ReadValue(stream)))); case 132: - return CustomEncodableValue(AllClassesWrapper::FromEncodableList( - std::get(ReadValue(stream)))); + return CustomEncodableValue(AllClassesWrapper::FromEncodableList(std::get(ReadValue(stream)))); case 133: - return CustomEncodableValue(TestMessage::FromEncodableList( - std::get(ReadValue(stream)))); - case 134: { - const auto& encodable_enum_arg = ReadValue(stream); - const int64_t enum_arg_value = - encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); - return encodable_enum_arg.IsNull() - ? EncodableValue() - : CustomEncodableValue(static_cast(enum_arg_value)); - } + return CustomEncodableValue(TestMessage::FromEncodableList(std::get(ReadValue(stream)))); + case 134: + { + const auto& encodable_enum_arg = ReadValue(stream); + const int64_t enum_arg_value = encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); + return encodable_enum_arg.IsNull() ? EncodableValue() : CustomEncodableValue(static_cast(enum_arg_value)); + } default: return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); - } + } } void PigeonCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = - std::get_if(&value)) { + const EncodableValue& value, + flutter::ByteStreamWriter* stream) const { + if (const CustomEncodableValue* custom_value = std::get_if(&value)) { if (custom_value->type() == typeid(AllTypes)) { stream->WriteByte(129); - WriteValue(EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); + WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); return; } if (custom_value->type() == typeid(AllNullableTypes)) { stream->WriteByte(130); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); + WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); return; } if (custom_value->type() == typeid(AllNullableTypesWithoutRecursion)) { stream->WriteByte(131); - WriteValue(EncodableValue(std::any_cast( - *custom_value) - .ToEncodableList()), - stream); + WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); return; } if (custom_value->type() == typeid(AllClassesWrapper)) { stream->WriteByte(132); - WriteValue(EncodableValue(std::any_cast(*custom_value) - .ToEncodableList()), - stream); + WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); return; } if (custom_value->type() == typeid(TestMessage)) { stream->WriteByte(133); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); + WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); return; } if (custom_value->type() == typeid(AnEnum)) { stream->WriteByte(134); - WriteValue(EncodableValue( - static_cast(std::any_cast(*custom_value))), - stream); + WriteValue(EncodableValue(static_cast(std::any_cast(*custom_value))), stream); return; } } @@ -1612,706 +1379,516 @@ void PigeonCodecSerializer::WriteValue( /// The codec used by HostIntegrationCoreApi. const flutter::StandardMessageCodec& HostIntegrationCoreApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &PigeonCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance(&PigeonCodecSerializer::GetInstance()); } -// Sets up an instance of `HostIntegrationCoreApi` to handle messages through -// the `binary_messenger`. -void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, - HostIntegrationCoreApi* api) { +// Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binary_messenger`. +void HostIntegrationCoreApi::SetUp( + flutter::BinaryMessenger* binary_messenger, + HostIntegrationCoreApi* api) { HostIntegrationCoreApi::SetUp(binary_messenger, api, ""); } -void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, - HostIntegrationCoreApi* api, - const std::string& message_channel_suffix) { - const std::string prepended_suffix = - message_channel_suffix.length() > 0 - ? std::string(".") + message_channel_suffix - : ""; - { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.noop" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - std::optional output = api->Noop(); - if (output.has_value()) { - reply(WrapError(output.value())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); - } else { - channel.SetMessageHandler(nullptr); - } - } +void HostIntegrationCoreApi::SetUp( + flutter::BinaryMessenger* binary_messenger, + HostIntegrationCoreApi* api, + const std::string& message_channel_suffix) { + const std::string prepended_suffix = message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix : ""; { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAllTypes" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - if (encodable_everything_arg.IsNull()) { - reply(WrapError("everything_arg unexpectedly null.")); - return; - } - const auto& everything_arg = std::any_cast( - std::get(encodable_everything_arg)); - ErrorOr output = api->EchoAllTypes(everything_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + std::optional output = api->Noop(); + if (output.has_value()) { + reply(WrapError(output.value())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.throwError" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - ErrorOr> output = api->ThrowError(); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + if (encodable_everything_arg.IsNull()) { + reply(WrapError("everything_arg unexpectedly null.")); + return; + } + const auto& everything_arg = std::any_cast(std::get(encodable_everything_arg)); + ErrorOr output = api->EchoAllTypes(everything_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.throwErrorFromVoid" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - std::optional output = api->ThrowErrorFromVoid(); - if (output.has_value()) { - reply(WrapError(output.value())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + ErrorOr> output = api->ThrowError(); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.throwFlutterError" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - ErrorOr> output = - api->ThrowFlutterError(); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + std::optional output = api->ThrowErrorFromVoid(); + if (output.has_value()) { + reply(WrapError(output.value())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoInt" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - if (encodable_an_int_arg.IsNull()) { - reply(WrapError("an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = encodable_an_int_arg.LongValue(); - ErrorOr output = api->EchoInt(an_int_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + ErrorOr> output = api->ThrowFlutterError(); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoDouble" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - if (encodable_a_double_arg.IsNull()) { - reply(WrapError("a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = - std::get(encodable_a_double_arg); - ErrorOr output = api->EchoDouble(a_double_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_int_arg = args.at(0); + if (encodable_an_int_arg.IsNull()) { + reply(WrapError("an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = encodable_an_int_arg.LongValue(); + ErrorOr output = api->EchoInt(an_int_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoBool" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_bool_arg = args.at(0); - if (encodable_a_bool_arg.IsNull()) { - reply(WrapError("a_bool_arg unexpectedly null.")); - return; - } - const auto& a_bool_arg = std::get(encodable_a_bool_arg); - ErrorOr output = api->EchoBool(a_bool_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_double_arg = args.at(0); + if (encodable_a_double_arg.IsNull()) { + reply(WrapError("a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = std::get(encodable_a_double_arg); + ErrorOr output = api->EchoDouble(a_double_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - ErrorOr output = api->EchoString(a_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_bool_arg = args.at(0); + if (encodable_a_bool_arg.IsNull()) { + reply(WrapError("a_bool_arg unexpectedly null.")); + return; + } + const auto& a_bool_arg = std::get(encodable_a_bool_arg); + ErrorOr output = api->EchoBool(a_bool_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoUint8List" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_uint8_list_arg = args.at(0); - if (encodable_a_uint8_list_arg.IsNull()) { - reply(WrapError("a_uint8_list_arg unexpectedly null.")); - return; - } - const auto& a_uint8_list_arg = - std::get>(encodable_a_uint8_list_arg); - ErrorOr> output = - api->EchoUint8List(a_uint8_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = std::get(encodable_a_string_arg); + ErrorOr output = api->EchoString(a_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoObject" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_object_arg = args.at(0); - if (encodable_an_object_arg.IsNull()) { - reply(WrapError("an_object_arg unexpectedly null.")); - return; - } - const auto& an_object_arg = encodable_an_object_arg; - ErrorOr output = api->EchoObject(an_object_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); - } else { - channel.SetMessageHandler(nullptr); - } - } - { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoList" + - prepended_suffix, - &GetCodec()); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_uint8_list_arg = args.at(0); + if (encodable_a_uint8_list_arg.IsNull()) { + reply(WrapError("a_uint8_list_arg unexpectedly null.")); + return; + } + const auto& a_uint8_list_arg = std::get>(encodable_a_uint8_list_arg); + ErrorOr> output = api->EchoUint8List(a_uint8_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - if (encodable_list_arg.IsNull()) { - reply(WrapError("list_arg unexpectedly null.")); - return; - } - const auto& list_arg = - std::get(encodable_list_arg); - ErrorOr output = api->EchoList(list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_object_arg = args.at(0); + if (encodable_an_object_arg.IsNull()) { + reply(WrapError("an_object_arg unexpectedly null.")); + return; + } + const auto& an_object_arg = encodable_an_object_arg; + ErrorOr output = api->EchoObject(an_object_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoMap" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - if (encodable_a_map_arg.IsNull()) { - reply(WrapError("a_map_arg unexpectedly null.")); - return; - } - const auto& a_map_arg = - std::get(encodable_a_map_arg); - ErrorOr output = api->EchoMap(a_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + if (encodable_list_arg.IsNull()) { + reply(WrapError("list_arg unexpectedly null.")); + return; + } + const auto& list_arg = std::get(encodable_list_arg); + ErrorOr output = api->EchoList(list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoClassWrapper" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_wrapper_arg = args.at(0); - if (encodable_wrapper_arg.IsNull()) { - reply(WrapError("wrapper_arg unexpectedly null.")); - return; - } - const auto& wrapper_arg = std::any_cast( - std::get(encodable_wrapper_arg)); - ErrorOr output = - api->EchoClassWrapper(wrapper_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_map_arg = args.at(0); + if (encodable_a_map_arg.IsNull()) { + reply(WrapError("a_map_arg unexpectedly null.")); + return; + } + const auto& a_map_arg = std::get(encodable_a_map_arg); + ErrorOr output = api->EchoMap(a_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoEnum" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - if (encodable_an_enum_arg.IsNull()) { - reply(WrapError("an_enum_arg unexpectedly null.")); - return; - } - const auto& an_enum_arg = std::any_cast( - std::get(encodable_an_enum_arg)); - ErrorOr output = api->EchoEnum(an_enum_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_wrapper_arg = args.at(0); + if (encodable_wrapper_arg.IsNull()) { + reply(WrapError("wrapper_arg unexpectedly null.")); + return; + } + const auto& wrapper_arg = std::any_cast(std::get(encodable_wrapper_arg)); + ErrorOr output = api->EchoClassWrapper(wrapper_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNamedDefaultString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - ErrorOr output = - api->EchoNamedDefaultString(a_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + if (encodable_an_enum_arg.IsNull()) { + reply(WrapError("an_enum_arg unexpectedly null.")); + return; + } + const auto& an_enum_arg = std::any_cast(std::get(encodable_an_enum_arg)); + ErrorOr output = api->EchoEnum(an_enum_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoOptionalDefaultDouble" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - if (encodable_a_double_arg.IsNull()) { - reply(WrapError("a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = - std::get(encodable_a_double_arg); - ErrorOr output = - api->EchoOptionalDefaultDouble(a_double_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = std::get(encodable_a_string_arg); + ErrorOr output = api->EchoNamedDefaultString(a_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoRequiredInt" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - if (encodable_an_int_arg.IsNull()) { - reply(WrapError("an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = encodable_an_int_arg.LongValue(); - ErrorOr output = api->EchoRequiredInt(an_int_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_double_arg = args.at(0); + if (encodable_a_double_arg.IsNull()) { + reply(WrapError("a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = std::get(encodable_a_double_arg); + ErrorOr output = api->EchoOptionalDefaultDouble(a_double_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAllNullableTypes" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - ErrorOr> output = - api->EchoAllNullableTypes(everything_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_int_arg = args.at(0); + if (encodable_an_int_arg.IsNull()) { + reply(WrapError("an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = encodable_an_int_arg.LongValue(); + ErrorOr output = api->EchoRequiredInt(an_int_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAllNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api]( - const EncodableValue& message, - const flutter::MessageReply& - reply) { + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - ErrorOr> output = - api->EchoAllNullableTypesWithoutRecursion(everything_arg); + const auto* everything_arg = encodable_everything_arg.IsNull() ? nullptr : &(std::any_cast(std::get(encodable_everything_arg))); + ErrorOr> output = api->EchoAllNullableTypes(everything_arg); if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2319,8 +1896,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, EncodableList wrapped; auto output_optional = std::move(output).TakeValue(); if (output_optional) { - wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); + wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); } else { wrapped.push_back(EncodableValue()); } @@ -2334,1205 +1910,915 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "extractNestedNullableString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_wrapper_arg = args.at(0); - if (encodable_wrapper_arg.IsNull()) { - reply(WrapError("wrapper_arg unexpectedly null.")); - return; - } - const auto& wrapper_arg = std::any_cast( - std::get(encodable_wrapper_arg)); - ErrorOr> output = - api->ExtractNestedNullableString(wrapper_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = encodable_everything_arg.IsNull() ? nullptr : &(std::any_cast(std::get(encodable_everything_arg))); + ErrorOr> output = api->EchoAllNullableTypesWithoutRecursion(everything_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "createNestedNullableString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_nullable_string_arg = args.at(0); - const auto* nullable_string_arg = - std::get_if(&encodable_nullable_string_arg); - ErrorOr output = - api->CreateNestedNullableString(nullable_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_wrapper_arg = args.at(0); + if (encodable_wrapper_arg.IsNull()) { + reply(WrapError("wrapper_arg unexpectedly null.")); + return; + } + const auto& wrapper_arg = std::any_cast(std::get(encodable_wrapper_arg)); + ErrorOr> output = api->ExtractNestedNullableString(wrapper_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "sendMultipleNullableTypes" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = - std::get_if(&encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = args.at(1); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; - const auto& encodable_a_nullable_string_arg = args.at(2); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - ErrorOr output = api->SendMultipleNullableTypes( - a_nullable_bool_arg, a_nullable_int_arg, - a_nullable_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_nullable_string_arg = args.at(0); + const auto* nullable_string_arg = std::get_if(&encodable_nullable_string_arg); + ErrorOr output = api->CreateNestedNullableString(nullable_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "sendMultipleNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = - std::get_if(&encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = args.at(1); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; - const auto& encodable_a_nullable_string_arg = args.at(2); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - ErrorOr output = - api->SendMultipleNullableTypesWithoutRecursion( - a_nullable_bool_arg, a_nullable_int_arg, - a_nullable_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = std::get_if(&encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = args.at(1); + const int64_t a_nullable_int_arg_value = encodable_a_nullable_int_arg.IsNull() ? 0 : encodable_a_nullable_int_arg.LongValue(); + const auto* a_nullable_int_arg = encodable_a_nullable_int_arg.IsNull() ? nullptr : &a_nullable_int_arg_value; + const auto& encodable_a_nullable_string_arg = args.at(2); + const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); + ErrorOr output = api->SendMultipleNullableTypes(a_nullable_bool_arg, a_nullable_int_arg, a_nullable_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableInt" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_int_arg = args.at(0); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; - ErrorOr> output = - api->EchoNullableInt(a_nullable_int_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = std::get_if(&encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = args.at(1); + const int64_t a_nullable_int_arg_value = encodable_a_nullable_int_arg.IsNull() ? 0 : encodable_a_nullable_int_arg.LongValue(); + const auto* a_nullable_int_arg = encodable_a_nullable_int_arg.IsNull() ? nullptr : &a_nullable_int_arg_value; + const auto& encodable_a_nullable_string_arg = args.at(2); + const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); + ErrorOr output = api->SendMultipleNullableTypesWithoutRecursion(a_nullable_bool_arg, a_nullable_int_arg, a_nullable_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableDouble" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_double_arg = args.at(0); - const auto* a_nullable_double_arg = - std::get_if(&encodable_a_nullable_double_arg); - ErrorOr> output = - api->EchoNullableDouble(a_nullable_double_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_int_arg = args.at(0); + const int64_t a_nullable_int_arg_value = encodable_a_nullable_int_arg.IsNull() ? 0 : encodable_a_nullable_int_arg.LongValue(); + const auto* a_nullable_int_arg = encodable_a_nullable_int_arg.IsNull() ? nullptr : &a_nullable_int_arg_value; + ErrorOr> output = api->EchoNullableInt(a_nullable_int_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableBool" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = - std::get_if(&encodable_a_nullable_bool_arg); - ErrorOr> output = - api->EchoNullableBool(a_nullable_bool_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_double_arg = args.at(0); + const auto* a_nullable_double_arg = std::get_if(&encodable_a_nullable_double_arg); + ErrorOr> output = api->EchoNullableDouble(a_nullable_double_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_string_arg = args.at(0); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - ErrorOr> output = - api->EchoNullableString(a_nullable_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = std::get_if(&encodable_a_nullable_bool_arg); + ErrorOr> output = api->EchoNullableBool(a_nullable_bool_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNullableUint8List" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_uint8_list_arg = args.at(0); - const auto* a_nullable_uint8_list_arg = - std::get_if>( - &encodable_a_nullable_uint8_list_arg); - ErrorOr>> output = - api->EchoNullableUint8List(a_nullable_uint8_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_string_arg = args.at(0); + const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); + ErrorOr> output = api->EchoNullableString(a_nullable_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableObject" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_object_arg = args.at(0); - const auto* a_nullable_object_arg = - &encodable_a_nullable_object_arg; - ErrorOr> output = - api->EchoNullableObject(a_nullable_object_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_uint8_list_arg = args.at(0); + const auto* a_nullable_uint8_list_arg = std::get_if>(&encodable_a_nullable_uint8_list_arg); + ErrorOr>> output = api->EchoNullableUint8List(a_nullable_uint8_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableList" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_list_arg = args.at(0); - const auto* a_nullable_list_arg = - std::get_if(&encodable_a_nullable_list_arg); - ErrorOr> output = - api->EchoNullableList(a_nullable_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_object_arg = args.at(0); + const auto* a_nullable_object_arg = &encodable_a_nullable_object_arg; + ErrorOr> output = api->EchoNullableObject(a_nullable_object_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableMap" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_map_arg = args.at(0); - const auto* a_nullable_map_arg = - std::get_if(&encodable_a_nullable_map_arg); - ErrorOr> output = - api->EchoNullableMap(a_nullable_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_list_arg = args.at(0); + const auto* a_nullable_list_arg = std::get_if(&encodable_a_nullable_list_arg); + ErrorOr> output = api->EchoNullableList(a_nullable_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableEnum" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - AnEnum an_enum_arg_value; - const AnEnum* an_enum_arg = nullptr; - if (!encodable_an_enum_arg.IsNull()) { - an_enum_arg_value = std::any_cast( - std::get(encodable_an_enum_arg)); - an_enum_arg = &an_enum_arg_value; - } - ErrorOr> output = api->EchoNullableEnum( - an_enum_arg ? &(*an_enum_arg) : nullptr); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_map_arg = args.at(0); + const auto* a_nullable_map_arg = std::get_if(&encodable_a_nullable_map_arg); + ErrorOr> output = api->EchoNullableMap(a_nullable_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum" + prepended_suffix, &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + AnEnum an_enum_arg_value; + const AnEnum* an_enum_arg = nullptr; + if (!encodable_an_enum_arg.IsNull()) { + an_enum_arg_value = std::any_cast(std::get(encodable_an_enum_arg)); + an_enum_arg = &an_enum_arg_value; + } + ErrorOr> output = api->EchoNullableEnum(an_enum_arg ? &(*an_enum_arg) : nullptr); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt" + prepended_suffix, &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_int_arg = args.at(0); + const int64_t a_nullable_int_arg_value = encodable_a_nullable_int_arg.IsNull() ? 0 : encodable_a_nullable_int_arg.LongValue(); + const auto* a_nullable_int_arg = encodable_a_nullable_int_arg.IsNull() ? nullptr : &a_nullable_int_arg_value; + ErrorOr> output = api->EchoOptionalNullableInt(a_nullable_int_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoOptionalNullableInt" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_int_arg = args.at(0); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; - ErrorOr> output = - api->EchoOptionalNullableInt(a_nullable_int_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_string_arg = args.at(0); + const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); + ErrorOr> output = api->EchoNamedNullableString(a_nullable_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoNamedNullableString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_string_arg = args.at(0); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - ErrorOr> output = - api->EchoNamedNullableString(a_nullable_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + api->NoopAsync([reply](std::optional&& output) { + if (output.has_value()) { + reply(WrapError(output.value())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.noopAsync" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - api->NoopAsync([reply](std::optional&& output) { - if (output.has_value()) { - reply(WrapError(output.value())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_int_arg = args.at(0); + if (encodable_an_int_arg.IsNull()) { + reply(WrapError("an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = encodable_an_int_arg.LongValue(); + api->EchoAsyncInt(an_int_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncInt" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - if (encodable_an_int_arg.IsNull()) { - reply(WrapError("an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = encodable_an_int_arg.LongValue(); - api->EchoAsyncInt(an_int_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_double_arg = args.at(0); + if (encodable_a_double_arg.IsNull()) { + reply(WrapError("a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = std::get(encodable_a_double_arg); + api->EchoAsyncDouble(a_double_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncDouble" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - if (encodable_a_double_arg.IsNull()) { - reply(WrapError("a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = - std::get(encodable_a_double_arg); - api->EchoAsyncDouble( - a_double_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_bool_arg = args.at(0); + if (encodable_a_bool_arg.IsNull()) { + reply(WrapError("a_bool_arg unexpectedly null.")); + return; + } + const auto& a_bool_arg = std::get(encodable_a_bool_arg); + api->EchoAsyncBool(a_bool_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncBool" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_bool_arg = args.at(0); - if (encodable_a_bool_arg.IsNull()) { - reply(WrapError("a_bool_arg unexpectedly null.")); - return; - } - const auto& a_bool_arg = std::get(encodable_a_bool_arg); - api->EchoAsyncBool(a_bool_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = std::get(encodable_a_string_arg); + api->EchoAsyncString(a_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - api->EchoAsyncString( - a_string_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_uint8_list_arg = args.at(0); + if (encodable_a_uint8_list_arg.IsNull()) { + reply(WrapError("a_uint8_list_arg unexpectedly null.")); + return; + } + const auto& a_uint8_list_arg = std::get>(encodable_a_uint8_list_arg); + api->EchoAsyncUint8List(a_uint8_list_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncUint8List" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_uint8_list_arg = args.at(0); - if (encodable_a_uint8_list_arg.IsNull()) { - reply(WrapError("a_uint8_list_arg unexpectedly null.")); - return; - } - const auto& a_uint8_list_arg = - std::get>(encodable_a_uint8_list_arg); - api->EchoAsyncUint8List( - a_uint8_list_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_object_arg = args.at(0); + if (encodable_an_object_arg.IsNull()) { + reply(WrapError("an_object_arg unexpectedly null.")); + return; + } + const auto& an_object_arg = encodable_an_object_arg; + api->EchoAsyncObject(an_object_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncObject" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_object_arg = args.at(0); - if (encodable_an_object_arg.IsNull()) { - reply(WrapError("an_object_arg unexpectedly null.")); - return; - } - const auto& an_object_arg = encodable_an_object_arg; - api->EchoAsyncObject( - an_object_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + if (encodable_list_arg.IsNull()) { + reply(WrapError("list_arg unexpectedly null.")); + return; + } + const auto& list_arg = std::get(encodable_list_arg); + api->EchoAsyncList(list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncList" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - if (encodable_list_arg.IsNull()) { - reply(WrapError("list_arg unexpectedly null.")); - return; - } - const auto& list_arg = - std::get(encodable_list_arg); - api->EchoAsyncList( - list_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_map_arg = args.at(0); + if (encodable_a_map_arg.IsNull()) { + reply(WrapError("a_map_arg unexpectedly null.")); + return; + } + const auto& a_map_arg = std::get(encodable_a_map_arg); + api->EchoAsyncMap(a_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncMap" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - if (encodable_a_map_arg.IsNull()) { - reply(WrapError("a_map_arg unexpectedly null.")); - return; - } - const auto& a_map_arg = - std::get(encodable_a_map_arg); - api->EchoAsyncMap( - a_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + if (encodable_an_enum_arg.IsNull()) { + reply(WrapError("an_enum_arg unexpectedly null.")); + return; + } + const auto& an_enum_arg = std::any_cast(std::get(encodable_an_enum_arg)); + api->EchoAsyncEnum(an_enum_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncEnum" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - if (encodable_an_enum_arg.IsNull()) { - reply(WrapError("an_enum_arg unexpectedly null.")); - return; - } - const auto& an_enum_arg = std::any_cast( - std::get(encodable_an_enum_arg)); - api->EchoAsyncEnum( - an_enum_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + api->ThrowAsyncError([reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } - }); - } else { - channel.SetMessageHandler(nullptr); - } - } - { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.throwAsyncError" + - prepended_suffix, - &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - api->ThrowAsyncError( - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "throwAsyncErrorFromVoid" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - api->ThrowAsyncErrorFromVoid( - [reply](std::optional&& output) { - if (output.has_value()) { - reply(WrapError(output.value())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + api->ThrowAsyncErrorFromVoid([reply](std::optional&& output) { + if (output.has_value()) { + reply(WrapError(output.value())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "throwAsyncFlutterError" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - api->ThrowAsyncFlutterError( - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + api->ThrowAsyncFlutterError([reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoAsyncAllTypes" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - if (encodable_everything_arg.IsNull()) { - reply(WrapError("everything_arg unexpectedly null.")); - return; - } - const auto& everything_arg = std::any_cast( - std::get(encodable_everything_arg)); - api->EchoAsyncAllTypes( - everything_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + if (encodable_everything_arg.IsNull()) { + reply(WrapError("everything_arg unexpectedly null.")); + return; + } + const auto& everything_arg = std::any_cast(std::get(encodable_everything_arg)); + api->EchoAsyncAllTypes(everything_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableAllNullableTypes" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - api->EchoAsyncNullableAllNullableTypes( - everything_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = encodable_everything_arg.IsNull() ? nullptr : &(std::any_cast(std::get(encodable_everything_arg))); + api->EchoAsyncNullableAllNullableTypes(everything_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableAllNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api]( - const EncodableValue& message, - const flutter::MessageReply& - reply) { + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - api->EchoAsyncNullableAllNullableTypesWithoutRecursion( - everything_arg, - [reply](ErrorOr>&& - output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + const auto* everything_arg = encodable_everything_arg.IsNull() ? nullptr : &(std::any_cast(std::get(encodable_everything_arg))); + api->EchoAsyncNullableAllNullableTypesWithoutRecursion(everything_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3542,648 +2828,463 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableInt" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - const int64_t an_int_arg_value = - encodable_an_int_arg.IsNull() - ? 0 - : encodable_an_int_arg.LongValue(); - const auto* an_int_arg = - encodable_an_int_arg.IsNull() ? nullptr : &an_int_arg_value; - api->EchoAsyncNullableInt( - an_int_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_int_arg = args.at(0); + const int64_t an_int_arg_value = encodable_an_int_arg.IsNull() ? 0 : encodable_an_int_arg.LongValue(); + const auto* an_int_arg = encodable_an_int_arg.IsNull() ? nullptr : &an_int_arg_value; + api->EchoAsyncNullableInt(an_int_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableDouble" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - const auto* a_double_arg = - std::get_if(&encodable_a_double_arg); - api->EchoAsyncNullableDouble( - a_double_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_double_arg = args.at(0); + const auto* a_double_arg = std::get_if(&encodable_a_double_arg); + api->EchoAsyncNullableDouble(a_double_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableBool" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_bool_arg = args.at(0); - const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg); - api->EchoAsyncNullableBool( - a_bool_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_bool_arg = args.at(0); + const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg); + api->EchoAsyncNullableBool(a_bool_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - const auto* a_string_arg = - std::get_if(&encodable_a_string_arg); - api->EchoAsyncNullableString( - a_string_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + const auto* a_string_arg = std::get_if(&encodable_a_string_arg); + api->EchoAsyncNullableString(a_string_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableUint8List" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_uint8_list_arg = args.at(0); - const auto* a_uint8_list_arg = std::get_if>( - &encodable_a_uint8_list_arg); - api->EchoAsyncNullableUint8List( - a_uint8_list_arg, - [reply]( - ErrorOr>>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_uint8_list_arg = args.at(0); + const auto* a_uint8_list_arg = std::get_if>(&encodable_a_uint8_list_arg); + api->EchoAsyncNullableUint8List(a_uint8_list_arg, [reply](ErrorOr>>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableObject" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_object_arg = args.at(0); - const auto* an_object_arg = &encodable_an_object_arg; - api->EchoAsyncNullableObject( - an_object_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_object_arg = args.at(0); + const auto* an_object_arg = &encodable_an_object_arg; + api->EchoAsyncNullableObject(an_object_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableList" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - const auto* list_arg = - std::get_if(&encodable_list_arg); - api->EchoAsyncNullableList( - list_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + const auto* list_arg = std::get_if(&encodable_list_arg); + api->EchoAsyncNullableList(list_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableMap" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - const auto* a_map_arg = - std::get_if(&encodable_a_map_arg); - api->EchoAsyncNullableMap( - a_map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_map_arg = args.at(0); + const auto* a_map_arg = std::get_if(&encodable_a_map_arg); + api->EchoAsyncNullableMap(a_map_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAsyncNullableEnum" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - AnEnum an_enum_arg_value; - const AnEnum* an_enum_arg = nullptr; - if (!encodable_an_enum_arg.IsNull()) { - an_enum_arg_value = std::any_cast( - std::get(encodable_an_enum_arg)); - an_enum_arg = &an_enum_arg_value; - } - api->EchoAsyncNullableEnum( - an_enum_arg ? &(*an_enum_arg) : nullptr, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + AnEnum an_enum_arg_value; + const AnEnum* an_enum_arg = nullptr; + if (!encodable_an_enum_arg.IsNull()) { + an_enum_arg_value = std::any_cast(std::get(encodable_an_enum_arg)); + an_enum_arg = &an_enum_arg_value; + } + api->EchoAsyncNullableEnum(an_enum_arg ? &(*an_enum_arg) : nullptr, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterNoop" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - api->CallFlutterNoop( - [reply](std::optional&& output) { - if (output.has_value()) { - reply(WrapError(output.value())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + api->CallFlutterNoop([reply](std::optional&& output) { + if (output.has_value()) { + reply(WrapError(output.value())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterThrowError" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - api->CallFlutterThrowError( - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + api->CallFlutterThrowError([reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterThrowErrorFromVoid" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - api->CallFlutterThrowErrorFromVoid( - [reply](std::optional&& output) { - if (output.has_value()) { - reply(WrapError(output.value())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + api->CallFlutterThrowErrorFromVoid([reply](std::optional&& output) { + if (output.has_value()) { + reply(WrapError(output.value())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAllTypes" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - if (encodable_everything_arg.IsNull()) { - reply(WrapError("everything_arg unexpectedly null.")); - return; - } - const auto& everything_arg = std::any_cast( - std::get(encodable_everything_arg)); - api->CallFlutterEchoAllTypes( - everything_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + if (encodable_everything_arg.IsNull()) { + reply(WrapError("everything_arg unexpectedly null.")); + return; + } + const auto& everything_arg = std::any_cast(std::get(encodable_everything_arg)); + api->CallFlutterEchoAllTypes(everything_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAllNullableTypes" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - api->CallFlutterEchoAllNullableTypes( - everything_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = encodable_everything_arg.IsNull() ? nullptr : &(std::any_cast(std::get(encodable_everything_arg))); + api->CallFlutterEchoAllNullableTypes(everything_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterSendMultipleNullableTypes" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = - std::get_if(&encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = args.at(1); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; - const auto& encodable_a_nullable_string_arg = args.at(2); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - api->CallFlutterSendMultipleNullableTypes( - a_nullable_bool_arg, a_nullable_int_arg, - a_nullable_string_arg, - [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = std::get_if(&encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = args.at(1); + const int64_t a_nullable_int_arg_value = encodable_a_nullable_int_arg.IsNull() ? 0 : encodable_a_nullable_int_arg.LongValue(); + const auto* a_nullable_int_arg = encodable_a_nullable_int_arg.IsNull() ? nullptr : &a_nullable_int_arg_value; + const auto& encodable_a_nullable_string_arg = args.at(2); + const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); + api->CallFlutterSendMultipleNullableTypes(a_nullable_bool_arg, a_nullable_int_arg, a_nullable_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAllNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api]( - const EncodableValue& message, - const flutter::MessageReply& - reply) { + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = - encodable_everything_arg.IsNull() - ? nullptr - : &(std::any_cast( - std::get( - encodable_everything_arg))); - api->CallFlutterEchoAllNullableTypesWithoutRecursion( - everything_arg, - [reply](ErrorOr>&& - output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + const auto* everything_arg = encodable_everything_arg.IsNull() ? nullptr : &(std::any_cast(std::get(encodable_everything_arg))); + api->CallFlutterEchoAllNullableTypesWithoutRecursion(everything_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -4193,1798 +3294,1284 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterSendMultipleNullableTypesWithoutRecursion" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = - std::get_if(&encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = args.at(1); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; - const auto& encodable_a_nullable_string_arg = args.at(2); - const auto* a_nullable_string_arg = - std::get_if(&encodable_a_nullable_string_arg); - api->CallFlutterSendMultipleNullableTypesWithoutRecursion( - a_nullable_bool_arg, a_nullable_int_arg, - a_nullable_string_arg, - [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = std::get_if(&encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = args.at(1); + const int64_t a_nullable_int_arg_value = encodable_a_nullable_int_arg.IsNull() ? 0 : encodable_a_nullable_int_arg.LongValue(); + const auto* a_nullable_int_arg = encodable_a_nullable_int_arg.IsNull() ? nullptr : &a_nullable_int_arg_value; + const auto& encodable_a_nullable_string_arg = args.at(2); + const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); + api->CallFlutterSendMultipleNullableTypesWithoutRecursion(a_nullable_bool_arg, a_nullable_int_arg, a_nullable_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterEchoBool" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_bool_arg = args.at(0); - if (encodable_a_bool_arg.IsNull()) { - reply(WrapError("a_bool_arg unexpectedly null.")); - return; - } - const auto& a_bool_arg = std::get(encodable_a_bool_arg); - api->CallFlutterEchoBool( - a_bool_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_bool_arg = args.at(0); + if (encodable_a_bool_arg.IsNull()) { + reply(WrapError("a_bool_arg unexpectedly null.")); + return; + } + const auto& a_bool_arg = std::get(encodable_a_bool_arg); + api->CallFlutterEchoBool(a_bool_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterEchoInt" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - if (encodable_an_int_arg.IsNull()) { - reply(WrapError("an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = encodable_an_int_arg.LongValue(); - api->CallFlutterEchoInt( - an_int_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_int_arg = args.at(0); + if (encodable_an_int_arg.IsNull()) { + reply(WrapError("an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = encodable_an_int_arg.LongValue(); + api->CallFlutterEchoInt(an_int_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoDouble" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - if (encodable_a_double_arg.IsNull()) { - reply(WrapError("a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = - std::get(encodable_a_double_arg); - api->CallFlutterEchoDouble( - a_double_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_double_arg = args.at(0); + if (encodable_a_double_arg.IsNull()) { + reply(WrapError("a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = std::get(encodable_a_double_arg); + api->CallFlutterEchoDouble(a_double_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - api->CallFlutterEchoString( - a_string_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = std::get(encodable_a_string_arg); + api->CallFlutterEchoString(a_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoUint8List" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - if (encodable_list_arg.IsNull()) { - reply(WrapError("list_arg unexpectedly null.")); - return; - } - const auto& list_arg = - std::get>(encodable_list_arg); - api->CallFlutterEchoUint8List( - list_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + if (encodable_list_arg.IsNull()) { + reply(WrapError("list_arg unexpectedly null.")); + return; + } + const auto& list_arg = std::get>(encodable_list_arg); + api->CallFlutterEchoUint8List(list_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterEchoList" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - if (encodable_list_arg.IsNull()) { - reply(WrapError("list_arg unexpectedly null.")); - return; - } - const auto& list_arg = - std::get(encodable_list_arg); - api->CallFlutterEchoList( - list_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + if (encodable_list_arg.IsNull()) { + reply(WrapError("list_arg unexpectedly null.")); + return; + } + const auto& list_arg = std::get(encodable_list_arg); + api->CallFlutterEchoList(list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterEchoMap" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - if (encodable_a_map_arg.IsNull()) { - reply(WrapError("a_map_arg unexpectedly null.")); - return; - } - const auto& a_map_arg = - std::get(encodable_a_map_arg); - api->CallFlutterEchoMap( - a_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_map_arg = args.at(0); + if (encodable_a_map_arg.IsNull()) { + reply(WrapError("a_map_arg unexpectedly null.")); + return; + } + const auto& a_map_arg = std::get(encodable_a_map_arg); + api->CallFlutterEchoMap(a_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterEchoEnum" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - if (encodable_an_enum_arg.IsNull()) { - reply(WrapError("an_enum_arg unexpectedly null.")); - return; - } - const auto& an_enum_arg = std::any_cast( - std::get(encodable_an_enum_arg)); - api->CallFlutterEchoEnum( - an_enum_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + if (encodable_an_enum_arg.IsNull()) { + reply(WrapError("an_enum_arg unexpectedly null.")); + return; + } + const auto& an_enum_arg = std::any_cast(std::get(encodable_an_enum_arg)); + api->CallFlutterEchoEnum(an_enum_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableBool" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_bool_arg = args.at(0); - const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg); - api->CallFlutterEchoNullableBool( - a_bool_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_bool_arg = args.at(0); + const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg); + api->CallFlutterEchoNullableBool(a_bool_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableInt" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - const int64_t an_int_arg_value = - encodable_an_int_arg.IsNull() - ? 0 - : encodable_an_int_arg.LongValue(); - const auto* an_int_arg = - encodable_an_int_arg.IsNull() ? nullptr : &an_int_arg_value; - api->CallFlutterEchoNullableInt( - an_int_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_int_arg = args.at(0); + const int64_t an_int_arg_value = encodable_an_int_arg.IsNull() ? 0 : encodable_an_int_arg.LongValue(); + const auto* an_int_arg = encodable_an_int_arg.IsNull() ? nullptr : &an_int_arg_value; + api->CallFlutterEchoNullableInt(an_int_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableDouble" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - const auto* a_double_arg = - std::get_if(&encodable_a_double_arg); - api->CallFlutterEchoNullableDouble( - a_double_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_double_arg = args.at(0); + const auto* a_double_arg = std::get_if(&encodable_a_double_arg); + api->CallFlutterEchoNullableDouble(a_double_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - const auto* a_string_arg = - std::get_if(&encodable_a_string_arg); - api->CallFlutterEchoNullableString( - a_string_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + const auto* a_string_arg = std::get_if(&encodable_a_string_arg); + api->CallFlutterEchoNullableString(a_string_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableUint8List" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - const auto* list_arg = - std::get_if>(&encodable_list_arg); - api->CallFlutterEchoNullableUint8List( - list_arg, - [reply]( - ErrorOr>>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + const auto* list_arg = std::get_if>(&encodable_list_arg); + api->CallFlutterEchoNullableUint8List(list_arg, [reply](ErrorOr>>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableList" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - const auto* list_arg = - std::get_if(&encodable_list_arg); - api->CallFlutterEchoNullableList( - list_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + const auto* list_arg = std::get_if(&encodable_list_arg); + api->CallFlutterEchoNullableList(list_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableMap" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - const auto* a_map_arg = - std::get_if(&encodable_a_map_arg); - api->CallFlutterEchoNullableMap( - a_map_arg, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back( - EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_map_arg = args.at(0); + const auto* a_map_arg = std::get_if(&encodable_a_map_arg); + api->CallFlutterEchoNullableMap(a_map_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoNullableEnum" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - AnEnum an_enum_arg_value; - const AnEnum* an_enum_arg = nullptr; - if (!encodable_an_enum_arg.IsNull()) { - an_enum_arg_value = std::any_cast( - std::get(encodable_an_enum_arg)); - an_enum_arg = &an_enum_arg_value; - } - api->CallFlutterEchoNullableEnum( - an_enum_arg ? &(*an_enum_arg) : nullptr, - [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue( - std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + AnEnum an_enum_arg_value; + const AnEnum* an_enum_arg = nullptr; + if (!encodable_an_enum_arg.IsNull()) { + an_enum_arg_value = std::any_cast(std::get(encodable_an_enum_arg)); + an_enum_arg = &an_enum_arg_value; + } + api->CallFlutterEchoNullableEnum(an_enum_arg ? &(*an_enum_arg) : nullptr, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterSmallApiEchoString" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - api->CallFlutterSmallApiEchoString( - a_string_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = std::get(encodable_a_string_arg); + api->CallFlutterSmallApiEchoString(a_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } } -EncodableValue HostIntegrationCoreApi::WrapError( - std::string_view error_message) { - return EncodableValue( - EncodableList{EncodableValue(std::string(error_message)), - EncodableValue("Error"), EncodableValue()}); +EncodableValue HostIntegrationCoreApi::WrapError(std::string_view error_message) { + return EncodableValue(EncodableList{ + EncodableValue(std::string(error_message)), + EncodableValue("Error"), + EncodableValue() + }); } EncodableValue HostIntegrationCoreApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{EncodableValue(error.code()), - EncodableValue(error.message()), - error.details()}); + return EncodableValue(EncodableList{ + EncodableValue(error.code()), + EncodableValue(error.message()), + error.details() + }); } -// Generated class from Pigeon that represents Flutter messages that can be -// called from C++. -FlutterIntegrationCoreApi::FlutterIntegrationCoreApi( - flutter::BinaryMessenger* binary_messenger) - : binary_messenger_(binary_messenger), message_channel_suffix_("") {} +// Generated class from Pigeon that represents Flutter messages that can be called from C++. +FlutterIntegrationCoreApi::FlutterIntegrationCoreApi(flutter::BinaryMessenger* binary_messenger) + : binary_messenger_(binary_messenger), + message_channel_suffix_("") {} FlutterIntegrationCoreApi::FlutterIntegrationCoreApi( - flutter::BinaryMessenger* binary_messenger, - const std::string& message_channel_suffix) - : binary_messenger_(binary_messenger), - message_channel_suffix_(message_channel_suffix.length() > 0 - ? std::string(".") + message_channel_suffix - : "") {} + flutter::BinaryMessenger* binary_messenger, + const std::string& message_channel_suffix) + : binary_messenger_(binary_messenger), + message_channel_suffix_(message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix : "") {} const flutter::StandardMessageCodec& FlutterIntegrationCoreApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &PigeonCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance(&PigeonCodecSerializer::GetInstance()); } void FlutterIntegrationCoreApi::Noop( - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "noop" + - message_channel_suffix_; + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - on_success(); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::ThrowError( - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "throwError" + - message_channel_suffix_; + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = &list_return_value->at(0); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto* return_value = &list_return_value->at(0); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::ThrowErrorFromVoid( - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "throwErrorFromVoid" + - message_channel_suffix_; + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - on_success(); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoAllTypes( - const AllTypes& everything_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAllTypes" + - message_channel_suffix_; + const AllTypes& everything_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - CustomEncodableValue(everything_arg), + CustomEncodableValue(everything_arg), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast(std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast( - std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoAllNullableTypes( - const AllNullableTypes* everything_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAllNullableTypes" + - message_channel_suffix_; + const AllNullableTypes* everything_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), + everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto* return_value = list_return_value->at(0).IsNull() ? nullptr : &(std::any_cast(std::get(list_return_value->at(0)))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - list_return_value->at(0).IsNull() - ? nullptr - : &(std::any_cast( - std::get( - list_return_value->at(0)))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::SendMultipleNullableTypes( - const bool* a_nullable_bool_arg, const int64_t* a_nullable_int_arg, - const std::string* a_nullable_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "sendMultipleNullableTypes" + - message_channel_suffix_; + const bool* a_nullable_bool_arg, + const int64_t* a_nullable_int_arg, + const std::string* a_nullable_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) - : EncodableValue(), - a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) - : EncodableValue(), - a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) - : EncodableValue(), + a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) : EncodableValue(), + a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) : EncodableValue(), + a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) : EncodableValue(), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast(std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast( - std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoAllNullableTypesWithoutRecursion( - const AllNullableTypesWithoutRecursion* everything_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAllNullableTypesWithoutRecursion" + - message_channel_suffix_; + const AllNullableTypesWithoutRecursion* everything_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), + everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto* return_value = list_return_value->at(0).IsNull() ? nullptr : &(std::any_cast(std::get(list_return_value->at(0)))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - list_return_value->at(0).IsNull() - ? nullptr - : &(std::any_cast( - std::get( - list_return_value->at(0)))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::SendMultipleNullableTypesWithoutRecursion( - const bool* a_nullable_bool_arg, const int64_t* a_nullable_int_arg, - const std::string* a_nullable_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "sendMultipleNullableTypesWithoutRecursion" + - message_channel_suffix_; + const bool* a_nullable_bool_arg, + const int64_t* a_nullable_int_arg, + const std::string* a_nullable_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) - : EncodableValue(), - a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) - : EncodableValue(), - a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) - : EncodableValue(), + a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) : EncodableValue(), + a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) : EncodableValue(), + a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) : EncodableValue(), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast(std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::any_cast( - std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoBool( - bool a_bool_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoBool" + - message_channel_suffix_; + bool a_bool_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_bool_arg), + EncodableValue(a_bool_arg), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoInt( - int64_t an_int_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoInt" + - message_channel_suffix_; + int64_t an_int_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(an_int_arg), + EncodableValue(an_int_arg), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const int64_t return_value = list_return_value->at(0).LongValue(); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const int64_t return_value = list_return_value->at(0).LongValue(); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoDouble( - double a_double_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoDouble" + - message_channel_suffix_; + double a_double_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_double_arg), + EncodableValue(a_double_arg), }); - channel.Send(encoded_api_arguments, [channel_name, - on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, - size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); + const auto* list_return_value = std::get_if(&encodable_return_value); if (list_return_value) { if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); } else { const auto& return_value = std::get(list_return_value->at(0)); on_success(return_value); } } else { on_error(CreateConnectionError(channel_name)); - } + } }); } void FlutterIntegrationCoreApi::EchoString( - const std::string& a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoString" + - message_channel_suffix_; + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), + EncodableValue(a_string_arg), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoUint8List( - const std::vector& list_arg, - std::function&)>&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoUint8List" + - message_channel_suffix_; + const std::vector& list_arg, + std::function&)>&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(list_arg), + EncodableValue(list_arg), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get>(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get>(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoList( - const EncodableList& list_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoList" + - message_channel_suffix_; + const EncodableList& list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(list_arg), + EncodableValue(list_arg), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoMap( - const EncodableMap& a_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoMap" + - message_channel_suffix_; + const EncodableMap& a_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_map_arg), + EncodableValue(a_map_arg), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoEnum( - const AnEnum& an_enum_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoEnum" + - message_channel_suffix_; + const AnEnum& an_enum_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - CustomEncodableValue(an_enum_arg), + CustomEncodableValue(an_enum_arg), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast(std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast( - std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoNullableBool( - const bool* a_bool_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableBool" + - message_channel_suffix_; + const bool* a_bool_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_bool_arg ? EncodableValue(*a_bool_arg) : EncodableValue(), + a_bool_arg ? EncodableValue(*a_bool_arg) : EncodableValue(), }); - channel.Send(encoded_api_arguments, [channel_name, - on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, - size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); + const auto* list_return_value = std::get_if(&encodable_return_value); if (list_return_value) { if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); } else { const auto* return_value = std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { on_error(CreateConnectionError(channel_name)); - } + } }); } void FlutterIntegrationCoreApi::EchoNullableInt( - const int64_t* an_int_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableInt" + - message_channel_suffix_; + const int64_t* an_int_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - an_int_arg ? EncodableValue(*an_int_arg) : EncodableValue(), + an_int_arg ? EncodableValue(*an_int_arg) : EncodableValue(), }); - channel.Send(encoded_api_arguments, [channel_name, - on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, - size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); + const auto* list_return_value = std::get_if(&encodable_return_value); if (list_return_value) { if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); } else { - const int64_t return_value_value = - list_return_value->at(0).IsNull() - ? 0 - : list_return_value->at(0).LongValue(); - const auto* return_value = - list_return_value->at(0).IsNull() ? nullptr : &return_value_value; + const int64_t return_value_value = list_return_value->at(0).IsNull() ? 0 : list_return_value->at(0).LongValue(); + const auto* return_value = list_return_value->at(0).IsNull() ? nullptr : &return_value_value; on_success(return_value); } } else { on_error(CreateConnectionError(channel_name)); - } + } }); } void FlutterIntegrationCoreApi::EchoNullableDouble( - const double* a_double_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableDouble" + - message_channel_suffix_; + const double* a_double_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_double_arg ? EncodableValue(*a_double_arg) : EncodableValue(), + a_double_arg ? EncodableValue(*a_double_arg) : EncodableValue(), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto* return_value = std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoNullableString( - const std::string* a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableString" + - message_channel_suffix_; + const std::string* a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), + a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto* return_value = std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoNullableUint8List( - const std::vector* list_arg, - std::function*)>&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableUint8List" + - message_channel_suffix_; + const std::vector* list_arg, + std::function*)>&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - list_arg ? EncodableValue(*list_arg) : EncodableValue(), + list_arg ? EncodableValue(*list_arg) : EncodableValue(), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto* return_value = std::get_if>(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if>(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoNullableList( - const EncodableList* list_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableList" + - message_channel_suffix_; + const EncodableList* list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - list_arg ? EncodableValue(*list_arg) : EncodableValue(), + list_arg ? EncodableValue(*list_arg) : EncodableValue(), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto* return_value = std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoNullableMap( - const EncodableMap* a_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableMap" + - message_channel_suffix_; + const EncodableMap* a_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_map_arg ? EncodableValue(*a_map_arg) : EncodableValue(), + a_map_arg ? EncodableValue(*a_map_arg) : EncodableValue(), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto* return_value = std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto* return_value = - std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterIntegrationCoreApi::EchoNullableEnum( - const AnEnum* an_enum_arg, std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoNullableEnum" + - message_channel_suffix_; + const AnEnum* an_enum_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - an_enum_arg ? CustomEncodableValue(*an_enum_arg) : EncodableValue(), + an_enum_arg ? CustomEncodableValue(*an_enum_arg) : EncodableValue(), }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - AnEnum return_value_value; - const AnEnum* return_value = nullptr; - if (!list_return_value->at(0).IsNull()) { - return_value_value = std::any_cast( - std::get(list_return_value->at(0))); - return_value = &return_value_value; - } - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + AnEnum return_value_value; + const AnEnum* return_value = nullptr; + if (!list_return_value->at(0).IsNull()) { + return_value_value = std::any_cast(std::get(list_return_value->at(0))); + return_value = &return_value_value; } - }); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::NoopAsync( - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "noopAsync" + - message_channel_suffix_; + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - on_success(); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoAsyncString( - const std::string& a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." - "echoAsyncString" + - message_channel_suffix_; + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), + EncodableValue(a_string_arg), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } /// The codec used by HostTrivialApi. const flutter::StandardMessageCodec& HostTrivialApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &PigeonCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance(&PigeonCodecSerializer::GetInstance()); } -// Sets up an instance of `HostTrivialApi` to handle messages through the -// `binary_messenger`. -void HostTrivialApi::SetUp(flutter::BinaryMessenger* binary_messenger, - HostTrivialApi* api) { +// Sets up an instance of `HostTrivialApi` to handle messages through the `binary_messenger`. +void HostTrivialApi::SetUp( + flutter::BinaryMessenger* binary_messenger, + HostTrivialApi* api) { HostTrivialApi::SetUp(binary_messenger, api, ""); } -void HostTrivialApi::SetUp(flutter::BinaryMessenger* binary_messenger, - HostTrivialApi* api, - const std::string& message_channel_suffix) { - const std::string prepended_suffix = - message_channel_suffix.length() > 0 - ? std::string(".") + message_channel_suffix - : ""; +void HostTrivialApi::SetUp( + flutter::BinaryMessenger* binary_messenger, + HostTrivialApi* api, + const std::string& message_channel_suffix) { + const std::string prepended_suffix = message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix : ""; { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - std::optional output = api->Noop(); - if (output.has_value()) { - reply(WrapError(output.value())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + std::optional output = api->Noop(); + if (output.has_value()) { + reply(WrapError(output.value())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } @@ -5992,98 +4579,85 @@ void HostTrivialApi::SetUp(flutter::BinaryMessenger* binary_messenger, } EncodableValue HostTrivialApi::WrapError(std::string_view error_message) { - return EncodableValue( - EncodableList{EncodableValue(std::string(error_message)), - EncodableValue("Error"), EncodableValue()}); + return EncodableValue(EncodableList{ + EncodableValue(std::string(error_message)), + EncodableValue("Error"), + EncodableValue() + }); } EncodableValue HostTrivialApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{EncodableValue(error.code()), - EncodableValue(error.message()), - error.details()}); + return EncodableValue(EncodableList{ + EncodableValue(error.code()), + EncodableValue(error.message()), + error.details() + }); } /// The codec used by HostSmallApi. const flutter::StandardMessageCodec& HostSmallApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &PigeonCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance(&PigeonCodecSerializer::GetInstance()); } -// Sets up an instance of `HostSmallApi` to handle messages through the -// `binary_messenger`. -void HostSmallApi::SetUp(flutter::BinaryMessenger* binary_messenger, - HostSmallApi* api) { +// Sets up an instance of `HostSmallApi` to handle messages through the `binary_messenger`. +void HostSmallApi::SetUp( + flutter::BinaryMessenger* binary_messenger, + HostSmallApi* api) { HostSmallApi::SetUp(binary_messenger, api, ""); } -void HostSmallApi::SetUp(flutter::BinaryMessenger* binary_messenger, - HostSmallApi* api, - const std::string& message_channel_suffix) { - const std::string prepended_suffix = - message_channel_suffix.length() > 0 - ? std::string(".") + message_channel_suffix - : ""; +void HostSmallApi::SetUp( + flutter::BinaryMessenger* binary_messenger, + HostSmallApi* api, + const std::string& message_channel_suffix) { + const std::string prepended_suffix = message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix : ""; { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = - std::get(encodable_a_string_arg); - api->Echo(a_string_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back( - EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = std::get(encodable_a_string_arg); + api->Echo(a_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid" + prepended_suffix, &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler( - [api](const EncodableValue& message, - const flutter::MessageReply& reply) { - try { - api->VoidVoid([reply](std::optional&& output) { - if (output.has_value()) { - reply(WrapError(output.value())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); + channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + try { + api->VoidVoid([reply](std::optional&& output) { + if (output.has_value()) { + reply(WrapError(output.value())); + return; } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } @@ -6091,107 +4665,86 @@ void HostSmallApi::SetUp(flutter::BinaryMessenger* binary_messenger, } EncodableValue HostSmallApi::WrapError(std::string_view error_message) { - return EncodableValue( - EncodableList{EncodableValue(std::string(error_message)), - EncodableValue("Error"), EncodableValue()}); + return EncodableValue(EncodableList{ + EncodableValue(std::string(error_message)), + EncodableValue("Error"), + EncodableValue() + }); } EncodableValue HostSmallApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{EncodableValue(error.code()), - EncodableValue(error.message()), - error.details()}); + return EncodableValue(EncodableList{ + EncodableValue(error.code()), + EncodableValue(error.message()), + error.details() + }); } -// Generated class from Pigeon that represents Flutter messages that can be -// called from C++. +// Generated class from Pigeon that represents Flutter messages that can be called from C++. FlutterSmallApi::FlutterSmallApi(flutter::BinaryMessenger* binary_messenger) - : binary_messenger_(binary_messenger), message_channel_suffix_("") {} + : binary_messenger_(binary_messenger), + message_channel_suffix_("") {} -FlutterSmallApi::FlutterSmallApi(flutter::BinaryMessenger* binary_messenger, - const std::string& message_channel_suffix) - : binary_messenger_(binary_messenger), - message_channel_suffix_(message_channel_suffix.length() > 0 - ? std::string(".") + message_channel_suffix - : "") {} +FlutterSmallApi::FlutterSmallApi( + flutter::BinaryMessenger* binary_messenger, + const std::string& message_channel_suffix) + : binary_messenger_(binary_messenger), + message_channel_suffix_(message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix : "") {} const flutter::StandardMessageCodec& FlutterSmallApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &PigeonCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance(&PigeonCodecSerializer::GetInstance()); } void FlutterSmallApi::EchoWrappedList( - const TestMessage& msg_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi." - "echoWrappedList" + - message_channel_suffix_; + const TestMessage& msg_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - CustomEncodableValue(msg_arg), + CustomEncodableValue(msg_arg), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast(std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast( - std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } void FlutterSmallApi::EchoString( - const std::string& a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = - "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString" + - message_channel_suffix_; + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString" + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), + EncodableValue(a_string_arg), + }); + channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } }); - channel.Send( - encoded_api_arguments, [channel_name, on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error( - FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const auto& return_value = - std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); } } // namespace core_tests_pigeontest diff --git a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h index 1d0b64289592..236538402593 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h +++ b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h @@ -24,12 +24,12 @@ class CoreTestsTest; class FlutterError { public: - explicit FlutterError(const std::string& code) : code_(code) {} + explicit FlutterError(const std::string& code) + : code_(code) {} explicit FlutterError(const std::string& code, const std::string& message) - : code_(code), message_(message) {} - explicit FlutterError(const std::string& code, const std::string& message, - const flutter::EncodableValue& details) - : code_(code), message_(message), details_(details) {} + : code_(code), message_(message) {} + explicit FlutterError(const std::string& code, const std::string& message, const flutter::EncodableValue& details) + : code_(code), message_(message), details_(details) {} const std::string& code() const { return code_; } const std::string& message() const { return message_; } @@ -41,8 +41,7 @@ class FlutterError { flutter::EncodableValue details_; }; -template -class ErrorOr { +template class ErrorOr { public: ErrorOr(const T& rhs) : v_(rhs) {} ErrorOr(const T&& rhs) : v_(std::move(rhs)) {} @@ -65,6 +64,7 @@ class ErrorOr { std::variant v_; }; + enum class AnEnum { kOne = 0, kTwo = 1, @@ -79,19 +79,24 @@ enum class AnEnum { class AllTypes { public: // Constructs an object setting all fields. - explicit AllTypes(bool a_bool, int64_t an_int, int64_t an_int64, - double a_double, const std::vector& a_byte_array, - const std::vector& a4_byte_array, - const std::vector& a8_byte_array, - const std::vector& a_float_array, - const AnEnum& an_enum, const std::string& a_string, - const flutter::EncodableValue& an_object, - const flutter::EncodableList& list, - const flutter::EncodableList& string_list, - const flutter::EncodableList& int_list, - const flutter::EncodableList& double_list, - const flutter::EncodableList& bool_list, - const flutter::EncodableMap& map); + explicit AllTypes( + bool a_bool, + int64_t an_int, + int64_t an_int64, + double a_double, + const std::vector& a_byte_array, + const std::vector& a4_byte_array, + const std::vector& a8_byte_array, + const std::vector& a_float_array, + const AnEnum& an_enum, + const std::string& a_string, + const flutter::EncodableValue& an_object, + const flutter::EncodableList& list, + const flutter::EncodableList& string_list, + const flutter::EncodableList& int_list, + const flutter::EncodableList& double_list, + const flutter::EncodableList& bool_list, + const flutter::EncodableMap& map); bool a_bool() const; void set_a_bool(bool value_arg); @@ -144,6 +149,7 @@ class AllTypes { const flutter::EncodableMap& map() const; void set_map(const flutter::EncodableMap& value_arg); + private: static AllTypes FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -172,8 +178,10 @@ class AllTypes { flutter::EncodableList double_list_; flutter::EncodableList bool_list_; flutter::EncodableMap map_; + }; + // A class containing all supported nullable types. // // Generated class from Pigeon that represents data sent in messages. @@ -184,25 +192,28 @@ class AllNullableTypes { // Constructs an object setting all fields. explicit AllNullableTypes( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const int64_t* a_nullable_int64, const double* a_nullable_double, - const std::vector* a_nullable_byte_array, - const std::vector* a_nullable4_byte_array, - const std::vector* a_nullable8_byte_array, - const std::vector* a_nullable_float_array, - const flutter::EncodableList* nullable_nested_list, - const flutter::EncodableMap* nullable_map_with_annotations, - const flutter::EncodableMap* nullable_map_with_object, - const AnEnum* a_nullable_enum, const std::string* a_nullable_string, - const flutter::EncodableValue* a_nullable_object, - const AllNullableTypes* all_nullable_types, - const flutter::EncodableList* list, - const flutter::EncodableList* string_list, - const flutter::EncodableList* int_list, - const flutter::EncodableList* double_list, - const flutter::EncodableList* bool_list, - const flutter::EncodableList* nested_class_list, - const flutter::EncodableMap* map); + const bool* a_nullable_bool, + const int64_t* a_nullable_int, + const int64_t* a_nullable_int64, + const double* a_nullable_double, + const std::vector* a_nullable_byte_array, + const std::vector* a_nullable4_byte_array, + const std::vector* a_nullable8_byte_array, + const std::vector* a_nullable_float_array, + const flutter::EncodableList* nullable_nested_list, + const flutter::EncodableMap* nullable_map_with_annotations, + const flutter::EncodableMap* nullable_map_with_object, + const AnEnum* a_nullable_enum, + const std::string* a_nullable_string, + const flutter::EncodableValue* a_nullable_object, + const AllNullableTypes* all_nullable_types, + const flutter::EncodableList* list, + const flutter::EncodableList* string_list, + const flutter::EncodableList* int_list, + const flutter::EncodableList* double_list, + const flutter::EncodableList* bool_list, + const flutter::EncodableList* nested_class_list, + const flutter::EncodableMap* map); ~AllNullableTypes() = default; AllNullableTypes(const AllNullableTypes& other); @@ -246,10 +257,8 @@ class AllNullableTypes { void set_nullable_nested_list(const flutter::EncodableList& value_arg); const flutter::EncodableMap* nullable_map_with_annotations() const; - void set_nullable_map_with_annotations( - const flutter::EncodableMap* value_arg); - void set_nullable_map_with_annotations( - const flutter::EncodableMap& value_arg); + void set_nullable_map_with_annotations(const flutter::EncodableMap* value_arg); + void set_nullable_map_with_annotations(const flutter::EncodableMap& value_arg); const flutter::EncodableMap* nullable_map_with_object() const; void set_nullable_map_with_object(const flutter::EncodableMap* value_arg); @@ -299,6 +308,7 @@ class AllNullableTypes { void set_map(const flutter::EncodableMap* value_arg); void set_map(const flutter::EncodableMap& value_arg); + private: static AllNullableTypes FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -332,8 +342,10 @@ class AllNullableTypes { std::optional bool_list_; std::optional nested_class_list_; std::optional map_; + }; + // The primary purpose for this class is to ensure coverage of Swift structs // with nullable items, as the primary [AllNullableTypes] class is being used to // test Swift classes. @@ -346,23 +358,26 @@ class AllNullableTypesWithoutRecursion { // Constructs an object setting all fields. explicit AllNullableTypesWithoutRecursion( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const int64_t* a_nullable_int64, const double* a_nullable_double, - const std::vector* a_nullable_byte_array, - const std::vector* a_nullable4_byte_array, - const std::vector* a_nullable8_byte_array, - const std::vector* a_nullable_float_array, - const flutter::EncodableList* nullable_nested_list, - const flutter::EncodableMap* nullable_map_with_annotations, - const flutter::EncodableMap* nullable_map_with_object, - const AnEnum* a_nullable_enum, const std::string* a_nullable_string, - const flutter::EncodableValue* a_nullable_object, - const flutter::EncodableList* list, - const flutter::EncodableList* string_list, - const flutter::EncodableList* int_list, - const flutter::EncodableList* double_list, - const flutter::EncodableList* bool_list, - const flutter::EncodableMap* map); + const bool* a_nullable_bool, + const int64_t* a_nullable_int, + const int64_t* a_nullable_int64, + const double* a_nullable_double, + const std::vector* a_nullable_byte_array, + const std::vector* a_nullable4_byte_array, + const std::vector* a_nullable8_byte_array, + const std::vector* a_nullable_float_array, + const flutter::EncodableList* nullable_nested_list, + const flutter::EncodableMap* nullable_map_with_annotations, + const flutter::EncodableMap* nullable_map_with_object, + const AnEnum* a_nullable_enum, + const std::string* a_nullable_string, + const flutter::EncodableValue* a_nullable_object, + const flutter::EncodableList* list, + const flutter::EncodableList* string_list, + const flutter::EncodableList* int_list, + const flutter::EncodableList* double_list, + const flutter::EncodableList* bool_list, + const flutter::EncodableMap* map); const bool* a_nullable_bool() const; void set_a_nullable_bool(const bool* value_arg); @@ -401,10 +416,8 @@ class AllNullableTypesWithoutRecursion { void set_nullable_nested_list(const flutter::EncodableList& value_arg); const flutter::EncodableMap* nullable_map_with_annotations() const; - void set_nullable_map_with_annotations( - const flutter::EncodableMap* value_arg); - void set_nullable_map_with_annotations( - const flutter::EncodableMap& value_arg); + void set_nullable_map_with_annotations(const flutter::EncodableMap* value_arg); + void set_nullable_map_with_annotations(const flutter::EncodableMap& value_arg); const flutter::EncodableMap* nullable_map_with_object() const; void set_nullable_map_with_object(const flutter::EncodableMap* value_arg); @@ -446,9 +459,9 @@ class AllNullableTypesWithoutRecursion { void set_map(const flutter::EncodableMap* value_arg); void set_map(const flutter::EncodableMap& value_arg); + private: - static AllNullableTypesWithoutRecursion FromEncodableList( - const flutter::EncodableList& list); + static AllNullableTypesWithoutRecursion FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; friend class AllClassesWrapper; friend class HostIntegrationCoreApi; @@ -478,8 +491,10 @@ class AllNullableTypesWithoutRecursion { std::optional double_list_; std::optional bool_list_; std::optional map_; + }; + // A class for testing nested class handling. // // This is needed to test nested nullable and non-nullable classes, @@ -493,10 +508,10 @@ class AllClassesWrapper { explicit AllClassesWrapper(const AllNullableTypes& all_nullable_types); // Constructs an object setting all fields. - explicit AllClassesWrapper(const AllNullableTypes& all_nullable_types, - const AllNullableTypesWithoutRecursion* - all_nullable_types_without_recursion, - const AllTypes* all_types); + explicit AllClassesWrapper( + const AllNullableTypes& all_nullable_types, + const AllNullableTypesWithoutRecursion* all_nullable_types_without_recursion, + const AllTypes* all_types); ~AllClassesWrapper() = default; AllClassesWrapper(const AllClassesWrapper& other); @@ -506,20 +521,17 @@ class AllClassesWrapper { const AllNullableTypes& all_nullable_types() const; void set_all_nullable_types(const AllNullableTypes& value_arg); - const AllNullableTypesWithoutRecursion* all_nullable_types_without_recursion() - const; - void set_all_nullable_types_without_recursion( - const AllNullableTypesWithoutRecursion* value_arg); - void set_all_nullable_types_without_recursion( - const AllNullableTypesWithoutRecursion& value_arg); + const AllNullableTypesWithoutRecursion* all_nullable_types_without_recursion() const; + void set_all_nullable_types_without_recursion(const AllNullableTypesWithoutRecursion* value_arg); + void set_all_nullable_types_without_recursion(const AllNullableTypesWithoutRecursion& value_arg); const AllTypes* all_types() const; void set_all_types(const AllTypes* value_arg); void set_all_types(const AllTypes& value_arg); + private: - static AllClassesWrapper FromEncodableList( - const flutter::EncodableList& list); + static AllClassesWrapper FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; friend class HostIntegrationCoreApi; friend class FlutterIntegrationCoreApi; @@ -529,11 +541,12 @@ class AllClassesWrapper { friend class PigeonCodecSerializer; friend class CoreTestsTest; std::unique_ptr all_nullable_types_; - std::unique_ptr - all_nullable_types_without_recursion_; + std::unique_ptr all_nullable_types_without_recursion_; std::unique_ptr all_types_; + }; + // A data class containing a List, used in unit tests. // // Generated class from Pigeon that represents data sent in messages. @@ -549,6 +562,7 @@ class TestMessage { void set_test_list(const flutter::EncodableList* value_arg); void set_test_list(const flutter::EncodableList& value_arg); + private: static TestMessage FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -560,6 +574,7 @@ class TestMessage { friend class PigeonCodecSerializer; friend class CoreTestsTest; std::optional test_list_; + }; class PigeonCodecSerializer : public flutter::StandardCodecSerializer { @@ -570,19 +585,21 @@ class PigeonCodecSerializer : public flutter::StandardCodecSerializer { return sInstance; } - void WriteValue(const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue( + const flutter::EncodableValue& value, + flutter::ByteStreamWriter* stream) const override; protected: flutter::EncodableValue ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const override; + uint8_t type, + flutter::ByteStreamReader* stream) const override; + }; // The core interface that each host language plugin must implement in // platform_test integration tests. // -// Generated interface from Pigeon that represents a handler of messages from -// Flutter. +// Generated interface from Pigeon that represents a handler of messages from Flutter. class HostIntegrationCoreApi { public: HostIntegrationCoreApi(const HostIntegrationCoreApi&) = delete; @@ -598,8 +615,7 @@ class HostIntegrationCoreApi { // Returns an error from a void function, to test error handling. virtual std::optional ThrowErrorFromVoid() = 0; // Returns a Flutter error, to test error handling. - virtual ErrorOr> - ThrowFlutterError() = 0; + virtual ErrorOr> ThrowFlutterError() = 0; // Returns passed in int. virtual ErrorOr EchoInt(int64_t an_int) = 0; // Returns passed in double. @@ -609,417 +625,395 @@ class HostIntegrationCoreApi { // Returns the passed in string. virtual ErrorOr EchoString(const std::string& a_string) = 0; // Returns the passed in Uint8List. - virtual ErrorOr> EchoUint8List( - const std::vector& a_uint8_list) = 0; + virtual ErrorOr> EchoUint8List(const std::vector& a_uint8_list) = 0; // Returns the passed in generic Object. - virtual ErrorOr EchoObject( - const flutter::EncodableValue& an_object) = 0; + virtual ErrorOr EchoObject(const flutter::EncodableValue& an_object) = 0; // Returns the passed list, to test serialization and deserialization. - virtual ErrorOr EchoList( - const flutter::EncodableList& list) = 0; + virtual ErrorOr EchoList(const flutter::EncodableList& list) = 0; // Returns the passed map, to test serialization and deserialization. - virtual ErrorOr EchoMap( - const flutter::EncodableMap& a_map) = 0; - // Returns the passed map to test nested class serialization and - // deserialization. - virtual ErrorOr EchoClassWrapper( - const AllClassesWrapper& wrapper) = 0; + virtual ErrorOr EchoMap(const flutter::EncodableMap& a_map) = 0; + // Returns the passed map to test nested class serialization and deserialization. + virtual ErrorOr EchoClassWrapper(const AllClassesWrapper& wrapper) = 0; // Returns the passed enum to test serialization and deserialization. virtual ErrorOr EchoEnum(const AnEnum& an_enum) = 0; // Returns the default string. - virtual ErrorOr EchoNamedDefaultString( - const std::string& a_string) = 0; + virtual ErrorOr EchoNamedDefaultString(const std::string& a_string) = 0; // Returns passed in double. virtual ErrorOr EchoOptionalDefaultDouble(double a_double) = 0; // Returns passed in int. virtual ErrorOr EchoRequiredInt(int64_t an_int) = 0; // Returns the passed object, to test serialization and deserialization. - virtual ErrorOr> EchoAllNullableTypes( - const AllNullableTypes* everything) = 0; + virtual ErrorOr> EchoAllNullableTypes(const AllNullableTypes* everything) = 0; // Returns the passed object, to test serialization and deserialization. - virtual ErrorOr> - EchoAllNullableTypesWithoutRecursion( - const AllNullableTypesWithoutRecursion* everything) = 0; + virtual ErrorOr> EchoAllNullableTypesWithoutRecursion(const AllNullableTypesWithoutRecursion* everything) = 0; // Returns the inner `aString` value from the wrapped object, to test // sending of nested objects. - virtual ErrorOr> ExtractNestedNullableString( - const AllClassesWrapper& wrapper) = 0; + virtual ErrorOr> ExtractNestedNullableString(const AllClassesWrapper& wrapper) = 0; // Returns the inner `aString` value from the wrapped object, to test // sending of nested objects. - virtual ErrorOr CreateNestedNullableString( - const std::string* nullable_string) = 0; + virtual ErrorOr CreateNestedNullableString(const std::string* nullable_string) = 0; // Returns passed in arguments of multiple types. virtual ErrorOr SendMultipleNullableTypes( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const std::string* a_nullable_string) = 0; + const bool* a_nullable_bool, + const int64_t* a_nullable_int, + const std::string* a_nullable_string) = 0; // Returns passed in arguments of multiple types. - virtual ErrorOr - SendMultipleNullableTypesWithoutRecursion( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const std::string* a_nullable_string) = 0; + virtual ErrorOr SendMultipleNullableTypesWithoutRecursion( + const bool* a_nullable_bool, + const int64_t* a_nullable_int, + const std::string* a_nullable_string) = 0; // Returns passed in int. - virtual ErrorOr> EchoNullableInt( - const int64_t* a_nullable_int) = 0; + virtual ErrorOr> EchoNullableInt(const int64_t* a_nullable_int) = 0; // Returns passed in double. - virtual ErrorOr> EchoNullableDouble( - const double* a_nullable_double) = 0; + virtual ErrorOr> EchoNullableDouble(const double* a_nullable_double) = 0; // Returns the passed in boolean. - virtual ErrorOr> EchoNullableBool( - const bool* a_nullable_bool) = 0; + virtual ErrorOr> EchoNullableBool(const bool* a_nullable_bool) = 0; // Returns the passed in string. - virtual ErrorOr> EchoNullableString( - const std::string* a_nullable_string) = 0; + virtual ErrorOr> EchoNullableString(const std::string* a_nullable_string) = 0; // Returns the passed in Uint8List. - virtual ErrorOr>> EchoNullableUint8List( - const std::vector* a_nullable_uint8_list) = 0; + virtual ErrorOr>> EchoNullableUint8List(const std::vector* a_nullable_uint8_list) = 0; // Returns the passed in generic Object. - virtual ErrorOr> EchoNullableObject( - const flutter::EncodableValue* a_nullable_object) = 0; + virtual ErrorOr> EchoNullableObject(const flutter::EncodableValue* a_nullable_object) = 0; // Returns the passed list, to test serialization and deserialization. - virtual ErrorOr> EchoNullableList( - const flutter::EncodableList* a_nullable_list) = 0; + virtual ErrorOr> EchoNullableList(const flutter::EncodableList* a_nullable_list) = 0; // Returns the passed map, to test serialization and deserialization. - virtual ErrorOr> EchoNullableMap( - const flutter::EncodableMap* a_nullable_map) = 0; - virtual ErrorOr> EchoNullableEnum( - const AnEnum* an_enum) = 0; + virtual ErrorOr> EchoNullableMap(const flutter::EncodableMap* a_nullable_map) = 0; + virtual ErrorOr> EchoNullableEnum(const AnEnum* an_enum) = 0; // Returns passed in int. - virtual ErrorOr> EchoOptionalNullableInt( - const int64_t* a_nullable_int) = 0; + virtual ErrorOr> EchoOptionalNullableInt(const int64_t* a_nullable_int) = 0; // Returns the passed in string. - virtual ErrorOr> EchoNamedNullableString( - const std::string* a_nullable_string) = 0; + virtual ErrorOr> EchoNamedNullableString(const std::string* a_nullable_string) = 0; // A no-op function taking no arguments and returning no value, to sanity // test basic asynchronous calling. - virtual void NoopAsync( - std::function reply)> result) = 0; + virtual void NoopAsync(std::function reply)> result) = 0; // Returns passed in int asynchronously. virtual void EchoAsyncInt( - int64_t an_int, std::function reply)> result) = 0; + int64_t an_int, + std::function reply)> result) = 0; // Returns passed in double asynchronously. virtual void EchoAsyncDouble( - double a_double, std::function reply)> result) = 0; + double a_double, + std::function reply)> result) = 0; // Returns the passed in boolean asynchronously. virtual void EchoAsyncBool( - bool a_bool, std::function reply)> result) = 0; + bool a_bool, + std::function reply)> result) = 0; // Returns the passed string asynchronously. virtual void EchoAsyncString( - const std::string& a_string, - std::function reply)> result) = 0; + const std::string& a_string, + std::function reply)> result) = 0; // Returns the passed in Uint8List asynchronously. virtual void EchoAsyncUint8List( - const std::vector& a_uint8_list, - std::function> reply)> result) = 0; + const std::vector& a_uint8_list, + std::function> reply)> result) = 0; // Returns the passed in generic Object asynchronously. virtual void EchoAsyncObject( - const flutter::EncodableValue& an_object, - std::function reply)> result) = 0; - // Returns the passed list, to test asynchronous serialization and - // deserialization. + const flutter::EncodableValue& an_object, + std::function reply)> result) = 0; + // Returns the passed list, to test asynchronous serialization and deserialization. virtual void EchoAsyncList( - const flutter::EncodableList& list, - std::function reply)> result) = 0; - // Returns the passed map, to test asynchronous serialization and - // deserialization. + const flutter::EncodableList& list, + std::function reply)> result) = 0; + // Returns the passed map, to test asynchronous serialization and deserialization. virtual void EchoAsyncMap( - const flutter::EncodableMap& a_map, - std::function reply)> result) = 0; - // Returns the passed enum, to test asynchronous serialization and - // deserialization. + const flutter::EncodableMap& a_map, + std::function reply)> result) = 0; + // Returns the passed enum, to test asynchronous serialization and deserialization. virtual void EchoAsyncEnum( - const AnEnum& an_enum, - std::function reply)> result) = 0; + const AnEnum& an_enum, + std::function reply)> result) = 0; // Responds with an error from an async function returning a value. - virtual void ThrowAsyncError( - std::function> reply)> - result) = 0; + virtual void ThrowAsyncError(std::function> reply)> result) = 0; // Responds with an error from an async void function. - virtual void ThrowAsyncErrorFromVoid( - std::function reply)> result) = 0; + virtual void ThrowAsyncErrorFromVoid(std::function reply)> result) = 0; // Responds with a Flutter error from an async function returning a value. - virtual void ThrowAsyncFlutterError( - std::function> reply)> - result) = 0; + virtual void ThrowAsyncFlutterError(std::function> reply)> result) = 0; // Returns the passed object, to test async serialization and deserialization. virtual void EchoAsyncAllTypes( - const AllTypes& everything, - std::function reply)> result) = 0; + const AllTypes& everything, + std::function reply)> result) = 0; // Returns the passed object, to test serialization and deserialization. virtual void EchoAsyncNullableAllNullableTypes( - const AllNullableTypes* everything, - std::function> reply)> - result) = 0; + const AllNullableTypes* everything, + std::function> reply)> result) = 0; // Returns the passed object, to test serialization and deserialization. virtual void EchoAsyncNullableAllNullableTypesWithoutRecursion( - const AllNullableTypesWithoutRecursion* everything, - std::function< - void(ErrorOr> reply)> - result) = 0; + const AllNullableTypesWithoutRecursion* everything, + std::function> reply)> result) = 0; // Returns passed in int asynchronously. virtual void EchoAsyncNullableInt( - const int64_t* an_int, - std::function> reply)> result) = 0; + const int64_t* an_int, + std::function> reply)> result) = 0; // Returns passed in double asynchronously. virtual void EchoAsyncNullableDouble( - const double* a_double, - std::function> reply)> result) = 0; + const double* a_double, + std::function> reply)> result) = 0; // Returns the passed in boolean asynchronously. virtual void EchoAsyncNullableBool( - const bool* a_bool, - std::function> reply)> result) = 0; + const bool* a_bool, + std::function> reply)> result) = 0; // Returns the passed string asynchronously. virtual void EchoAsyncNullableString( - const std::string* a_string, - std::function> reply)> - result) = 0; + const std::string* a_string, + std::function> reply)> result) = 0; // Returns the passed in Uint8List asynchronously. virtual void EchoAsyncNullableUint8List( - const std::vector* a_uint8_list, - std::function>> reply)> - result) = 0; + const std::vector* a_uint8_list, + std::function>> reply)> result) = 0; // Returns the passed in generic Object asynchronously. virtual void EchoAsyncNullableObject( - const flutter::EncodableValue* an_object, - std::function> reply)> - result) = 0; - // Returns the passed list, to test asynchronous serialization and - // deserialization. + const flutter::EncodableValue* an_object, + std::function> reply)> result) = 0; + // Returns the passed list, to test asynchronous serialization and deserialization. virtual void EchoAsyncNullableList( - const flutter::EncodableList* list, - std::function> reply)> - result) = 0; - // Returns the passed map, to test asynchronous serialization and - // deserialization. + const flutter::EncodableList* list, + std::function> reply)> result) = 0; + // Returns the passed map, to test asynchronous serialization and deserialization. virtual void EchoAsyncNullableMap( - const flutter::EncodableMap* a_map, - std::function> reply)> - result) = 0; - // Returns the passed enum, to test asynchronous serialization and - // deserialization. + const flutter::EncodableMap* a_map, + std::function> reply)> result) = 0; + // Returns the passed enum, to test asynchronous serialization and deserialization. virtual void EchoAsyncNullableEnum( - const AnEnum* an_enum, - std::function> reply)> result) = 0; - virtual void CallFlutterNoop( - std::function reply)> result) = 0; - virtual void CallFlutterThrowError( - std::function> reply)> - result) = 0; - virtual void CallFlutterThrowErrorFromVoid( - std::function reply)> result) = 0; + const AnEnum* an_enum, + std::function> reply)> result) = 0; + virtual void CallFlutterNoop(std::function reply)> result) = 0; + virtual void CallFlutterThrowError(std::function> reply)> result) = 0; + virtual void CallFlutterThrowErrorFromVoid(std::function reply)> result) = 0; virtual void CallFlutterEchoAllTypes( - const AllTypes& everything, - std::function reply)> result) = 0; + const AllTypes& everything, + std::function reply)> result) = 0; virtual void CallFlutterEchoAllNullableTypes( - const AllNullableTypes* everything, - std::function> reply)> - result) = 0; + const AllNullableTypes* everything, + std::function> reply)> result) = 0; virtual void CallFlutterSendMultipleNullableTypes( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const std::string* a_nullable_string, - std::function reply)> result) = 0; + const bool* a_nullable_bool, + const int64_t* a_nullable_int, + const std::string* a_nullable_string, + std::function reply)> result) = 0; virtual void CallFlutterEchoAllNullableTypesWithoutRecursion( - const AllNullableTypesWithoutRecursion* everything, - std::function< - void(ErrorOr> reply)> - result) = 0; + const AllNullableTypesWithoutRecursion* everything, + std::function> reply)> result) = 0; virtual void CallFlutterSendMultipleNullableTypesWithoutRecursion( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const std::string* a_nullable_string, - std::function reply)> - result) = 0; + const bool* a_nullable_bool, + const int64_t* a_nullable_int, + const std::string* a_nullable_string, + std::function reply)> result) = 0; virtual void CallFlutterEchoBool( - bool a_bool, std::function reply)> result) = 0; + bool a_bool, + std::function reply)> result) = 0; virtual void CallFlutterEchoInt( - int64_t an_int, std::function reply)> result) = 0; + int64_t an_int, + std::function reply)> result) = 0; virtual void CallFlutterEchoDouble( - double a_double, std::function reply)> result) = 0; + double a_double, + std::function reply)> result) = 0; virtual void CallFlutterEchoString( - const std::string& a_string, - std::function reply)> result) = 0; + const std::string& a_string, + std::function reply)> result) = 0; virtual void CallFlutterEchoUint8List( - const std::vector& list, - std::function> reply)> result) = 0; + const std::vector& list, + std::function> reply)> result) = 0; virtual void CallFlutterEchoList( - const flutter::EncodableList& list, - std::function reply)> result) = 0; + const flutter::EncodableList& list, + std::function reply)> result) = 0; virtual void CallFlutterEchoMap( - const flutter::EncodableMap& a_map, - std::function reply)> result) = 0; + const flutter::EncodableMap& a_map, + std::function reply)> result) = 0; virtual void CallFlutterEchoEnum( - const AnEnum& an_enum, - std::function reply)> result) = 0; + const AnEnum& an_enum, + std::function reply)> result) = 0; virtual void CallFlutterEchoNullableBool( - const bool* a_bool, - std::function> reply)> result) = 0; + const bool* a_bool, + std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableInt( - const int64_t* an_int, - std::function> reply)> result) = 0; + const int64_t* an_int, + std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableDouble( - const double* a_double, - std::function> reply)> result) = 0; + const double* a_double, + std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableString( - const std::string* a_string, - std::function> reply)> - result) = 0; + const std::string* a_string, + std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableUint8List( - const std::vector* list, - std::function>> reply)> - result) = 0; + const std::vector* list, + std::function>> reply)> result) = 0; virtual void CallFlutterEchoNullableList( - const flutter::EncodableList* list, - std::function> reply)> - result) = 0; + const flutter::EncodableList* list, + std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableMap( - const flutter::EncodableMap* a_map, - std::function> reply)> - result) = 0; + const flutter::EncodableMap* a_map, + std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableEnum( - const AnEnum* an_enum, - std::function> reply)> result) = 0; + const AnEnum* an_enum, + std::function> reply)> result) = 0; virtual void CallFlutterSmallApiEchoString( - const std::string& a_string, - std::function reply)> result) = 0; + const std::string& a_string, + std::function reply)> result) = 0; // The codec used by HostIntegrationCoreApi. static const flutter::StandardMessageCodec& GetCodec(); - // Sets up an instance of `HostIntegrationCoreApi` to handle messages through - // the `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, - HostIntegrationCoreApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, - HostIntegrationCoreApi* api, - const std::string& message_channel_suffix); + // Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binary_messenger`. + static void SetUp( + flutter::BinaryMessenger* binary_messenger, + HostIntegrationCoreApi* api); + static void SetUp( + flutter::BinaryMessenger* binary_messenger, + HostIntegrationCoreApi* api, + const std::string& message_channel_suffix); static flutter::EncodableValue WrapError(std::string_view error_message); static flutter::EncodableValue WrapError(const FlutterError& error); protected: HostIntegrationCoreApi() = default; + }; // The core interface that the Dart platform_test code implements for host // integration tests to call into. // -// Generated class from Pigeon that represents Flutter messages that can be -// called from C++. +// Generated class from Pigeon that represents Flutter messages that can be called from C++. class FlutterIntegrationCoreApi { public: FlutterIntegrationCoreApi(flutter::BinaryMessenger* binary_messenger); - FlutterIntegrationCoreApi(flutter::BinaryMessenger* binary_messenger, - const std::string& message_channel_suffix); + FlutterIntegrationCoreApi( + flutter::BinaryMessenger* binary_messenger, + const std::string& message_channel_suffix); static const flutter::StandardMessageCodec& GetCodec(); // A no-op function taking no arguments and returning no value, to sanity // test basic calling. - void Noop(std::function&& on_success, - std::function&& on_error); + void Noop( + std::function&& on_success, + std::function&& on_error); // Responds with an error from an async function returning a value. void ThrowError( - std::function&& on_success, - std::function&& on_error); + std::function&& on_success, + std::function&& on_error); // Responds with an error from an async void function. - void ThrowErrorFromVoid(std::function&& on_success, - std::function&& on_error); + void ThrowErrorFromVoid( + std::function&& on_success, + std::function&& on_error); // Returns the passed object, to test serialization and deserialization. - void EchoAllTypes(const AllTypes& everything, - std::function&& on_success, - std::function&& on_error); + void EchoAllTypes( + const AllTypes& everything, + std::function&& on_success, + std::function&& on_error); // Returns the passed object, to test serialization and deserialization. void EchoAllNullableTypes( - const AllNullableTypes* everything, - std::function&& on_success, - std::function&& on_error); + const AllNullableTypes* everything, + std::function&& on_success, + std::function&& on_error); // Returns passed in arguments of multiple types. // // Tests multiple-arity FlutterApi handling. void SendMultipleNullableTypes( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const std::string* a_nullable_string, - std::function&& on_success, - std::function&& on_error); + const bool* a_nullable_bool, + const int64_t* a_nullable_int, + const std::string* a_nullable_string, + std::function&& on_success, + std::function&& on_error); // Returns the passed object, to test serialization and deserialization. void EchoAllNullableTypesWithoutRecursion( - const AllNullableTypesWithoutRecursion* everything, - std::function&& on_success, - std::function&& on_error); + const AllNullableTypesWithoutRecursion* everything, + std::function&& on_success, + std::function&& on_error); // Returns passed in arguments of multiple types. // // Tests multiple-arity FlutterApi handling. void SendMultipleNullableTypesWithoutRecursion( - const bool* a_nullable_bool, const int64_t* a_nullable_int, - const std::string* a_nullable_string, - std::function&& on_success, - std::function&& on_error); + const bool* a_nullable_bool, + const int64_t* a_nullable_int, + const std::string* a_nullable_string, + std::function&& on_success, + std::function&& on_error); // Returns the passed boolean, to test serialization and deserialization. - void EchoBool(bool a_bool, std::function&& on_success, - std::function&& on_error); + void EchoBool( + bool a_bool, + std::function&& on_success, + std::function&& on_error); // Returns the passed int, to test serialization and deserialization. - void EchoInt(int64_t an_int, std::function&& on_success, - std::function&& on_error); + void EchoInt( + int64_t an_int, + std::function&& on_success, + std::function&& on_error); // Returns the passed double, to test serialization and deserialization. - void EchoDouble(double a_double, std::function&& on_success, - std::function&& on_error); + void EchoDouble( + double a_double, + std::function&& on_success, + std::function&& on_error); // Returns the passed string, to test serialization and deserialization. - void EchoString(const std::string& a_string, - std::function&& on_success, - std::function&& on_error); + void EchoString( + const std::string& a_string, + std::function&& on_success, + std::function&& on_error); // Returns the passed byte list, to test serialization and deserialization. void EchoUint8List( - const std::vector& list, - std::function&)>&& on_success, - std::function&& on_error); + const std::vector& list, + std::function&)>&& on_success, + std::function&& on_error); // Returns the passed list, to test serialization and deserialization. - void EchoList(const flutter::EncodableList& list, - std::function&& on_success, - std::function&& on_error); + void EchoList( + const flutter::EncodableList& list, + std::function&& on_success, + std::function&& on_error); // Returns the passed map, to test serialization and deserialization. - void EchoMap(const flutter::EncodableMap& a_map, - std::function&& on_success, - std::function&& on_error); + void EchoMap( + const flutter::EncodableMap& a_map, + std::function&& on_success, + std::function&& on_error); // Returns the passed enum to test serialization and deserialization. - void EchoEnum(const AnEnum& an_enum, - std::function&& on_success, - std::function&& on_error); + void EchoEnum( + const AnEnum& an_enum, + std::function&& on_success, + std::function&& on_error); // Returns the passed boolean, to test serialization and deserialization. - void EchoNullableBool(const bool* a_bool, - std::function&& on_success, - std::function&& on_error); + void EchoNullableBool( + const bool* a_bool, + std::function&& on_success, + std::function&& on_error); // Returns the passed int, to test serialization and deserialization. - void EchoNullableInt(const int64_t* an_int, - std::function&& on_success, - std::function&& on_error); + void EchoNullableInt( + const int64_t* an_int, + std::function&& on_success, + std::function&& on_error); // Returns the passed double, to test serialization and deserialization. - void EchoNullableDouble(const double* a_double, - std::function&& on_success, - std::function&& on_error); + void EchoNullableDouble( + const double* a_double, + std::function&& on_success, + std::function&& on_error); // Returns the passed string, to test serialization and deserialization. - void EchoNullableString(const std::string* a_string, - std::function&& on_success, - std::function&& on_error); + void EchoNullableString( + const std::string* a_string, + std::function&& on_success, + std::function&& on_error); // Returns the passed byte list, to test serialization and deserialization. void EchoNullableUint8List( - const std::vector* list, - std::function*)>&& on_success, - std::function&& on_error); + const std::vector* list, + std::function*)>&& on_success, + std::function&& on_error); // Returns the passed list, to test serialization and deserialization. void EchoNullableList( - const flutter::EncodableList* list, - std::function&& on_success, - std::function&& on_error); + const flutter::EncodableList* list, + std::function&& on_success, + std::function&& on_error); // Returns the passed map, to test serialization and deserialization. void EchoNullableMap( - const flutter::EncodableMap* a_map, - std::function&& on_success, - std::function&& on_error); + const flutter::EncodableMap* a_map, + std::function&& on_success, + std::function&& on_error); // Returns the passed enum to test serialization and deserialization. - void EchoNullableEnum(const AnEnum* an_enum, - std::function&& on_success, - std::function&& on_error); + void EchoNullableEnum( + const AnEnum* an_enum, + std::function&& on_success, + std::function&& on_error); // A no-op function taking no arguments and returning no value, to sanity // test basic asynchronous calling. - void NoopAsync(std::function&& on_success, - std::function&& on_error); + void NoopAsync( + std::function&& on_success, + std::function&& on_error); // Returns the passed in generic Object asynchronously. - void EchoAsyncString(const std::string& a_string, - std::function&& on_success, - std::function&& on_error); + void EchoAsyncString( + const std::string& a_string, + std::function&& on_success, + std::function&& on_error); private: flutter::BinaryMessenger* binary_messenger_; @@ -1028,8 +1022,7 @@ class FlutterIntegrationCoreApi { // An API that can be implemented for minimal, compile-only tests. // -// Generated interface from Pigeon that represents a handler of messages from -// Flutter. +// Generated interface from Pigeon that represents a handler of messages from Flutter. class HostTrivialApi { public: HostTrivialApi(const HostTrivialApi&) = delete; @@ -1039,64 +1032,69 @@ class HostTrivialApi { // The codec used by HostTrivialApi. static const flutter::StandardMessageCodec& GetCodec(); - // Sets up an instance of `HostTrivialApi` to handle messages through the - // `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, - HostTrivialApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, - HostTrivialApi* api, - const std::string& message_channel_suffix); + // Sets up an instance of `HostTrivialApi` to handle messages through the `binary_messenger`. + static void SetUp( + flutter::BinaryMessenger* binary_messenger, + HostTrivialApi* api); + static void SetUp( + flutter::BinaryMessenger* binary_messenger, + HostTrivialApi* api, + const std::string& message_channel_suffix); static flutter::EncodableValue WrapError(std::string_view error_message); static flutter::EncodableValue WrapError(const FlutterError& error); protected: HostTrivialApi() = default; + }; // A simple API implemented in some unit tests. // -// Generated interface from Pigeon that represents a handler of messages from -// Flutter. +// Generated interface from Pigeon that represents a handler of messages from Flutter. class HostSmallApi { public: HostSmallApi(const HostSmallApi&) = delete; HostSmallApi& operator=(const HostSmallApi&) = delete; virtual ~HostSmallApi() {} - virtual void Echo(const std::string& a_string, - std::function reply)> result) = 0; - virtual void VoidVoid( - std::function reply)> result) = 0; + virtual void Echo( + const std::string& a_string, + std::function reply)> result) = 0; + virtual void VoidVoid(std::function reply)> result) = 0; // The codec used by HostSmallApi. static const flutter::StandardMessageCodec& GetCodec(); - // Sets up an instance of `HostSmallApi` to handle messages through the - // `binary_messenger`. - static void SetUp(flutter::BinaryMessenger* binary_messenger, - HostSmallApi* api); - static void SetUp(flutter::BinaryMessenger* binary_messenger, - HostSmallApi* api, - const std::string& message_channel_suffix); + // Sets up an instance of `HostSmallApi` to handle messages through the `binary_messenger`. + static void SetUp( + flutter::BinaryMessenger* binary_messenger, + HostSmallApi* api); + static void SetUp( + flutter::BinaryMessenger* binary_messenger, + HostSmallApi* api, + const std::string& message_channel_suffix); static flutter::EncodableValue WrapError(std::string_view error_message); static flutter::EncodableValue WrapError(const FlutterError& error); protected: HostSmallApi() = default; + }; // A simple API called in some unit tests. // -// Generated class from Pigeon that represents Flutter messages that can be -// called from C++. +// Generated class from Pigeon that represents Flutter messages that can be called from C++. class FlutterSmallApi { public: FlutterSmallApi(flutter::BinaryMessenger* binary_messenger); - FlutterSmallApi(flutter::BinaryMessenger* binary_messenger, - const std::string& message_channel_suffix); + FlutterSmallApi( + flutter::BinaryMessenger* binary_messenger, + const std::string& message_channel_suffix); static const flutter::StandardMessageCodec& GetCodec(); - void EchoWrappedList(const TestMessage& msg, - std::function&& on_success, - std::function&& on_error); - void EchoString(const std::string& a_string, - std::function&& on_success, - std::function&& on_error); + void EchoWrappedList( + const TestMessage& msg, + std::function&& on_success, + std::function&& on_error); + void EchoString( + const std::string& a_string, + std::function&& on_success, + std::function&& on_error); private: flutter::BinaryMessenger* binary_messenger_; From bd08aa07a25bee1b67d5eb3d0486e705e9f5a0b8 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Fri, 19 Jul 2024 16:28:56 -0400 Subject: [PATCH 51/77] same code no gens --- packages/pigeon/lib/kotlin/templates.dart | 24 +++++++++---- packages/pigeon/lib/kotlin_generator.dart | 41 +++++++---------------- 2 files changed, 31 insertions(+), 34 deletions(-) diff --git a/packages/pigeon/lib/kotlin/templates.dart b/packages/pigeon/lib/kotlin/templates.dart index f6bb48744b26..25fa860c1148 100644 --- a/packages/pigeon/lib/kotlin/templates.dart +++ b/packages/pigeon/lib/kotlin/templates.dart @@ -3,10 +3,22 @@ // found in the LICENSE file. import '../generator_tools.dart'; +import '../kotlin_generator.dart'; + +/// Name of the Kotlin `InstanceManager`. +String kotlinInstanceManagerClassName(KotlinOptions options) => + '${options.fileSpecificClassNameComponent ?? ''}${classNamePrefix}InstanceManager'; + +/// The name of the registrar containing all the ProxyApi implementations. +String proxyApiRegistrarName(KotlinOptions options) => + '${options.fileSpecificClassNameComponent ?? ''}${classNamePrefix}ProxyApiRegistrar'; + +/// The name of the codec that handles ProxyApis. +String proxyApiCodecName(KotlinOptions options) => + '${options.fileSpecificClassNameComponent ?? ''}${classNamePrefix}ProxyApiBaseCodec'; /// The Kotlin `InstanceManager`. -String instanceManagerTemplate({required String prefix}) { - final String instanceManagerName = '$prefix$instanceManagerClassName'; +String instanceManagerTemplate(KotlinOptions options) { return ''' /** * Maintains instances used to communicate with the corresponding objects in Dart. @@ -24,7 +36,7 @@ String instanceManagerTemplate({required String prefix}) { * is recreated. The strong reference will then need to be removed manually again. */ @Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") -class $instanceManagerName(private val finalizationListener: $_finalizationListenerClassName) { +class ${kotlinInstanceManagerClassName(options)}(private val finalizationListener: $_finalizationListenerClassName) { /** Interface for listening when a weak reference of an instance is removed from the manager. */ interface $_finalizationListenerClassName { fun onFinalize(identifier: Long) @@ -71,8 +83,8 @@ class $instanceManagerName(private val finalizationListener: $_finalizationListe * * When the manager is no longer needed, [stopFinalizationListener] must be called. */ - fun create(finalizationListener: $_finalizationListenerClassName): $instanceManagerName { - return $instanceManagerName(finalizationListener) + fun create(finalizationListener: $_finalizationListenerClassName): ${kotlinInstanceManagerClassName(options)} { + return ${kotlinInstanceManagerClassName(options)}(finalizationListener) } } @@ -95,7 +107,7 @@ class $instanceManagerName(private val finalizationListener: $_finalizationListe * * * If this method returns a nonnull identifier, this method also expects the Dart - * `$instanceManagerName` to have, or recreate, a weak reference to the Dart instance the + * `${kotlinInstanceManagerClassName(options)}` to have, or recreate, a weak reference to the Dart instance the * identifier is associated with. */ fun getIdentifierForStrongReference(instance: Any?): Long? { diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index fc2351eabd56..18dfef5cd85f 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -534,9 +534,7 @@ class KotlinGenerator extends StructuredGenerator { Indent indent, { required String dartPackageName, }) { - indent.format(instanceManagerTemplate( - prefix: _getFilePrefixOrEmpty(generatorOptions), - )); + indent.format(instanceManagerTemplate(generatorOptions)); indent.newln(); } @@ -547,10 +545,8 @@ class KotlinGenerator extends StructuredGenerator { Indent indent, { required String dartPackageName, }) { - final String instanceManagerName = - '${_getFilePrefixOrEmpty(generatorOptions)}$instanceManagerClassName'; - - final String instanceManagerApiName = '${instanceManagerName}Api'; + final String instanceManagerApiName = + '${kotlinInstanceManagerClassName(generatorOptions)}Api'; final String removeStrongReferenceName = makeChannelNameWithStrings( apiName: '${instanceManagerClassName}Api', @@ -595,7 +591,7 @@ class KotlinGenerator extends StructuredGenerator { _docCommentSpec, ); indent.writeScoped( - 'fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: $instanceManagerName?) {', + 'fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: ${kotlinInstanceManagerClassName(generatorOptions)}?) {', '}', () { const String setHandlerCondition = 'instanceManager != null'; @@ -671,15 +667,10 @@ class KotlinGenerator extends StructuredGenerator { _writeProxyApiRegistrar( indent, + generatorOptions: generatorOptions, allProxyApis: allProxyApis, - filePrefix: _getFilePrefixOrEmpty(generatorOptions), ); - final String fullPrefix = - '${_getFilePrefixOrEmpty(generatorOptions)}$classNamePrefix'; - - final String codecName = '${fullPrefix}ProxyApiBaseCodec'; - // Sort APIs where edges are an API's super class and interfaces. // // This sorts the APIs to have child classes be listed before their parent @@ -708,7 +699,7 @@ class KotlinGenerator extends StructuredGenerator { ); indent.writeScoped( - 'private class $codecName(val registrar: ${fullPrefix}ProxyApiRegistrar) : ' + 'private class ${proxyApiCodecName(generatorOptions)}(val registrar: ${proxyApiRegistrarName(generatorOptions)}) : ' '${generatorOptions.fileSpecificClassNameComponent}$_codecName() {', '}', () { @@ -780,9 +771,6 @@ class KotlinGenerator extends StructuredGenerator { }) { final String kotlinApiName = '$hostProxyApiPrefix${api.name}'; - final String fullPrefix = - '${_getFilePrefixOrEmpty(generatorOptions)}$classNamePrefix'; - addDocumentationComments( indent, api.documentationComments, @@ -793,7 +781,7 @@ class KotlinGenerator extends StructuredGenerator { final String classModifier = api.hasMethodsRequiringImplementation() ? 'abstract' : 'open'; indent.writeScoped( - '$classModifier class $kotlinApiName(open val pigeonRegistrar: ${fullPrefix}ProxyApiRegistrar) {', + '$classModifier class $kotlinApiName(open val pigeonRegistrar: ${proxyApiRegistrarName(generatorOptions)}) {', '}', () { final String fullKotlinClassName = @@ -1209,12 +1197,13 @@ class KotlinGenerator extends StructuredGenerator { void _writeProxyApiRegistrar( Indent indent, { + required KotlinOptions generatorOptions, required Iterable allProxyApis, - required String filePrefix, }) { - final String registrarName = - '$filePrefix${classNamePrefix}ProxyApiRegistrar'; - final String instanceManagerName = '$filePrefix$instanceManagerClassName'; + final String registrarName = proxyApiRegistrarName(generatorOptions); + final String instanceManagerName = kotlinInstanceManagerClassName( + generatorOptions, + ); final String instanceManagerApiName = '${instanceManagerName}Api'; addDocumentationComments( @@ -1236,7 +1225,7 @@ class KotlinGenerator extends StructuredGenerator { val codec: StandardMessageCodec get() { if (_codec == null) { - _codec = $filePrefix${classNamePrefix}ProxyApiBaseCodec(this) + _codec = ${proxyApiCodecName(generatorOptions)}(this) } return _codec!! } @@ -1834,10 +1823,6 @@ class KotlinGenerator extends StructuredGenerator { ); } -String _getFilePrefixOrEmpty(KotlinOptions options) { - return options.fileSpecificClassNameComponent ?? ''; -} - String _getErrorClassName(KotlinOptions generatorOptions) => generatorOptions.errorClassName ?? 'FlutterError'; From b2ae8585629684ed96e800bf89e97fb0bd01969a Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Fri, 19 Jul 2024 16:29:55 -0400 Subject: [PATCH 52/77] formatting --- .../java/io/flutter/plugins/Messages.java | 92 +- .../flutter/pigeon_example_app/Messages.g.kt | 143 +- .../example/app/lib/src/messages.g.dart | 56 +- .../example/app/macos/Runner/messages.g.h | 33 +- .../example/app/macos/Runner/messages.g.m | 146 +- .../example/app/windows/runner/messages.g.cpp | 365 +- .../example/app/windows/runner/messages.g.h | 85 +- .../CoreTests.java | 1700 ++-- .../ios/Classes/CoreTests.gen.h | 632 +- .../ios/Classes/CoreTests.gen.m | 3197 ++++--- .../macos/Classes/CoreTests.gen.h | 626 +- .../macos/Classes/CoreTests.gen.m | 3181 ++++--- .../background_platform_channels.gen.dart | 13 +- .../lib/src/generated/core_tests.gen.dart | 1122 ++- .../lib/src/generated/enum.gen.dart | 47 +- .../src/generated/flutter_unittests.gen.dart | 42 +- .../lib/src/generated/message.gen.dart | 73 +- .../lib/src/generated/multiple_arity.gen.dart | 38 +- .../src/generated/non_null_fields.gen.dart | 58 +- .../lib/src/generated/null_fields.gen.dart | 51 +- .../src/generated/nullable_returns.gen.dart | 139 +- .../lib/src/generated/primitive.gen.dart | 202 +- .../src/generated/proxy_api_tests.gen.dart | 95 +- .../test/test_message.gen.dart | 100 +- .../com/example/test_plugin/CoreTests.gen.kt | 2033 +++-- .../example/test_plugin/ProxyApiTests.gen.kt | 2379 ++++-- .../windows/pigeon/core_tests.gen.cpp | 7387 ++++++++++------- .../windows/pigeon/core_tests.gen.h | 760 +- 28 files changed, 15559 insertions(+), 9236 deletions(-) diff --git a/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java b/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java index 9676d99075a8..8b07206873a2 100644 --- a/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java +++ b/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java @@ -19,9 +19,7 @@ import java.lang.annotation.Target; import java.nio.ByteBuffer; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; @@ -39,8 +37,7 @@ public static class FlutterError extends RuntimeException { /** The error details. Must be a datatype supported by the api codec. */ public final Object details; - public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) - { + public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) { super(message); this.code = code; this.details = details; @@ -59,14 +56,15 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { errorList.add(exception.toString()); errorList.add(exception.getClass().getSimpleName()); errorList.add( - "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); + "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); } return errorList; } @NonNull protected static FlutterError createConnectionError(@NonNull String channelName) { - return new FlutterError("channel-error", "Unable to establish connection on channel: " + channelName + ".", ""); + return new FlutterError( + "channel-error", "Unable to establish connection on channel: " + channelName + ".", ""); } @Target(METHOD) @@ -137,10 +135,17 @@ public void setData(@NonNull Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } MessageData that = (MessageData) o; - return Objects.equals(name, that.name) && Objects.equals(description, that.description) && code.equals(that.code) && data.equals(that.data); + return Objects.equals(name, that.name) + && Objects.equals(description, that.description) + && code.equals(that.code) + && data.equals(that.data); } @Override @@ -248,7 +253,6 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } } - /** Asynchronous error handling return type for non-nullable API method returns. */ public interface Result { /** Success case callback method for handling returns. */ @@ -276,10 +280,10 @@ public interface VoidResult { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ExampleHostApi { - @NonNull + @NonNull String getHostLanguage(); - @NonNull + @NonNull Long add(@NonNull Long a, @NonNull Long b); void sendMessage(@NonNull MessageData message, @NonNull Result result); @@ -288,16 +292,23 @@ public interface ExampleHostApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - /**Sets up an instance of `ExampleHostApi` to handle messages through the `binaryMessenger`. */ + /** Sets up an instance of `ExampleHostApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable ExampleHostApi api) { setUp(binaryMessenger, "", api); } - static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String messageChannelSuffix, @Nullable ExampleHostApi api) { + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable ExampleHostApi api) { messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -305,8 +316,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { String output = api.getHostLanguage(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -319,7 +329,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -328,10 +341,12 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess Number aArg = (Number) args.get(0); Number bArg = (Number) args.get(1); try { - Long output = api.add((aArg == null) ? null : aArg.longValue(), (bArg == null) ? null : bArg.longValue()); + Long output = + api.add( + (aArg == null) ? null : aArg.longValue(), + (bArg == null) ? null : bArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -344,7 +359,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -380,38 +398,50 @@ public static class MessageFlutterApi { public MessageFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this(argBinaryMessenger, ""); } - public MessageFlutterApi(@NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { + + public MessageFlutterApi( + @NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { this.binaryMessenger = argBinaryMessenger; this.messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ /** The codec used by MessageFlutterApi. */ static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + public void flutterMethod(@Nullable String aStringArg, @NonNull Result result) { - final String channelName = "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aStringArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") String output = (String) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } } diff --git a/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt b/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt index c069119bb465..11dea4d923a7 100644 --- a/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt +++ b/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt @@ -5,7 +5,6 @@ // See also: https://pub.dev/packages/pigeon @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") - import android.util.Log import io.flutter.plugin.common.BasicMessageChannel import io.flutter.plugin.common.BinaryMessenger @@ -20,33 +19,31 @@ private fun wrapResult(result: Any?): List { private fun wrapError(exception: Throwable): List { return if (exception is FlutterError) { - listOf( - exception.code, - exception.message, - exception.details - ) + listOf(exception.code, exception.message, exception.details) } else { listOf( - exception.javaClass.simpleName, - exception.toString(), - "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) - ) + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)) } } private fun createConnectionError(channelName: String): FlutterError { - return FlutterError("channel-error", "Unable to establish connection on channel: '$channelName'.", "")} + return FlutterError( + "channel-error", "Unable to establish connection on channel: '$channelName'.", "") +} /** * Error class for passing custom error details to Flutter via a thrown PlatformException. + * * @property code The error code. * @property message The error message. * @property details The error details. Must be a datatype supported by the api codec. */ -class FlutterError ( - val code: String, - override val message: String? = null, - val details: Any? = null +class FlutterError( + val code: String, + override val message: String? = null, + val details: Any? = null ) : Throwable() enum class Code(val raw: Int) { @@ -61,12 +58,11 @@ enum class Code(val raw: Int) { } /** Generated class from Pigeon that represents data sent in messages. */ -data class MessageData ( - val name: String? = null, - val description: String? = null, - val code: Code, - val data: Map - +data class MessageData( + val name: String? = null, + val description: String? = null, + val code: Code, + val data: Map ) { companion object { @Suppress("LocalVariableName") @@ -78,32 +74,31 @@ data class MessageData ( return MessageData(name, description, code, data) } } + fun toList(): List { return listOf( - name, - description, - code, - data, + name, + description, + code, + data, ) } } + private open class MessagesPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as? List)?.let { - MessageData.fromList(it) - } + return (readValue(buffer) as? List)?.let { MessageData.fromList(it) } } 130.toByte() -> { - return (readValue(buffer) as Int?)?.let { - Code.ofRaw(it) - } + return (readValue(buffer) as Int?)?.let { Code.ofRaw(it) } } else -> super.readValueOfType(type, buffer) } } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is MessageData -> { stream.write(129) @@ -118,31 +113,40 @@ private open class MessagesPigeonCodec : StandardMessageCodec() { } } - /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ interface ExampleHostApi { fun getHostLanguage(): String + fun add(a: Long, b: Long): Long + fun sendMessage(message: MessageData, callback: (Result) -> Unit) companion object { /** The codec used by ExampleHostApi. */ - val codec: MessageCodec by lazy { - MessagesPigeonCodec() - } + val codec: MessageCodec by lazy { MessagesPigeonCodec() } /** Sets up an instance of `ExampleHostApi` to handle messages through the `binaryMessenger`. */ @JvmOverloads - fun setUp(binaryMessenger: BinaryMessenger, api: ExampleHostApi?, messageChannelSuffix: String = "") { - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + fun setUp( + binaryMessenger: BinaryMessenger, + api: ExampleHostApi?, + messageChannelSuffix: String = "" + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = try { - listOf(api.getHostLanguage()) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.getHostLanguage()) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -150,17 +154,22 @@ interface ExampleHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } val bArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = try { - listOf(api.add(aArg, bArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.add(aArg, bArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -168,7 +177,11 @@ interface ExampleHostApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -191,31 +204,39 @@ interface ExampleHostApi { } } /** Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. */ -class MessageFlutterApi(private val binaryMessenger: BinaryMessenger, private val messageChannelSuffix: String = "") { +class MessageFlutterApi( + private val binaryMessenger: BinaryMessenger, + private val messageChannelSuffix: String = "" +) { companion object { /** The codec used by MessageFlutterApi. */ - val codec: MessageCodec by lazy { - MessagesPigeonCodec() - } + val codec: MessageCodec by lazy { MessagesPigeonCodec() } } - fun flutterMethod(aStringArg: String?, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod$separatedMessageChannelSuffix" + + fun flutterMethod(aStringArg: String?, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aStringArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as String callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } } diff --git a/packages/pigeon/example/app/lib/src/messages.g.dart b/packages/pigeon/example/app/lib/src/messages.g.dart index 347d829860e6..d8d4fde551c5 100644 --- a/packages/pigeon/example/app/lib/src/messages.g.dart +++ b/packages/pigeon/example/app/lib/src/messages.g.dart @@ -18,7 +18,8 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -69,7 +70,6 @@ class MessageData { } } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -77,7 +77,7 @@ class _PigeonCodec extends StandardMessageCodec { if (value is MessageData) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is Code) { + } else if (value is Code) { buffer.putUint8(130); writeValue(buffer, value.index); } else { @@ -88,9 +88,9 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return MessageData.decode(readValue(buffer)!); - case 130: + case 130: final int? value = readValue(buffer) as int?; return value == null ? null : Code.values[value]; default: @@ -103,9 +103,11 @@ class ExampleHostApi { /// Constructor for [ExampleHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - ExampleHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + ExampleHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -113,8 +115,10 @@ class ExampleHostApi { final String __pigeon_messageChannelSuffix; Future getHostLanguage() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -140,8 +144,10 @@ class ExampleHostApi { } Future add(int a, int b) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -167,8 +173,10 @@ class ExampleHostApi { } Future sendMessage(MessageData message) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -199,18 +207,25 @@ abstract class MessageFlutterApi { String flutterMethod(String? aString); - static void setUp(MessageFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp( + MessageFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod was null.'); + 'Argument for dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); try { @@ -218,8 +233,9 @@ abstract class MessageFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/example/app/macos/Runner/messages.g.h b/packages/pigeon/example/app/macos/Runner/messages.g.h index b5ce93a7fd30..8a51885ec9f1 100644 --- a/packages/pigeon/example/app/macos/Runner/messages.g.h +++ b/packages/pigeon/example/app/macos/Runner/messages.g.h @@ -30,13 +30,13 @@ typedef NS_ENUM(NSUInteger, PGNCode) { /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithName:(nullable NSString *)name - description:(nullable NSString *)description - code:(PGNCode)code - data:(NSDictionary *)data; -@property(nonatomic, copy, nullable) NSString * name; -@property(nonatomic, copy, nullable) NSString * description; + description:(nullable NSString *)description + code:(PGNCode)code + data:(NSDictionary *)data; +@property(nonatomic, copy, nullable) NSString *name; +@property(nonatomic, copy, nullable) NSString *description; @property(nonatomic, assign) PGNCode code; -@property(nonatomic, copy) NSDictionary * data; +@property(nonatomic, copy) NSDictionary *data; @end /// The codec used by all APIs. @@ -46,19 +46,26 @@ NSObject *PGNGetMessagesCodec(void); /// @return `nil` only when `error != nil`. - (nullable NSString *)getHostLanguageWithError:(FlutterError *_Nullable *_Nonnull)error; /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)addNumber:(NSInteger)a toNumber:(NSInteger)b error:(FlutterError *_Nullable *_Nonnull)error; -- (void)sendMessageMessage:(PGNMessageData *)message completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (nullable NSNumber *)addNumber:(NSInteger)a + toNumber:(NSInteger)b + error:(FlutterError *_Nullable *_Nonnull)error; +- (void)sendMessageMessage:(PGNMessageData *)message + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; @end -extern void SetUpPGNExampleHostApi(id binaryMessenger, NSObject *_Nullable api); - -extern void SetUpPGNExampleHostApiWithSuffix(id binaryMessenger, NSObject *_Nullable api, NSString *messageChannelSuffix); +extern void SetUpPGNExampleHostApi(id binaryMessenger, + NSObject *_Nullable api); +extern void SetUpPGNExampleHostApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); @interface PGNMessageFlutterApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -- (void)flutterMethodAString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix; +- (void)flutterMethodAString:(nullable NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end NS_ASSUME_NONNULL_END diff --git a/packages/pigeon/example/app/macos/Runner/messages.g.m b/packages/pigeon/example/app/macos/Runner/messages.g.m index 5d2052266307..1471345b8801 100644 --- a/packages/pigeon/example/app/macos/Runner/messages.g.m +++ b/packages/pigeon/example/app/macos/Runner/messages.g.m @@ -26,7 +26,12 @@ } static FlutterError *createConnectionError(NSString *channelName) { - return [FlutterError errorWithCode:@"channel-error" message:[NSString stringWithFormat:@"%@/%@/%@", @"Unable to establish connection on channel: '", channelName, @"'."] details:@""]; + return [FlutterError + errorWithCode:@"channel-error" + message:[NSString stringWithFormat:@"%@/%@/%@", + @"Unable to establish connection on channel: '", + channelName, @"'."] + details:@""]; } static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { @@ -52,10 +57,10 @@ + (nullable PGNMessageData *)nullableFromList:(NSArray *)list; @implementation PGNMessageData + (instancetype)makeWithName:(nullable NSString *)name - description:(nullable NSString *)description - code:(PGNCode)code - data:(NSDictionary *)data { - PGNMessageData* pigeonResult = [[PGNMessageData alloc] init]; + description:(nullable NSString *)description + code:(PGNCode)code + data:(NSDictionary *)data { + PGNMessageData *pigeonResult = [[PGNMessageData alloc] init]; pigeonResult.name = name; pigeonResult.description = description; pigeonResult.code = code; @@ -89,13 +94,13 @@ @interface PGNMessagesPigeonCodecReader : FlutterStandardReader @implementation PGNMessagesPigeonCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 129: + case 129: return [PGNMessageData fromList:[self readValue]]; - case 130: - { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil ? nil : [[PGNCodeBox alloc] initWithValue:[enumAsNumber integerValue]]; - } + case 130: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[PGNCodeBox alloc] initWithValue:[enumAsNumber integerValue]]; + } default: return [super readValueOfType:type]; } @@ -110,7 +115,7 @@ - (void)writeValue:(id)value { [self writeByte:129]; [self writeValue:[value toList]]; } else if ([value isKindOfClass:[PGNCodeBox class]]) { - PGNCodeBox * box = (PGNCodeBox *)value; + PGNCodeBox *box = (PGNCodeBox *)value; [self writeByte:130]; [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; } else { @@ -134,25 +139,36 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - PGNMessagesPigeonCodecReaderWriter *readerWriter = [[PGNMessagesPigeonCodecReaderWriter alloc] init]; + PGNMessagesPigeonCodecReaderWriter *readerWriter = + [[PGNMessagesPigeonCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } -void SetUpPGNExampleHostApi(id binaryMessenger, NSObject *api) { +void SetUpPGNExampleHostApi(id binaryMessenger, + NSObject *api) { SetUpPGNExampleHostApiWithSuffix(binaryMessenger, api, @""); } -void SetUpPGNExampleHostApiWithSuffix(id binaryMessenger, NSObject *api, NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat: @".%@", messageChannelSuffix] : @""; +void SetUpPGNExampleHostApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_example_package." + @"ExampleHostApi.getHostLanguage", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:PGNGetMessagesCodec()]; + codec:PGNGetMessagesCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(getHostLanguageWithError:)], @"PGNExampleHostApi api (%@) doesn't respond to @selector(getHostLanguageWithError:)", api); + NSCAssert( + [api respondsToSelector:@selector(getHostLanguageWithError:)], + @"PGNExampleHostApi api (%@) doesn't respond to @selector(getHostLanguageWithError:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; NSString *output = [api getHostLanguageWithError:&error]; @@ -163,13 +179,19 @@ void SetUpPGNExampleHostApiWithSuffix(id binaryMessenger } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:PGNGetMessagesCodec()]; + codec:PGNGetMessagesCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(addNumber:toNumber:error:)], @"PGNExampleHostApi api (%@) doesn't respond to @selector(addNumber:toNumber:error:)", api); + NSCAssert( + [api respondsToSelector:@selector(addNumber:toNumber:error:)], + @"PGNExampleHostApi api (%@) doesn't respond to @selector(addNumber:toNumber:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_a = [GetNullableObjectAtIndex(args, 0) integerValue]; @@ -183,19 +205,25 @@ void SetUpPGNExampleHostApiWithSuffix(id binaryMessenger } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_example_package." + @"ExampleHostApi.sendMessage", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:PGNGetMessagesCodec()]; + codec:PGNGetMessagesCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(sendMessageMessage:completion:)], @"PGNExampleHostApi api (%@) doesn't respond to @selector(sendMessageMessage:completion:)", api); + NSCAssert([api respondsToSelector:@selector(sendMessageMessage:completion:)], + @"PGNExampleHostApi api (%@) doesn't respond to " + @"@selector(sendMessageMessage:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; PGNMessageData *arg_message = GetNullableObjectAtIndex(args, 0); - [api sendMessageMessage:arg_message completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api sendMessageMessage:arg_message + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -212,33 +240,41 @@ @implementation PGNMessageFlutterApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; } -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger messageChannelSuffix:(nullable NSString*)messageChannelSuffix{ +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix { self = [self init]; if (self) { _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 ? @"" : [NSString stringWithFormat: @".%@", messageChannelSuffix]; + _messageChannelSuffix = [messageChannelSuffix length] == 0 + ? @"" + : [NSString stringWithFormat:@".%@", messageChannelSuffix]; } return self; } -- (void)flutterMethodAString:(nullable NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod", _messageChannelSuffix]; +- (void)flutterMethodAString:(nullable NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:PGNGetMessagesCodec()]; - [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:PGNGetMessagesCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } @end - diff --git a/packages/pigeon/example/app/windows/runner/messages.g.cpp b/packages/pigeon/example/app/windows/runner/messages.g.cpp index 3288a6957188..7a43ec397a3a 100644 --- a/packages/pigeon/example/app/windows/runner/messages.g.cpp +++ b/packages/pigeon/example/app/windows/runner/messages.g.cpp @@ -25,29 +25,25 @@ using flutter::EncodableMap; using flutter::EncodableValue; FlutterError CreateConnectionError(const std::string channel_name) { - return FlutterError( - "channel-error", - "Unable to establish connection on channel: '" + channel_name + "'.", - EncodableValue("")); + return FlutterError( + "channel-error", + "Unable to establish connection on channel: '" + channel_name + "'.", + EncodableValue("")); } // MessageData -MessageData::MessageData( - const Code& code, - const EncodableMap& data) - : code_(code), - data_(data) {} - -MessageData::MessageData( - const std::string* name, - const std::string* description, - const Code& code, - const EncodableMap& data) - : name_(name ? std::optional(*name) : std::nullopt), - description_(description ? std::optional(*description) : std::nullopt), - code_(code), - data_(data) {} +MessageData::MessageData(const Code& code, const EncodableMap& data) + : code_(code), data_(data) {} + +MessageData::MessageData(const std::string* name, + const std::string* description, const Code& code, + const EncodableMap& data) + : name_(name ? std::optional(*name) : std::nullopt), + description_(description ? std::optional(*description) + : std::nullopt), + code_(code), + data_(data) {} const std::string* MessageData::name() const { return name_ ? &(*name_) : nullptr; @@ -57,47 +53,35 @@ void MessageData::set_name(const std::string_view* value_arg) { name_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void MessageData::set_name(std::string_view value_arg) { - name_ = value_arg; -} - +void MessageData::set_name(std::string_view value_arg) { name_ = value_arg; } const std::string* MessageData::description() const { return description_ ? &(*description_) : nullptr; } void MessageData::set_description(const std::string_view* value_arg) { - description_ = value_arg ? std::optional(*value_arg) : std::nullopt; + description_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } void MessageData::set_description(std::string_view value_arg) { description_ = value_arg; } +const Code& MessageData::code() const { return code_; } -const Code& MessageData::code() const { - return code_; -} - -void MessageData::set_code(const Code& value_arg) { - code_ = value_arg; -} - - -const EncodableMap& MessageData::data() const { - return data_; -} +void MessageData::set_code(const Code& value_arg) { code_ = value_arg; } -void MessageData::set_data(const EncodableMap& value_arg) { - data_ = value_arg; -} +const EncodableMap& MessageData::data() const { return data_; } +void MessageData::set_data(const EncodableMap& value_arg) { data_ = value_arg; } EncodableList MessageData::ToEncodableList() const { EncodableList list; list.reserve(4); list.push_back(name_ ? EncodableValue(*name_) : EncodableValue()); - list.push_back(description_ ? EncodableValue(*description_) : EncodableValue()); + list.push_back(description_ ? EncodableValue(*description_) + : EncodableValue()); list.push_back(CustomEncodableValue(code_)); list.push_back(EncodableValue(data_)); return list; @@ -105,8 +89,8 @@ EncodableList MessageData::ToEncodableList() const { MessageData MessageData::FromEncodableList(const EncodableList& list) { MessageData decoded( - std::any_cast(std::get(list[2])), - std::get(list[3])); + std::any_cast(std::get(list[2])), + std::get(list[3])); auto& encodable_name = list[0]; if (!encodable_name.IsNull()) { decoded.set_name(std::get(encodable_name)); @@ -118,38 +102,44 @@ MessageData MessageData::FromEncodableList(const EncodableList& list) { return decoded; } - PigeonCodecSerializer::PigeonCodecSerializer() {} EncodableValue PigeonCodecSerializer::ReadValueOfType( - uint8_t type, - flutter::ByteStreamReader* stream) const { + uint8_t type, flutter::ByteStreamReader* stream) const { switch (type) { case 129: - return CustomEncodableValue(MessageData::FromEncodableList(std::get(ReadValue(stream)))); - case 130: - { - const auto& encodable_enum_arg = ReadValue(stream); - const int64_t enum_arg_value = encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); - return encodable_enum_arg.IsNull() ? EncodableValue() : CustomEncodableValue(static_cast(enum_arg_value)); - } + return CustomEncodableValue(MessageData::FromEncodableList( + std::get(ReadValue(stream)))); + case 130: { + const auto& encodable_enum_arg = ReadValue(stream); + const int64_t enum_arg_value = + encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); + return encodable_enum_arg.IsNull() + ? EncodableValue() + : CustomEncodableValue(static_cast(enum_arg_value)); + } default: return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); - } + } } void PigeonCodecSerializer::WriteValue( - const EncodableValue& value, - flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = std::get_if(&value)) { + const EncodableValue& value, flutter::ByteStreamWriter* stream) const { + if (const CustomEncodableValue* custom_value = + std::get_if(&value)) { if (custom_value->type() == typeid(MessageData)) { stream->WriteByte(129); - WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); return; } if (custom_value->type() == typeid(Code)) { stream->WriteByte(130); - WriteValue(EncodableValue(static_cast(std::any_cast(*custom_value))), stream); + WriteValue( + EncodableValue(static_cast(std::any_cast(*custom_value))), + stream); return; } } @@ -158,101 +148,124 @@ void PigeonCodecSerializer::WriteValue( /// The codec used by ExampleHostApi. const flutter::StandardMessageCodec& ExampleHostApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance(&PigeonCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance( + &PigeonCodecSerializer::GetInstance()); } -// Sets up an instance of `ExampleHostApi` to handle messages through the `binary_messenger`. -void ExampleHostApi::SetUp( - flutter::BinaryMessenger* binary_messenger, - ExampleHostApi* api) { +// Sets up an instance of `ExampleHostApi` to handle messages through the +// `binary_messenger`. +void ExampleHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, + ExampleHostApi* api) { ExampleHostApi::SetUp(binary_messenger, api, ""); } -void ExampleHostApi::SetUp( - flutter::BinaryMessenger* binary_messenger, - ExampleHostApi* api, - const std::string& message_channel_suffix) { - const std::string prepended_suffix = message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix : ""; +void ExampleHostApi::SetUp(flutter::BinaryMessenger* binary_messenger, + ExampleHostApi* api, + const std::string& message_channel_suffix) { + const std::string prepended_suffix = + message_channel_suffix.length() > 0 + ? std::string(".") + message_channel_suffix + : ""; { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_example_package." + "ExampleHostApi.getHostLanguage" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - ErrorOr output = api->GetHostLanguage(); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + ErrorOr output = api->GetHostLanguage(); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_arg = args.at(0); - if (encodable_a_arg.IsNull()) { - reply(WrapError("a_arg unexpectedly null.")); - return; - } - const int64_t a_arg = encodable_a_arg.LongValue(); - const auto& encodable_b_arg = args.at(1); - if (encodable_b_arg.IsNull()) { - reply(WrapError("b_arg unexpectedly null.")); - return; - } - const int64_t b_arg = encodable_b_arg.LongValue(); - ErrorOr output = api->Add(a_arg, b_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_arg = args.at(0); + if (encodable_a_arg.IsNull()) { + reply(WrapError("a_arg unexpectedly null.")); + return; + } + const int64_t a_arg = encodable_a_arg.LongValue(); + const auto& encodable_b_arg = args.at(1); + if (encodable_b_arg.IsNull()) { + reply(WrapError("b_arg unexpectedly null.")); + return; + } + const int64_t b_arg = encodable_b_arg.LongValue(); + ErrorOr output = api->Add(a_arg, b_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_message_arg = args.at(0); - if (encodable_message_arg.IsNull()) { - reply(WrapError("message_arg unexpectedly null.")); - return; - } - const auto& message_arg = std::any_cast(std::get(encodable_message_arg)); - api->SendMessage(message_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_message_arg = args.at(0); + if (encodable_message_arg.IsNull()) { + reply(WrapError("message_arg unexpectedly null.")); + return; + } + const auto& message_arg = std::any_cast( + std::get(encodable_message_arg)); + api->SendMessage(message_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } @@ -260,60 +273,70 @@ void ExampleHostApi::SetUp( } EncodableValue ExampleHostApi::WrapError(std::string_view error_message) { - return EncodableValue(EncodableList{ - EncodableValue(std::string(error_message)), - EncodableValue("Error"), - EncodableValue() - }); + return EncodableValue( + EncodableList{EncodableValue(std::string(error_message)), + EncodableValue("Error"), EncodableValue()}); } EncodableValue ExampleHostApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{ - EncodableValue(error.code()), - EncodableValue(error.message()), - error.details() - }); + return EncodableValue(EncodableList{EncodableValue(error.code()), + EncodableValue(error.message()), + error.details()}); } -// Generated class from Pigeon that represents Flutter messages that can be called from C++. +// Generated class from Pigeon that represents Flutter messages that can be +// called from C++. MessageFlutterApi::MessageFlutterApi(flutter::BinaryMessenger* binary_messenger) - : binary_messenger_(binary_messenger), - message_channel_suffix_("") {} + : binary_messenger_(binary_messenger), message_channel_suffix_("") {} -MessageFlutterApi::MessageFlutterApi( - flutter::BinaryMessenger* binary_messenger, - const std::string& message_channel_suffix) - : binary_messenger_(binary_messenger), - message_channel_suffix_(message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix : "") {} +MessageFlutterApi::MessageFlutterApi(flutter::BinaryMessenger* binary_messenger, + const std::string& message_channel_suffix) + : binary_messenger_(binary_messenger), + message_channel_suffix_(message_channel_suffix.length() > 0 + ? std::string(".") + message_channel_suffix + : "") {} const flutter::StandardMessageCodec& MessageFlutterApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance(&PigeonCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance( + &PigeonCodecSerializer::GetInstance()); } void MessageFlutterApi::FlutterMethod( - const std::string* a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod" + message_channel_suffix_; + const std::string* a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi." + "flutterMethod" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto& return_value = std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } } // namespace pigeon_example diff --git a/packages/pigeon/example/app/windows/runner/messages.g.h b/packages/pigeon/example/app/windows/runner/messages.g.h index a829a3093bbd..3218b702d9b6 100644 --- a/packages/pigeon/example/app/windows/runner/messages.g.h +++ b/packages/pigeon/example/app/windows/runner/messages.g.h @@ -17,17 +17,16 @@ namespace pigeon_example { - // Generated class from Pigeon. class FlutterError { public: - explicit FlutterError(const std::string& code) - : code_(code) {} + explicit FlutterError(const std::string& code) : code_(code) {} explicit FlutterError(const std::string& code, const std::string& message) - : code_(code), message_(message) {} - explicit FlutterError(const std::string& code, const std::string& message, const flutter::EncodableValue& details) - : code_(code), message_(message), details_(details) {} + : code_(code), message_(message) {} + explicit FlutterError(const std::string& code, const std::string& message, + const flutter::EncodableValue& details) + : code_(code), message_(message), details_(details) {} const std::string& code() const { return code_; } const std::string& message() const { return message_; } @@ -39,7 +38,8 @@ class FlutterError { flutter::EncodableValue details_; }; -template class ErrorOr { +template +class ErrorOr { public: ErrorOr(const T& rhs) : v_(rhs) {} ErrorOr(const T&& rhs) : v_(std::move(rhs)) {} @@ -59,26 +59,17 @@ template class ErrorOr { std::variant v_; }; - -enum class Code { - kOne = 0, - kTwo = 1 -}; +enum class Code { kOne = 0, kTwo = 1 }; // Generated class from Pigeon that represents data sent in messages. class MessageData { public: // Constructs an object setting all non-nullable fields. - explicit MessageData( - const Code& code, - const flutter::EncodableMap& data); + explicit MessageData(const Code& code, const flutter::EncodableMap& data); // Constructs an object setting all fields. - explicit MessageData( - const std::string* name, - const std::string* description, - const Code& code, - const flutter::EncodableMap& data); + explicit MessageData(const std::string* name, const std::string* description, + const Code& code, const flutter::EncodableMap& data); const std::string* name() const; void set_name(const std::string_view* value_arg); @@ -94,7 +85,6 @@ class MessageData { const flutter::EncodableMap& data() const; void set_data(const flutter::EncodableMap& value_arg); - private: static MessageData FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -105,7 +95,6 @@ class MessageData { std::optional description_; Code code_; flutter::EncodableMap data_; - }; class PigeonCodecSerializer : public flutter::StandardCodecSerializer { @@ -116,60 +105,52 @@ class PigeonCodecSerializer : public flutter::StandardCodecSerializer { return sInstance; } - void WriteValue( - const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue(const flutter::EncodableValue& value, + flutter::ByteStreamWriter* stream) const override; protected: flutter::EncodableValue ReadValueOfType( - uint8_t type, - flutter::ByteStreamReader* stream) const override; - + uint8_t type, flutter::ByteStreamReader* stream) const override; }; -// Generated interface from Pigeon that represents a handler of messages from Flutter. +// Generated interface from Pigeon that represents a handler of messages from +// Flutter. class ExampleHostApi { public: ExampleHostApi(const ExampleHostApi&) = delete; ExampleHostApi& operator=(const ExampleHostApi&) = delete; virtual ~ExampleHostApi() {} virtual ErrorOr GetHostLanguage() = 0; - virtual ErrorOr Add( - int64_t a, - int64_t b) = 0; - virtual void SendMessage( - const MessageData& message, - std::function reply)> result) = 0; + virtual ErrorOr Add(int64_t a, int64_t b) = 0; + virtual void SendMessage(const MessageData& message, + std::function reply)> result) = 0; // The codec used by ExampleHostApi. static const flutter::StandardMessageCodec& GetCodec(); - // Sets up an instance of `ExampleHostApi` to handle messages through the `binary_messenger`. - static void SetUp( - flutter::BinaryMessenger* binary_messenger, - ExampleHostApi* api); - static void SetUp( - flutter::BinaryMessenger* binary_messenger, - ExampleHostApi* api, - const std::string& message_channel_suffix); + // Sets up an instance of `ExampleHostApi` to handle messages through the + // `binary_messenger`. + static void SetUp(flutter::BinaryMessenger* binary_messenger, + ExampleHostApi* api); + static void SetUp(flutter::BinaryMessenger* binary_messenger, + ExampleHostApi* api, + const std::string& message_channel_suffix); static flutter::EncodableValue WrapError(std::string_view error_message); static flutter::EncodableValue WrapError(const FlutterError& error); protected: ExampleHostApi() = default; - }; -// Generated class from Pigeon that represents Flutter messages that can be called from C++. +// Generated class from Pigeon that represents Flutter messages that can be +// called from C++. class MessageFlutterApi { public: MessageFlutterApi(flutter::BinaryMessenger* binary_messenger); - MessageFlutterApi( - flutter::BinaryMessenger* binary_messenger, - const std::string& message_channel_suffix); + MessageFlutterApi(flutter::BinaryMessenger* binary_messenger, + const std::string& message_channel_suffix); static const flutter::StandardMessageCodec& GetCodec(); - void FlutterMethod( - const std::string* a_string, - std::function&& on_success, - std::function&& on_error); + void FlutterMethod(const std::string* a_string, + std::function&& on_success, + std::function&& on_error); private: flutter::BinaryMessenger* binary_messenger_; diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java index 8e7663baab70..d7c5ea64ff1e 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; @@ -42,8 +41,7 @@ public static class FlutterError extends RuntimeException { /** The error details. Must be a datatype supported by the api codec. */ public final Object details; - public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) - { + public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) { super(message); this.code = code; this.details = details; @@ -62,14 +60,15 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { errorList.add(exception.toString()); errorList.add(exception.getClass().getSimpleName()); errorList.add( - "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); + "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); } return errorList; } @NonNull protected static FlutterError createConnectionError(@NonNull String channelName) { - return new FlutterError("channel-error", "Unable to establish connection on channel: " + channelName + ".", ""); + return new FlutterError( + "channel-error", "Unable to establish connection on channel: " + channelName + ".", ""); } @Target(METHOD) @@ -93,7 +92,7 @@ private AnEnum(final int index) { /** * A class containing all supported types. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class AllTypes { private @NonNull Boolean aBool; @@ -322,15 +321,49 @@ public void setMap(@NonNull Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } AllTypes that = (AllTypes) o; - return aBool.equals(that.aBool) && anInt.equals(that.anInt) && anInt64.equals(that.anInt64) && aDouble.equals(that.aDouble) && Arrays.equals(aByteArray, that.aByteArray) && Arrays.equals(a4ByteArray, that.a4ByteArray) && Arrays.equals(a8ByteArray, that.a8ByteArray) && Arrays.equals(aFloatArray, that.aFloatArray) && anEnum.equals(that.anEnum) && aString.equals(that.aString) && anObject.equals(that.anObject) && list.equals(that.list) && stringList.equals(that.stringList) && intList.equals(that.intList) && doubleList.equals(that.doubleList) && boolList.equals(that.boolList) && map.equals(that.map); + return aBool.equals(that.aBool) + && anInt.equals(that.anInt) + && anInt64.equals(that.anInt64) + && aDouble.equals(that.aDouble) + && Arrays.equals(aByteArray, that.aByteArray) + && Arrays.equals(a4ByteArray, that.a4ByteArray) + && Arrays.equals(a8ByteArray, that.a8ByteArray) + && Arrays.equals(aFloatArray, that.aFloatArray) + && anEnum.equals(that.anEnum) + && aString.equals(that.aString) + && anObject.equals(that.anObject) + && list.equals(that.list) + && stringList.equals(that.stringList) + && intList.equals(that.intList) + && doubleList.equals(that.doubleList) + && boolList.equals(that.boolList) + && map.equals(that.map); } @Override public int hashCode() { - int __pigeon_result = Objects.hash(aBool, anInt, anInt64, aDouble, anEnum, aString, anObject, list, stringList, intList, doubleList, boolList, map); + int __pigeon_result = + Objects.hash( + aBool, + anInt, + anInt64, + aDouble, + anEnum, + aString, + anObject, + list, + stringList, + intList, + doubleList, + boolList, + map); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(aByteArray); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(a4ByteArray); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(a8ByteArray); @@ -527,9 +560,13 @@ ArrayList toList() { Object aBool = __pigeon_list.get(0); pigeonResult.setABool((Boolean) aBool); Object anInt = __pigeon_list.get(1); - pigeonResult.setAnInt((anInt == null) ? null : ((anInt instanceof Integer) ? (Integer) anInt : (Long) anInt)); + pigeonResult.setAnInt( + (anInt == null) ? null : ((anInt instanceof Integer) ? (Integer) anInt : (Long) anInt)); Object anInt64 = __pigeon_list.get(2); - pigeonResult.setAnInt64((anInt64 == null) ? null : ((anInt64 instanceof Integer) ? (Integer) anInt64 : (Long) anInt64)); + pigeonResult.setAnInt64( + (anInt64 == null) + ? null + : ((anInt64 instanceof Integer) ? (Integer) anInt64 : (Long) anInt64)); Object aDouble = __pigeon_list.get(3); pigeonResult.setADouble((Double) aDouble); Object aByteArray = __pigeon_list.get(4); @@ -565,7 +602,7 @@ ArrayList toList() { /** * A class containing all supported nullable types. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class AllNullableTypes { private @Nullable Boolean aNullableBool; @@ -790,15 +827,59 @@ public void setMap(@Nullable Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } AllNullableTypes that = (AllNullableTypes) o; - return Objects.equals(aNullableBool, that.aNullableBool) && Objects.equals(aNullableInt, that.aNullableInt) && Objects.equals(aNullableInt64, that.aNullableInt64) && Objects.equals(aNullableDouble, that.aNullableDouble) && Arrays.equals(aNullableByteArray, that.aNullableByteArray) && Arrays.equals(aNullable4ByteArray, that.aNullable4ByteArray) && Arrays.equals(aNullable8ByteArray, that.aNullable8ByteArray) && Arrays.equals(aNullableFloatArray, that.aNullableFloatArray) && Objects.equals(nullableNestedList, that.nullableNestedList) && Objects.equals(nullableMapWithAnnotations, that.nullableMapWithAnnotations) && Objects.equals(nullableMapWithObject, that.nullableMapWithObject) && Objects.equals(aNullableEnum, that.aNullableEnum) && Objects.equals(aNullableString, that.aNullableString) && Objects.equals(aNullableObject, that.aNullableObject) && Objects.equals(allNullableTypes, that.allNullableTypes) && Objects.equals(list, that.list) && Objects.equals(stringList, that.stringList) && Objects.equals(intList, that.intList) && Objects.equals(doubleList, that.doubleList) && Objects.equals(boolList, that.boolList) && Objects.equals(nestedClassList, that.nestedClassList) && Objects.equals(map, that.map); + return Objects.equals(aNullableBool, that.aNullableBool) + && Objects.equals(aNullableInt, that.aNullableInt) + && Objects.equals(aNullableInt64, that.aNullableInt64) + && Objects.equals(aNullableDouble, that.aNullableDouble) + && Arrays.equals(aNullableByteArray, that.aNullableByteArray) + && Arrays.equals(aNullable4ByteArray, that.aNullable4ByteArray) + && Arrays.equals(aNullable8ByteArray, that.aNullable8ByteArray) + && Arrays.equals(aNullableFloatArray, that.aNullableFloatArray) + && Objects.equals(nullableNestedList, that.nullableNestedList) + && Objects.equals(nullableMapWithAnnotations, that.nullableMapWithAnnotations) + && Objects.equals(nullableMapWithObject, that.nullableMapWithObject) + && Objects.equals(aNullableEnum, that.aNullableEnum) + && Objects.equals(aNullableString, that.aNullableString) + && Objects.equals(aNullableObject, that.aNullableObject) + && Objects.equals(allNullableTypes, that.allNullableTypes) + && Objects.equals(list, that.list) + && Objects.equals(stringList, that.stringList) + && Objects.equals(intList, that.intList) + && Objects.equals(doubleList, that.doubleList) + && Objects.equals(boolList, that.boolList) + && Objects.equals(nestedClassList, that.nestedClassList) + && Objects.equals(map, that.map); } @Override public int hashCode() { - int __pigeon_result = Objects.hash(aNullableBool, aNullableInt, aNullableInt64, aNullableDouble, nullableNestedList, nullableMapWithAnnotations, nullableMapWithObject, aNullableEnum, aNullableString, aNullableObject, allNullableTypes, list, stringList, intList, doubleList, boolList, nestedClassList, map); + int __pigeon_result = + Objects.hash( + aNullableBool, + aNullableInt, + aNullableInt64, + aNullableDouble, + nullableNestedList, + nullableMapWithAnnotations, + nullableMapWithObject, + aNullableEnum, + aNullableString, + aNullableObject, + allNullableTypes, + list, + stringList, + intList, + doubleList, + boolList, + nestedClassList, + map); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(aNullableByteArray); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(aNullable4ByteArray); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(aNullable8ByteArray); @@ -883,7 +964,8 @@ public static final class Builder { private @Nullable Map nullableMapWithAnnotations; @CanIgnoreReturnValue - public @NonNull Builder setNullableMapWithAnnotations(@Nullable Map setterArg) { + public @NonNull Builder setNullableMapWithAnnotations( + @Nullable Map setterArg) { this.nullableMapWithAnnotations = setterArg; return this; } @@ -1045,9 +1127,17 @@ ArrayList toList() { Object aNullableBool = __pigeon_list.get(0); pigeonResult.setANullableBool((Boolean) aNullableBool); Object aNullableInt = __pigeon_list.get(1); - pigeonResult.setANullableInt((aNullableInt == null) ? null : ((aNullableInt instanceof Integer) ? (Integer) aNullableInt : (Long) aNullableInt)); + pigeonResult.setANullableInt( + (aNullableInt == null) + ? null + : ((aNullableInt instanceof Integer) ? (Integer) aNullableInt : (Long) aNullableInt)); Object aNullableInt64 = __pigeon_list.get(2); - pigeonResult.setANullableInt64((aNullableInt64 == null) ? null : ((aNullableInt64 instanceof Integer) ? (Integer) aNullableInt64 : (Long) aNullableInt64)); + pigeonResult.setANullableInt64( + (aNullableInt64 == null) + ? null + : ((aNullableInt64 instanceof Integer) + ? (Integer) aNullableInt64 + : (Long) aNullableInt64)); Object aNullableDouble = __pigeon_list.get(3); pigeonResult.setANullableDouble((Double) aNullableDouble); Object aNullableByteArray = __pigeon_list.get(4); @@ -1091,11 +1181,10 @@ ArrayList toList() { } /** - * The primary purpose for this class is to ensure coverage of Swift structs - * with nullable items, as the primary [AllNullableTypes] class is being used to - * test Swift classes. + * The primary purpose for this class is to ensure coverage of Swift structs with nullable items, + * as the primary [AllNullableTypes] class is being used to test Swift classes. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class AllNullableTypesWithoutRecursion { private @Nullable Boolean aNullableBool; @@ -1300,15 +1389,55 @@ public void setMap(@Nullable Map setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } AllNullableTypesWithoutRecursion that = (AllNullableTypesWithoutRecursion) o; - return Objects.equals(aNullableBool, that.aNullableBool) && Objects.equals(aNullableInt, that.aNullableInt) && Objects.equals(aNullableInt64, that.aNullableInt64) && Objects.equals(aNullableDouble, that.aNullableDouble) && Arrays.equals(aNullableByteArray, that.aNullableByteArray) && Arrays.equals(aNullable4ByteArray, that.aNullable4ByteArray) && Arrays.equals(aNullable8ByteArray, that.aNullable8ByteArray) && Arrays.equals(aNullableFloatArray, that.aNullableFloatArray) && Objects.equals(nullableNestedList, that.nullableNestedList) && Objects.equals(nullableMapWithAnnotations, that.nullableMapWithAnnotations) && Objects.equals(nullableMapWithObject, that.nullableMapWithObject) && Objects.equals(aNullableEnum, that.aNullableEnum) && Objects.equals(aNullableString, that.aNullableString) && Objects.equals(aNullableObject, that.aNullableObject) && Objects.equals(list, that.list) && Objects.equals(stringList, that.stringList) && Objects.equals(intList, that.intList) && Objects.equals(doubleList, that.doubleList) && Objects.equals(boolList, that.boolList) && Objects.equals(map, that.map); + return Objects.equals(aNullableBool, that.aNullableBool) + && Objects.equals(aNullableInt, that.aNullableInt) + && Objects.equals(aNullableInt64, that.aNullableInt64) + && Objects.equals(aNullableDouble, that.aNullableDouble) + && Arrays.equals(aNullableByteArray, that.aNullableByteArray) + && Arrays.equals(aNullable4ByteArray, that.aNullable4ByteArray) + && Arrays.equals(aNullable8ByteArray, that.aNullable8ByteArray) + && Arrays.equals(aNullableFloatArray, that.aNullableFloatArray) + && Objects.equals(nullableNestedList, that.nullableNestedList) + && Objects.equals(nullableMapWithAnnotations, that.nullableMapWithAnnotations) + && Objects.equals(nullableMapWithObject, that.nullableMapWithObject) + && Objects.equals(aNullableEnum, that.aNullableEnum) + && Objects.equals(aNullableString, that.aNullableString) + && Objects.equals(aNullableObject, that.aNullableObject) + && Objects.equals(list, that.list) + && Objects.equals(stringList, that.stringList) + && Objects.equals(intList, that.intList) + && Objects.equals(doubleList, that.doubleList) + && Objects.equals(boolList, that.boolList) + && Objects.equals(map, that.map); } @Override public int hashCode() { - int __pigeon_result = Objects.hash(aNullableBool, aNullableInt, aNullableInt64, aNullableDouble, nullableNestedList, nullableMapWithAnnotations, nullableMapWithObject, aNullableEnum, aNullableString, aNullableObject, list, stringList, intList, doubleList, boolList, map); + int __pigeon_result = + Objects.hash( + aNullableBool, + aNullableInt, + aNullableInt64, + aNullableDouble, + nullableNestedList, + nullableMapWithAnnotations, + nullableMapWithObject, + aNullableEnum, + aNullableString, + aNullableObject, + list, + stringList, + intList, + doubleList, + boolList, + map); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(aNullableByteArray); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(aNullable4ByteArray); __pigeon_result = 31 * __pigeon_result + Arrays.hashCode(aNullable8ByteArray); @@ -1393,7 +1522,8 @@ public static final class Builder { private @Nullable Map nullableMapWithAnnotations; @CanIgnoreReturnValue - public @NonNull Builder setNullableMapWithAnnotations(@Nullable Map setterArg) { + public @NonNull Builder setNullableMapWithAnnotations( + @Nullable Map setterArg) { this.nullableMapWithAnnotations = setterArg; return this; } @@ -1530,14 +1660,23 @@ ArrayList toList() { return toListResult; } - static @NonNull AllNullableTypesWithoutRecursion fromList(@NonNull ArrayList __pigeon_list) { + static @NonNull AllNullableTypesWithoutRecursion fromList( + @NonNull ArrayList __pigeon_list) { AllNullableTypesWithoutRecursion pigeonResult = new AllNullableTypesWithoutRecursion(); Object aNullableBool = __pigeon_list.get(0); pigeonResult.setANullableBool((Boolean) aNullableBool); Object aNullableInt = __pigeon_list.get(1); - pigeonResult.setANullableInt((aNullableInt == null) ? null : ((aNullableInt instanceof Integer) ? (Integer) aNullableInt : (Long) aNullableInt)); + pigeonResult.setANullableInt( + (aNullableInt == null) + ? null + : ((aNullableInt instanceof Integer) ? (Integer) aNullableInt : (Long) aNullableInt)); Object aNullableInt64 = __pigeon_list.get(2); - pigeonResult.setANullableInt64((aNullableInt64 == null) ? null : ((aNullableInt64 instanceof Integer) ? (Integer) aNullableInt64 : (Long) aNullableInt64)); + pigeonResult.setANullableInt64( + (aNullableInt64 == null) + ? null + : ((aNullableInt64 instanceof Integer) + ? (Integer) aNullableInt64 + : (Long) aNullableInt64)); Object aNullableDouble = __pigeon_list.get(3); pigeonResult.setANullableDouble((Double) aNullableDouble); Object aNullableByteArray = __pigeon_list.get(4); @@ -1579,11 +1718,11 @@ ArrayList toList() { /** * A class for testing nested class handling. * - * This is needed to test nested nullable and non-nullable classes, - * `AllNullableTypes` is non-nullable here as it is easier to instantiate - * than `AllTypes` when testing doesn't require both (ie. testing null classes). + *

This is needed to test nested nullable and non-nullable classes, `AllNullableTypes` is + * non-nullable here as it is easier to instantiate than `AllTypes` when testing doesn't require + * both (ie. testing null classes). * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class AllClassesWrapper { private @NonNull AllNullableTypes allNullableTypes; @@ -1605,7 +1744,8 @@ public void setAllNullableTypes(@NonNull AllNullableTypes setterArg) { return allNullableTypesWithoutRecursion; } - public void setAllNullableTypesWithoutRecursion(@Nullable AllNullableTypesWithoutRecursion setterArg) { + public void setAllNullableTypesWithoutRecursion( + @Nullable AllNullableTypesWithoutRecursion setterArg) { this.allNullableTypesWithoutRecursion = setterArg; } @@ -1624,10 +1764,16 @@ public void setAllTypes(@Nullable AllTypes setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } AllClassesWrapper that = (AllClassesWrapper) o; - return allNullableTypes.equals(that.allNullableTypes) && Objects.equals(allNullableTypesWithoutRecursion, that.allNullableTypesWithoutRecursion) && Objects.equals(allTypes, that.allTypes); + return allNullableTypes.equals(that.allNullableTypes) + && Objects.equals(allNullableTypesWithoutRecursion, that.allNullableTypesWithoutRecursion) + && Objects.equals(allTypes, that.allTypes); } @Override @@ -1648,7 +1794,8 @@ public static final class Builder { private @Nullable AllNullableTypesWithoutRecursion allNullableTypesWithoutRecursion; @CanIgnoreReturnValue - public @NonNull Builder setAllNullableTypesWithoutRecursion(@Nullable AllNullableTypesWithoutRecursion setterArg) { + public @NonNull Builder setAllNullableTypesWithoutRecursion( + @Nullable AllNullableTypesWithoutRecursion setterArg) { this.allNullableTypesWithoutRecursion = setterArg; return this; } @@ -1684,7 +1831,8 @@ ArrayList toList() { Object allNullableTypes = __pigeon_list.get(0); pigeonResult.setAllNullableTypes((AllNullableTypes) allNullableTypes); Object allNullableTypesWithoutRecursion = __pigeon_list.get(1); - pigeonResult.setAllNullableTypesWithoutRecursion((AllNullableTypesWithoutRecursion) allNullableTypesWithoutRecursion); + pigeonResult.setAllNullableTypesWithoutRecursion( + (AllNullableTypesWithoutRecursion) allNullableTypesWithoutRecursion); Object allTypes = __pigeon_list.get(2); pigeonResult.setAllTypes((AllTypes) allTypes); return pigeonResult; @@ -1694,7 +1842,7 @@ ArrayList toList() { /** * A data class containing a List, used in unit tests. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class TestMessage { private @Nullable List testList; @@ -1709,8 +1857,12 @@ public void setTestList(@Nullable List setterArg) { @Override public boolean equals(Object o) { - if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { return false; } + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } TestMessage that = (TestMessage) o; return Objects.equals(testList, that.testList); } @@ -1804,7 +1956,6 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } } - /** Asynchronous error handling return type for non-nullable API method returns. */ public interface Result { /** Success case callback method for handling returns. */ @@ -1830,127 +1981,131 @@ public interface VoidResult { void error(@NonNull Throwable error); } /** - * The core interface that each host language plugin must implement in - * platform_test integration tests. + * The core interface that each host language plugin must implement in platform_test integration + * tests. * - * Generated interface from Pigeon that represents a handler of messages from Flutter. + *

Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface HostIntegrationCoreApi { /** - * A no-op function taking no arguments and returning no value, to sanity - * test basic calling. + * A no-op function taking no arguments and returning no value, to sanity test basic calling. */ void noop(); /** Returns the passed object, to test serialization and deserialization. */ - @NonNull + @NonNull AllTypes echoAllTypes(@NonNull AllTypes everything); /** Returns an error, to test error handling. */ - @Nullable + @Nullable Object throwError(); /** Returns an error from a void function, to test error handling. */ void throwErrorFromVoid(); /** Returns a Flutter error, to test error handling. */ - @Nullable + @Nullable Object throwFlutterError(); /** Returns passed in int. */ - @NonNull + @NonNull Long echoInt(@NonNull Long anInt); /** Returns passed in double. */ - @NonNull + @NonNull Double echoDouble(@NonNull Double aDouble); /** Returns the passed in boolean. */ - @NonNull + @NonNull Boolean echoBool(@NonNull Boolean aBool); /** Returns the passed in string. */ - @NonNull + @NonNull String echoString(@NonNull String aString); /** Returns the passed in Uint8List. */ - @NonNull + @NonNull byte[] echoUint8List(@NonNull byte[] aUint8List); /** Returns the passed in generic Object. */ - @NonNull + @NonNull Object echoObject(@NonNull Object anObject); /** Returns the passed list, to test serialization and deserialization. */ - @NonNull + @NonNull List echoList(@NonNull List list); /** Returns the passed map, to test serialization and deserialization. */ - @NonNull + @NonNull Map echoMap(@NonNull Map aMap); /** Returns the passed map to test nested class serialization and deserialization. */ - @NonNull + @NonNull AllClassesWrapper echoClassWrapper(@NonNull AllClassesWrapper wrapper); /** Returns the passed enum to test serialization and deserialization. */ - @NonNull + @NonNull AnEnum echoEnum(@NonNull AnEnum anEnum); /** Returns the default string. */ - @NonNull + @NonNull String echoNamedDefaultString(@NonNull String aString); /** Returns passed in double. */ - @NonNull + @NonNull Double echoOptionalDefaultDouble(@NonNull Double aDouble); /** Returns passed in int. */ - @NonNull + @NonNull Long echoRequiredInt(@NonNull Long anInt); /** Returns the passed object, to test serialization and deserialization. */ - @Nullable + @Nullable AllNullableTypes echoAllNullableTypes(@Nullable AllNullableTypes everything); /** Returns the passed object, to test serialization and deserialization. */ - @Nullable - AllNullableTypesWithoutRecursion echoAllNullableTypesWithoutRecursion(@Nullable AllNullableTypesWithoutRecursion everything); + @Nullable + AllNullableTypesWithoutRecursion echoAllNullableTypesWithoutRecursion( + @Nullable AllNullableTypesWithoutRecursion everything); /** - * Returns the inner `aString` value from the wrapped object, to test - * sending of nested objects. + * Returns the inner `aString` value from the wrapped object, to test sending of nested objects. */ - @Nullable + @Nullable String extractNestedNullableString(@NonNull AllClassesWrapper wrapper); /** - * Returns the inner `aString` value from the wrapped object, to test - * sending of nested objects. + * Returns the inner `aString` value from the wrapped object, to test sending of nested objects. */ - @NonNull + @NonNull AllClassesWrapper createNestedNullableString(@Nullable String nullableString); /** Returns passed in arguments of multiple types. */ - @NonNull - AllNullableTypes sendMultipleNullableTypes(@Nullable Boolean aNullableBool, @Nullable Long aNullableInt, @Nullable String aNullableString); + @NonNull + AllNullableTypes sendMultipleNullableTypes( + @Nullable Boolean aNullableBool, + @Nullable Long aNullableInt, + @Nullable String aNullableString); /** Returns passed in arguments of multiple types. */ - @NonNull - AllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion(@Nullable Boolean aNullableBool, @Nullable Long aNullableInt, @Nullable String aNullableString); + @NonNull + AllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion( + @Nullable Boolean aNullableBool, + @Nullable Long aNullableInt, + @Nullable String aNullableString); /** Returns passed in int. */ - @Nullable + @Nullable Long echoNullableInt(@Nullable Long aNullableInt); /** Returns passed in double. */ - @Nullable + @Nullable Double echoNullableDouble(@Nullable Double aNullableDouble); /** Returns the passed in boolean. */ - @Nullable + @Nullable Boolean echoNullableBool(@Nullable Boolean aNullableBool); /** Returns the passed in string. */ - @Nullable + @Nullable String echoNullableString(@Nullable String aNullableString); /** Returns the passed in Uint8List. */ - @Nullable + @Nullable byte[] echoNullableUint8List(@Nullable byte[] aNullableUint8List); /** Returns the passed in generic Object. */ - @Nullable + @Nullable Object echoNullableObject(@Nullable Object aNullableObject); /** Returns the passed list, to test serialization and deserialization. */ - @Nullable + @Nullable List echoNullableList(@Nullable List aNullableList); /** Returns the passed map, to test serialization and deserialization. */ - @Nullable + @Nullable Map echoNullableMap(@Nullable Map aNullableMap); - @Nullable + @Nullable AnEnum echoNullableEnum(@Nullable AnEnum anEnum); /** Returns passed in int. */ - @Nullable + @Nullable Long echoOptionalNullableInt(@Nullable Long aNullableInt); /** Returns the passed in string. */ - @Nullable + @Nullable String echoNamedNullableString(@Nullable String aNullableString); /** - * A no-op function taking no arguments and returning no value, to sanity - * test basic asynchronous calling. + * A no-op function taking no arguments and returning no value, to sanity test basic + * asynchronous calling. */ void noopAsync(@NonNull VoidResult result); /** Returns passed in int asynchronously. */ @@ -1968,7 +2123,8 @@ public interface HostIntegrationCoreApi { /** Returns the passed list, to test asynchronous serialization and deserialization. */ void echoAsyncList(@NonNull List list, @NonNull Result> result); /** Returns the passed map, to test asynchronous serialization and deserialization. */ - void echoAsyncMap(@NonNull Map aMap, @NonNull Result> result); + void echoAsyncMap( + @NonNull Map aMap, @NonNull Result> result); /** Returns the passed enum, to test asynchronous serialization and deserialization. */ void echoAsyncEnum(@NonNull AnEnum anEnum, @NonNull Result result); /** Responds with an error from an async function returning a value. */ @@ -1980,9 +2136,12 @@ public interface HostIntegrationCoreApi { /** Returns the passed object, to test async serialization and deserialization. */ void echoAsyncAllTypes(@NonNull AllTypes everything, @NonNull Result result); /** Returns the passed object, to test serialization and deserialization. */ - void echoAsyncNullableAllNullableTypes(@Nullable AllNullableTypes everything, @NonNull NullableResult result); + void echoAsyncNullableAllNullableTypes( + @Nullable AllNullableTypes everything, @NonNull NullableResult result); /** Returns the passed object, to test serialization and deserialization. */ - void echoAsyncNullableAllNullableTypesWithoutRecursion(@Nullable AllNullableTypesWithoutRecursion everything, @NonNull NullableResult result); + void echoAsyncNullableAllNullableTypesWithoutRecursion( + @Nullable AllNullableTypesWithoutRecursion everything, + @NonNull NullableResult result); /** Returns passed in int asynchronously. */ void echoAsyncNullableInt(@Nullable Long anInt, @NonNull NullableResult result); /** Returns passed in double asynchronously. */ @@ -1992,13 +2151,16 @@ public interface HostIntegrationCoreApi { /** Returns the passed string asynchronously. */ void echoAsyncNullableString(@Nullable String aString, @NonNull NullableResult result); /** Returns the passed in Uint8List asynchronously. */ - void echoAsyncNullableUint8List(@Nullable byte[] aUint8List, @NonNull NullableResult result); + void echoAsyncNullableUint8List( + @Nullable byte[] aUint8List, @NonNull NullableResult result); /** Returns the passed in generic Object asynchronously. */ void echoAsyncNullableObject(@Nullable Object anObject, @NonNull NullableResult result); /** Returns the passed list, to test asynchronous serialization and deserialization. */ - void echoAsyncNullableList(@Nullable List list, @NonNull NullableResult> result); + void echoAsyncNullableList( + @Nullable List list, @NonNull NullableResult> result); /** Returns the passed map, to test asynchronous serialization and deserialization. */ - void echoAsyncNullableMap(@Nullable Map aMap, @NonNull NullableResult> result); + void echoAsyncNullableMap( + @Nullable Map aMap, @NonNull NullableResult> result); /** Returns the passed enum, to test asynchronous serialization and deserialization. */ void echoAsyncNullableEnum(@Nullable AnEnum anEnum, @NonNull NullableResult result); @@ -2010,13 +2172,24 @@ public interface HostIntegrationCoreApi { void callFlutterEchoAllTypes(@NonNull AllTypes everything, @NonNull Result result); - void callFlutterEchoAllNullableTypes(@Nullable AllNullableTypes everything, @NonNull NullableResult result); + void callFlutterEchoAllNullableTypes( + @Nullable AllNullableTypes everything, @NonNull NullableResult result); - void callFlutterSendMultipleNullableTypes(@Nullable Boolean aNullableBool, @Nullable Long aNullableInt, @Nullable String aNullableString, @NonNull Result result); + void callFlutterSendMultipleNullableTypes( + @Nullable Boolean aNullableBool, + @Nullable Long aNullableInt, + @Nullable String aNullableString, + @NonNull Result result); - void callFlutterEchoAllNullableTypesWithoutRecursion(@Nullable AllNullableTypesWithoutRecursion everything, @NonNull NullableResult result); + void callFlutterEchoAllNullableTypesWithoutRecursion( + @Nullable AllNullableTypesWithoutRecursion everything, + @NonNull NullableResult result); - void callFlutterSendMultipleNullableTypesWithoutRecursion(@Nullable Boolean aNullableBool, @Nullable Long aNullableInt, @Nullable String aNullableString, @NonNull Result result); + void callFlutterSendMultipleNullableTypesWithoutRecursion( + @Nullable Boolean aNullableBool, + @Nullable Long aNullableInt, + @Nullable String aNullableString, + @NonNull Result result); void callFlutterEchoBool(@NonNull Boolean aBool, @NonNull Result result); @@ -2030,25 +2203,33 @@ public interface HostIntegrationCoreApi { void callFlutterEchoList(@NonNull List list, @NonNull Result> result); - void callFlutterEchoMap(@NonNull Map aMap, @NonNull Result> result); + void callFlutterEchoMap( + @NonNull Map aMap, @NonNull Result> result); void callFlutterEchoEnum(@NonNull AnEnum anEnum, @NonNull Result result); - void callFlutterEchoNullableBool(@Nullable Boolean aBool, @NonNull NullableResult result); + void callFlutterEchoNullableBool( + @Nullable Boolean aBool, @NonNull NullableResult result); void callFlutterEchoNullableInt(@Nullable Long anInt, @NonNull NullableResult result); - void callFlutterEchoNullableDouble(@Nullable Double aDouble, @NonNull NullableResult result); + void callFlutterEchoNullableDouble( + @Nullable Double aDouble, @NonNull NullableResult result); - void callFlutterEchoNullableString(@Nullable String aString, @NonNull NullableResult result); + void callFlutterEchoNullableString( + @Nullable String aString, @NonNull NullableResult result); - void callFlutterEchoNullableUint8List(@Nullable byte[] list, @NonNull NullableResult result); + void callFlutterEchoNullableUint8List( + @Nullable byte[] list, @NonNull NullableResult result); - void callFlutterEchoNullableList(@Nullable List list, @NonNull NullableResult> result); + void callFlutterEchoNullableList( + @Nullable List list, @NonNull NullableResult> result); - void callFlutterEchoNullableMap(@Nullable Map aMap, @NonNull NullableResult> result); + void callFlutterEchoNullableMap( + @Nullable Map aMap, @NonNull NullableResult> result); - void callFlutterEchoNullableEnum(@Nullable AnEnum anEnum, @NonNull NullableResult result); + void callFlutterEchoNullableEnum( + @Nullable AnEnum anEnum, @NonNull NullableResult result); void callFlutterSmallApiEchoString(@NonNull String aString, @NonNull Result result); @@ -2056,16 +2237,27 @@ public interface HostIntegrationCoreApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - /**Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binaryMessenger`. */ - static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable HostIntegrationCoreApi api) { + /** + * Sets up an instance of `HostIntegrationCoreApi` to handle messages through the + * `binaryMessenger`. + */ + static void setUp( + @NonNull BinaryMessenger binaryMessenger, @Nullable HostIntegrationCoreApi api) { setUp(binaryMessenger, "", api); } - static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String messageChannelSuffix, @Nullable HostIntegrationCoreApi api) { + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable HostIntegrationCoreApi api) { messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2073,8 +2265,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { api.noop(); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2087,7 +2278,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2097,8 +2291,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { AllTypes output = api.echoAllTypes(everythingArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2111,7 +2304,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2119,8 +2315,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Object output = api.throwError(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2133,7 +2328,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2141,8 +2339,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { api.throwErrorFromVoid(); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2155,7 +2352,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2163,8 +2363,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Object output = api.throwFlutterError(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2177,7 +2376,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2187,8 +2389,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Long output = api.echoInt((anIntArg == null) ? null : anIntArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2201,7 +2402,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2211,8 +2415,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Double output = api.echoDouble(aDoubleArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2225,7 +2428,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2235,8 +2441,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Boolean output = api.echoBool(aBoolArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2249,7 +2454,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2259,8 +2467,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { String output = api.echoString(aStringArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2273,7 +2480,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2283,8 +2493,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { byte[] output = api.echoUint8List(aUint8ListArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2297,7 +2506,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2307,8 +2519,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Object output = api.echoObject(anObjectArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2321,7 +2532,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2331,8 +2545,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { List output = api.echoList(listArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2345,7 +2558,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2355,8 +2571,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Map output = api.echoMap(aMapArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2369,7 +2584,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2379,8 +2597,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { AllClassesWrapper output = api.echoClassWrapper(wrapperArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2393,7 +2610,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2403,8 +2623,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { AnEnum output = api.echoEnum(anEnumArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2417,7 +2636,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2427,8 +2649,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { String output = api.echoNamedDefaultString(aStringArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2441,7 +2662,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2451,8 +2675,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Double output = api.echoOptionalDefaultDouble(aDoubleArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2465,7 +2688,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2473,10 +2699,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess ArrayList args = (ArrayList) message; Number anIntArg = (Number) args.get(0); try { - Long output = api.echoRequiredInt((anIntArg == null) ? null : anIntArg.longValue()); + Long output = + api.echoRequiredInt((anIntArg == null) ? null : anIntArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2489,7 +2715,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2499,8 +2728,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { AllNullableTypes output = api.echoAllNullableTypes(everythingArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2513,18 +2741,22 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; - AllNullableTypesWithoutRecursion everythingArg = (AllNullableTypesWithoutRecursion) args.get(0); + AllNullableTypesWithoutRecursion everythingArg = + (AllNullableTypesWithoutRecursion) args.get(0); try { - AllNullableTypesWithoutRecursion output = api.echoAllNullableTypesWithoutRecursion(everythingArg); + AllNullableTypesWithoutRecursion output = + api.echoAllNullableTypesWithoutRecursion(everythingArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2537,7 +2769,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2547,8 +2782,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { String output = api.extractNestedNullableString(wrapperArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2561,7 +2795,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2571,8 +2808,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { AllClassesWrapper output = api.createNestedNullableString(nullableStringArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2585,7 +2821,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2595,10 +2834,13 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess Number aNullableIntArg = (Number) args.get(1); String aNullableStringArg = (String) args.get(2); try { - AllNullableTypes output = api.sendMultipleNullableTypes(aNullableBoolArg, (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), aNullableStringArg); + AllNullableTypes output = + api.sendMultipleNullableTypes( + aNullableBoolArg, + (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), + aNullableStringArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2611,7 +2853,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2621,10 +2866,13 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess Number aNullableIntArg = (Number) args.get(1); String aNullableStringArg = (String) args.get(2); try { - AllNullableTypesWithoutRecursion output = api.sendMultipleNullableTypesWithoutRecursion(aNullableBoolArg, (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), aNullableStringArg); + AllNullableTypesWithoutRecursion output = + api.sendMultipleNullableTypesWithoutRecursion( + aNullableBoolArg, + (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), + aNullableStringArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2637,7 +2885,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2645,10 +2896,11 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess ArrayList args = (ArrayList) message; Number aNullableIntArg = (Number) args.get(0); try { - Long output = api.echoNullableInt((aNullableIntArg == null) ? null : aNullableIntArg.longValue()); + Long output = + api.echoNullableInt( + (aNullableIntArg == null) ? null : aNullableIntArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2661,7 +2913,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2671,8 +2926,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Double output = api.echoNullableDouble(aNullableDoubleArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2685,7 +2939,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2695,8 +2952,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Boolean output = api.echoNullableBool(aNullableBoolArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2709,7 +2965,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2719,8 +2978,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { String output = api.echoNullableString(aNullableStringArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2733,7 +2991,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2743,8 +3004,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { byte[] output = api.echoNullableUint8List(aNullableUint8ListArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2757,7 +3017,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2767,8 +3030,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Object output = api.echoNullableObject(aNullableObjectArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2781,7 +3043,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2791,8 +3056,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { List output = api.echoNullableList(aNullableListArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2805,7 +3069,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2815,8 +3082,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { Map output = api.echoNullableMap(aNullableMapArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2829,7 +3095,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2839,8 +3108,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { AnEnum output = api.echoNullableEnum(anEnumArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2853,7 +3121,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2861,10 +3132,11 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess ArrayList args = (ArrayList) message; Number aNullableIntArg = (Number) args.get(0); try { - Long output = api.echoOptionalNullableInt((aNullableIntArg == null) ? null : aNullableIntArg.longValue()); + Long output = + api.echoOptionalNullableInt( + (aNullableIntArg == null) ? null : aNullableIntArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2877,7 +3149,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2887,8 +3162,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { String output = api.echoNamedNullableString(aNullableStringArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2901,7 +3175,10 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2928,7 +3205,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2957,7 +3237,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2986,7 +3269,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3015,7 +3301,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3044,7 +3333,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3073,7 +3365,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3102,7 +3397,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3131,7 +3429,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3160,7 +3461,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3189,7 +3493,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3216,7 +3523,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3243,7 +3553,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3270,7 +3583,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3299,7 +3615,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3328,13 +3647,17 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; - AllNullableTypesWithoutRecursion everythingArg = (AllNullableTypesWithoutRecursion) args.get(0); + AllNullableTypesWithoutRecursion everythingArg = + (AllNullableTypesWithoutRecursion) args.get(0); NullableResult resultCallback = new NullableResult() { public void success(AllNullableTypesWithoutRecursion result) { @@ -3348,7 +3671,8 @@ public void error(Throwable error) { } }; - api.echoAsyncNullableAllNullableTypesWithoutRecursion(everythingArg, resultCallback); + api.echoAsyncNullableAllNullableTypesWithoutRecursion( + everythingArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -3357,7 +3681,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3377,7 +3704,8 @@ public void error(Throwable error) { } }; - api.echoAsyncNullableInt((anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.echoAsyncNullableInt( + (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -3386,7 +3714,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3415,7 +3746,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3444,7 +3778,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3473,7 +3810,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3502,7 +3842,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3531,7 +3874,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3560,7 +3906,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3589,7 +3938,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3618,7 +3970,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3645,7 +4000,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3672,7 +4030,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3699,7 +4060,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3728,7 +4092,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3757,7 +4124,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3779,7 +4149,11 @@ public void error(Throwable error) { } }; - api.callFlutterSendMultipleNullableTypes(aNullableBoolArg, (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), aNullableStringArg, resultCallback); + api.callFlutterSendMultipleNullableTypes( + aNullableBoolArg, + (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), + aNullableStringArg, + resultCallback); }); } else { channel.setMessageHandler(null); @@ -3788,13 +4162,17 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; - AllNullableTypesWithoutRecursion everythingArg = (AllNullableTypesWithoutRecursion) args.get(0); + AllNullableTypesWithoutRecursion everythingArg = + (AllNullableTypesWithoutRecursion) args.get(0); NullableResult resultCallback = new NullableResult() { public void success(AllNullableTypesWithoutRecursion result) { @@ -3817,7 +4195,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3839,7 +4220,11 @@ public void error(Throwable error) { } }; - api.callFlutterSendMultipleNullableTypesWithoutRecursion(aNullableBoolArg, (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), aNullableStringArg, resultCallback); + api.callFlutterSendMultipleNullableTypesWithoutRecursion( + aNullableBoolArg, + (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), + aNullableStringArg, + resultCallback); }); } else { channel.setMessageHandler(null); @@ -3848,7 +4233,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3877,7 +4265,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3897,7 +4288,8 @@ public void error(Throwable error) { } }; - api.callFlutterEchoInt((anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.callFlutterEchoInt( + (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -3906,7 +4298,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3935,7 +4330,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3964,7 +4362,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3993,7 +4394,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4022,7 +4426,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4051,7 +4458,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4080,7 +4490,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4109,7 +4522,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4129,7 +4545,8 @@ public void error(Throwable error) { } }; - api.callFlutterEchoNullableInt((anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.callFlutterEchoNullableInt( + (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -4138,7 +4555,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4167,7 +4587,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4196,7 +4619,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4225,7 +4651,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4254,7 +4683,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4283,7 +4715,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4312,7 +4747,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4341,10 +4779,10 @@ public void error(Throwable error) { } } /** - * The core interface that the Dart platform_test code implements for host - * integration tests to call into. + * The core interface that the Dart platform_test code implements for host integration tests to + * call into. * - * Generated class from Pigeon that represents Flutter messages that can be called from Java. + *

Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class FlutterIntegrationCoreApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -4353,651 +4791,857 @@ public static class FlutterIntegrationCoreApi { public FlutterIntegrationCoreApi(@NonNull BinaryMessenger argBinaryMessenger) { this(argBinaryMessenger, ""); } - public FlutterIntegrationCoreApi(@NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { + + public FlutterIntegrationCoreApi( + @NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { this.binaryMessenger = argBinaryMessenger; this.messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ /** The codec used by FlutterIntegrationCoreApi. */ static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } /** - * A no-op function taking no arguments and returning no value, to sanity - * test basic calling. + * A no-op function taking no arguments and returning no value, to sanity test basic calling. */ public void noop(@NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( null, channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Responds with an error from an async function returning a value. */ public void throwError(@NonNull NullableResult result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( null, channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") Object output = listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Responds with an error from an async void function. */ public void throwErrorFromVoid(@NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( null, channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed object, to test serialization and deserialization. */ public void echoAllTypes(@NonNull AllTypes everythingArg, @NonNull Result result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(everythingArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") AllTypes output = (AllTypes) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed object, to test serialization and deserialization. */ - public void echoAllNullableTypes(@Nullable AllNullableTypes everythingArg, @NonNull NullableResult result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes" + messageChannelSuffix; + public void echoAllNullableTypes( + @Nullable AllNullableTypes everythingArg, + @NonNull NullableResult result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(everythingArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") AllNullableTypes output = (AllNullableTypes) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** * Returns passed in arguments of multiple types. * - * Tests multiple-arity FlutterApi handling. + *

Tests multiple-arity FlutterApi handling. */ - public void sendMultipleNullableTypes(@Nullable Boolean aNullableBoolArg, @Nullable Long aNullableIntArg, @Nullable String aNullableStringArg, @NonNull Result result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes" + messageChannelSuffix; + public void sendMultipleNullableTypes( + @Nullable Boolean aNullableBoolArg, + @Nullable Long aNullableIntArg, + @Nullable String aNullableStringArg, + @NonNull Result result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Arrays.asList(aNullableBoolArg, aNullableIntArg, aNullableStringArg)), + new ArrayList( + Arrays.asList(aNullableBoolArg, aNullableIntArg, aNullableStringArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") AllNullableTypes output = (AllNullableTypes) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed object, to test serialization and deserialization. */ - public void echoAllNullableTypesWithoutRecursion(@Nullable AllNullableTypesWithoutRecursion everythingArg, @NonNull NullableResult result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + messageChannelSuffix; + public void echoAllNullableTypesWithoutRecursion( + @Nullable AllNullableTypesWithoutRecursion everythingArg, + @NonNull NullableResult result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(everythingArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") - AllNullableTypesWithoutRecursion output = (AllNullableTypesWithoutRecursion) listReply.get(0); + AllNullableTypesWithoutRecursion output = + (AllNullableTypesWithoutRecursion) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** * Returns passed in arguments of multiple types. * - * Tests multiple-arity FlutterApi handling. + *

Tests multiple-arity FlutterApi handling. */ - public void sendMultipleNullableTypesWithoutRecursion(@Nullable Boolean aNullableBoolArg, @Nullable Long aNullableIntArg, @Nullable String aNullableStringArg, @NonNull Result result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + messageChannelSuffix; + public void sendMultipleNullableTypesWithoutRecursion( + @Nullable Boolean aNullableBoolArg, + @Nullable Long aNullableIntArg, + @Nullable String aNullableStringArg, + @NonNull Result result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList(Arrays.asList(aNullableBoolArg, aNullableIntArg, aNullableStringArg)), + new ArrayList( + Arrays.asList(aNullableBoolArg, aNullableIntArg, aNullableStringArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") - AllNullableTypesWithoutRecursion output = (AllNullableTypesWithoutRecursion) listReply.get(0); + AllNullableTypesWithoutRecursion output = + (AllNullableTypesWithoutRecursion) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed boolean, to test serialization and deserialization. */ public void echoBool(@NonNull Boolean aBoolArg, @NonNull Result result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aBoolArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") Boolean output = (Boolean) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed int, to test serialization and deserialization. */ public void echoInt(@NonNull Long anIntArg, @NonNull Result result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(anIntArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") - Long output = listReply.get(0) == null ? null : ((Number) listReply.get(0)).longValue(); + Long output = + listReply.get(0) == null ? null : ((Number) listReply.get(0)).longValue(); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed double, to test serialization and deserialization. */ public void echoDouble(@NonNull Double aDoubleArg, @NonNull Result result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aDoubleArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") Double output = (Double) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed string, to test serialization and deserialization. */ public void echoString(@NonNull String aStringArg, @NonNull Result result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aStringArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") String output = (String) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed byte list, to test serialization and deserialization. */ public void echoUint8List(@NonNull byte[] listArg, @NonNull Result result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(listArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") byte[] output = (byte[]) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed list, to test serialization and deserialization. */ public void echoList(@NonNull List listArg, @NonNull Result> result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(listArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") List output = (List) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed map, to test serialization and deserialization. */ - public void echoMap(@NonNull Map aMapArg, @NonNull Result> result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap" + messageChannelSuffix; + public void echoMap( + @NonNull Map aMapArg, @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aMapArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") Map output = (Map) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed enum to test serialization and deserialization. */ public void echoEnum(@NonNull AnEnum anEnumArg, @NonNull Result result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(anEnumArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") AnEnum output = (AnEnum) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed boolean, to test serialization and deserialization. */ - public void echoNullableBool(@Nullable Boolean aBoolArg, @NonNull NullableResult result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool" + messageChannelSuffix; + public void echoNullableBool( + @Nullable Boolean aBoolArg, @NonNull NullableResult result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aBoolArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") Boolean output = (Boolean) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed int, to test serialization and deserialization. */ public void echoNullableInt(@Nullable Long anIntArg, @NonNull NullableResult result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(anIntArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") - Long output = listReply.get(0) == null ? null : ((Number) listReply.get(0)).longValue(); + Long output = + listReply.get(0) == null ? null : ((Number) listReply.get(0)).longValue(); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed double, to test serialization and deserialization. */ - public void echoNullableDouble(@Nullable Double aDoubleArg, @NonNull NullableResult result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble" + messageChannelSuffix; + public void echoNullableDouble( + @Nullable Double aDoubleArg, @NonNull NullableResult result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aDoubleArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") Double output = (Double) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed string, to test serialization and deserialization. */ - public void echoNullableString(@Nullable String aStringArg, @NonNull NullableResult result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString" + messageChannelSuffix; + public void echoNullableString( + @Nullable String aStringArg, @NonNull NullableResult result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aStringArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") String output = (String) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed byte list, to test serialization and deserialization. */ - public void echoNullableUint8List(@Nullable byte[] listArg, @NonNull NullableResult result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List" + messageChannelSuffix; + public void echoNullableUint8List( + @Nullable byte[] listArg, @NonNull NullableResult result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(listArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") byte[] output = (byte[]) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed list, to test serialization and deserialization. */ - public void echoNullableList(@Nullable List listArg, @NonNull NullableResult> result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList" + messageChannelSuffix; + public void echoNullableList( + @Nullable List listArg, @NonNull NullableResult> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(listArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") List output = (List) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed map, to test serialization and deserialization. */ - public void echoNullableMap(@Nullable Map aMapArg, @NonNull NullableResult> result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap" + messageChannelSuffix; + public void echoNullableMap( + @Nullable Map aMapArg, + @NonNull NullableResult> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aMapArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") Map output = (Map) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed enum to test serialization and deserialization. */ - public void echoNullableEnum(@Nullable AnEnum anEnumArg, @NonNull NullableResult result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum" + messageChannelSuffix; + public void echoNullableEnum( + @Nullable AnEnum anEnumArg, @NonNull NullableResult result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(anEnumArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") AnEnum output = (AnEnum) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** - * A no-op function taking no arguments and returning no value, to sanity - * test basic asynchronous calling. + * A no-op function taking no arguments and returning no value, to sanity test basic + * asynchronous calling. */ public void noopAsync(@NonNull VoidResult result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( null, channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else { result.success(); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } /** Returns the passed in generic Object asynchronously. */ public void echoAsyncString(@NonNull String aStringArg, @NonNull Result result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aStringArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") String output = (String) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } } /** * An API that can be implemented for minimal, compile-only tests. * - * Generated interface from Pigeon that represents a handler of messages from Flutter. + *

Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface HostTrivialApi { @@ -5007,16 +5651,23 @@ public interface HostTrivialApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - /**Sets up an instance of `HostTrivialApi` to handle messages through the `binaryMessenger`. */ + /** Sets up an instance of `HostTrivialApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable HostTrivialApi api) { setUp(binaryMessenger, "", api); } - static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String messageChannelSuffix, @Nullable HostTrivialApi api) { + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable HostTrivialApi api) { messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -5024,8 +5675,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess try { api.noop(); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -5040,7 +5690,7 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess /** * A simple API implemented in some unit tests. * - * Generated interface from Pigeon that represents a handler of messages from Flutter. + *

Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface HostSmallApi { @@ -5052,16 +5702,23 @@ public interface HostSmallApi { static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } - /**Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. */ + /** Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. */ static void setUp(@NonNull BinaryMessenger binaryMessenger, @Nullable HostSmallApi api) { setUp(binaryMessenger, "", api); } - static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String messageChannelSuffix, @Nullable HostSmallApi api) { + + static void setUp( + @NonNull BinaryMessenger binaryMessenger, + @NonNull String messageChannelSuffix, + @Nullable HostSmallApi api) { messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -5090,7 +5747,10 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid" + messageChannelSuffix, getCodec()); + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid" + + messageChannelSuffix, + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -5119,7 +5779,7 @@ public void error(Throwable error) { /** * A simple API called in some unit tests. * - * Generated class from Pigeon that represents Flutter messages that can be called from Java. + *

Generated class from Pigeon that represents Flutter messages that can be called from Java. */ public static class FlutterSmallApi { private final @NonNull BinaryMessenger binaryMessenger; @@ -5128,62 +5788,84 @@ public static class FlutterSmallApi { public FlutterSmallApi(@NonNull BinaryMessenger argBinaryMessenger) { this(argBinaryMessenger, ""); } - public FlutterSmallApi(@NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { + + public FlutterSmallApi( + @NonNull BinaryMessenger argBinaryMessenger, @NonNull String messageChannelSuffix) { this.binaryMessenger = argBinaryMessenger; this.messageChannelSuffix = messageChannelSuffix.isEmpty() ? "" : "." + messageChannelSuffix; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ /** The codec used by FlutterSmallApi. */ static @NonNull MessageCodec getCodec() { return PigeonCodec.INSTANCE; } + public void echoWrappedList(@NonNull TestMessage msgArg, @NonNull Result result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(msgArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") TestMessage output = (TestMessage) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } + public void echoString(@NonNull String aStringArg, @NonNull Result result) { - final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString" + messageChannelSuffix; + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString" + + messageChannelSuffix; BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, channelName, getCodec()); + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( new ArrayList(Collections.singletonList(aStringArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; if (listReply.size() > 1) { - result.error(new FlutterError((String) listReply.get(0), (String) listReply.get(1), (String) listReply.get(2))); + result.error( + new FlutterError( + (String) listReply.get(0), + (String) listReply.get(1), + (String) listReply.get(2))); } else if (listReply.get(0) == null) { - result.error(new FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")); + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); } else { @SuppressWarnings("ConstantConditions") String output = (String) listReply.get(0); result.success(output); } - } else { + } else { result.error(createConnectionError(channelName)); - } + } }); } } diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h index ba7cb9bc5faa..2bf7bbf26bee 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h @@ -38,88 +38,90 @@ typedef NS_ENUM(NSUInteger, FLTAnEnum) { @interface FLTAllTypes : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithABool:(BOOL )aBool - anInt:(NSInteger )anInt - anInt64:(NSInteger )anInt64 - aDouble:(double )aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - anEnum:(FLTAnEnum)anEnum - aString:(NSString *)aString - anObject:(id )anObject - list:(NSArray *)list - stringList:(NSArray *)stringList - intList:(NSArray *)intList - doubleList:(NSArray *)doubleList - boolList:(NSArray *)boolList - map:(NSDictionary *)map; -@property(nonatomic, assign) BOOL aBool; -@property(nonatomic, assign) NSInteger anInt; -@property(nonatomic, assign) NSInteger anInt64; -@property(nonatomic, assign) double aDouble; -@property(nonatomic, strong) FlutterStandardTypedData * aByteArray; -@property(nonatomic, strong) FlutterStandardTypedData * a4ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData * a8ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData * aFloatArray; ++ (instancetype)makeWithABool:(BOOL)aBool + anInt:(NSInteger)anInt + anInt64:(NSInteger)anInt64 + aDouble:(double)aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + anEnum:(FLTAnEnum)anEnum + aString:(NSString *)aString + anObject:(id)anObject + list:(NSArray *)list + stringList:(NSArray *)stringList + intList:(NSArray *)intList + doubleList:(NSArray *)doubleList + boolList:(NSArray *)boolList + map:(NSDictionary *)map; +@property(nonatomic, assign) BOOL aBool; +@property(nonatomic, assign) NSInteger anInt; +@property(nonatomic, assign) NSInteger anInt64; +@property(nonatomic, assign) double aDouble; +@property(nonatomic, strong) FlutterStandardTypedData *aByteArray; +@property(nonatomic, strong) FlutterStandardTypedData *a4ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData *a8ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData *aFloatArray; @property(nonatomic, assign) FLTAnEnum anEnum; -@property(nonatomic, copy) NSString * aString; -@property(nonatomic, strong) id anObject; -@property(nonatomic, copy) NSArray * list; -@property(nonatomic, copy) NSArray * stringList; -@property(nonatomic, copy) NSArray * intList; -@property(nonatomic, copy) NSArray * doubleList; -@property(nonatomic, copy) NSArray * boolList; -@property(nonatomic, copy) NSDictionary * map; +@property(nonatomic, copy) NSString *aString; +@property(nonatomic, strong) id anObject; +@property(nonatomic, copy) NSArray *list; +@property(nonatomic, copy) NSArray *stringList; +@property(nonatomic, copy) NSArray *intList; +@property(nonatomic, copy) NSArray *doubleList; +@property(nonatomic, copy) NSArray *boolList; +@property(nonatomic, copy) NSDictionary *map; @end /// A class containing all supported nullable types. @interface FLTAllNullableTypes : NSObject + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id )aNullableObject - allNullableTypes:(nullable FLTAllNullableTypes *)allNullableTypes - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - nestedClassList:(nullable NSArray *)nestedClassList - map:(nullable NSDictionary *)map; -@property(nonatomic, strong, nullable) NSNumber * aNullableBool; -@property(nonatomic, strong, nullable) NSNumber * aNullableInt; -@property(nonatomic, strong, nullable) NSNumber * aNullableInt64; -@property(nonatomic, strong, nullable) NSNumber * aNullableDouble; -@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable4ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable8ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *> * nullableNestedList; -@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithObject; -@property(nonatomic, strong, nullable) FLTAnEnumBox * aNullableEnum; -@property(nonatomic, copy, nullable) NSString * aNullableString; -@property(nonatomic, strong, nullable) id aNullableObject; -@property(nonatomic, strong, nullable) FLTAllNullableTypes * allNullableTypes; -@property(nonatomic, copy, nullable) NSArray * list; -@property(nonatomic, copy, nullable) NSArray * stringList; -@property(nonatomic, copy, nullable) NSArray * intList; -@property(nonatomic, copy, nullable) NSArray * doubleList; -@property(nonatomic, copy, nullable) NSArray * boolList; -@property(nonatomic, copy, nullable) NSArray * nestedClassList; -@property(nonatomic, copy, nullable) NSDictionary * map; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations: + (nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + allNullableTypes:(nullable FLTAllNullableTypes *)allNullableTypes + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + nestedClassList:(nullable NSArray *)nestedClassList + map:(nullable NSDictionary *)map; +@property(nonatomic, strong, nullable) NSNumber *aNullableBool; +@property(nonatomic, strong, nullable) NSNumber *aNullableInt; +@property(nonatomic, strong, nullable) NSNumber *aNullableInt64; +@property(nonatomic, strong, nullable) NSNumber *aNullableDouble; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; +@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; +@property(nonatomic, copy, nullable) + NSDictionary *nullableMapWithAnnotations; +@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; +@property(nonatomic, strong, nullable) FLTAnEnumBox *aNullableEnum; +@property(nonatomic, copy, nullable) NSString *aNullableString; +@property(nonatomic, strong, nullable) id aNullableObject; +@property(nonatomic, strong, nullable) FLTAllNullableTypes *allNullableTypes; +@property(nonatomic, copy, nullable) NSArray *list; +@property(nonatomic, copy, nullable) NSArray *stringList; +@property(nonatomic, copy, nullable) NSArray *intList; +@property(nonatomic, copy, nullable) NSArray *doubleList; +@property(nonatomic, copy, nullable) NSArray *boolList; +@property(nonatomic, copy, nullable) NSArray *nestedClassList; +@property(nonatomic, copy, nullable) NSDictionary *map; @end /// The primary purpose for this class is to ensure coverage of Swift structs @@ -127,45 +129,47 @@ typedef NS_ENUM(NSUInteger, FLTAnEnum) { /// test Swift classes. @interface FLTAllNullableTypesWithoutRecursion : NSObject + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id )aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - map:(nullable NSDictionary *)map; -@property(nonatomic, strong, nullable) NSNumber * aNullableBool; -@property(nonatomic, strong, nullable) NSNumber * aNullableInt; -@property(nonatomic, strong, nullable) NSNumber * aNullableInt64; -@property(nonatomic, strong, nullable) NSNumber * aNullableDouble; -@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable4ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable8ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *> * nullableNestedList; -@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithObject; -@property(nonatomic, strong, nullable) FLTAnEnumBox * aNullableEnum; -@property(nonatomic, copy, nullable) NSString * aNullableString; -@property(nonatomic, strong, nullable) id aNullableObject; -@property(nonatomic, copy, nullable) NSArray * list; -@property(nonatomic, copy, nullable) NSArray * stringList; -@property(nonatomic, copy, nullable) NSArray * intList; -@property(nonatomic, copy, nullable) NSArray * doubleList; -@property(nonatomic, copy, nullable) NSArray * boolList; -@property(nonatomic, copy, nullable) NSDictionary * map; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations: + (nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + map:(nullable NSDictionary *)map; +@property(nonatomic, strong, nullable) NSNumber *aNullableBool; +@property(nonatomic, strong, nullable) NSNumber *aNullableInt; +@property(nonatomic, strong, nullable) NSNumber *aNullableInt64; +@property(nonatomic, strong, nullable) NSNumber *aNullableDouble; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; +@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; +@property(nonatomic, copy, nullable) + NSDictionary *nullableMapWithAnnotations; +@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; +@property(nonatomic, strong, nullable) FLTAnEnumBox *aNullableEnum; +@property(nonatomic, copy, nullable) NSString *aNullableString; +@property(nonatomic, strong, nullable) id aNullableObject; +@property(nonatomic, copy, nullable) NSArray *list; +@property(nonatomic, copy, nullable) NSArray *stringList; +@property(nonatomic, copy, nullable) NSArray *intList; +@property(nonatomic, copy, nullable) NSArray *doubleList; +@property(nonatomic, copy, nullable) NSArray *boolList; +@property(nonatomic, copy, nullable) NSDictionary *map; @end /// A class for testing nested class handling. @@ -177,17 +181,19 @@ typedef NS_ENUM(NSUInteger, FLTAnEnum) { /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithAllNullableTypes:(FLTAllNullableTypes *)allNullableTypes - allNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion - allTypes:(nullable FLTAllTypes *)allTypes; -@property(nonatomic, strong) FLTAllNullableTypes * allNullableTypes; -@property(nonatomic, strong, nullable) FLTAllNullableTypesWithoutRecursion * allNullableTypesWithoutRecursion; -@property(nonatomic, strong, nullable) FLTAllTypes * allTypes; + allNullableTypesWithoutRecursion: + (nullable FLTAllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion + allTypes:(nullable FLTAllTypes *)allTypes; +@property(nonatomic, strong) FLTAllNullableTypes *allNullableTypes; +@property(nonatomic, strong, nullable) + FLTAllNullableTypesWithoutRecursion *allNullableTypesWithoutRecursion; +@property(nonatomic, strong, nullable) FLTAllTypes *allTypes; @end /// A data class containing a List, used in unit tests. @interface FLTTestMessage : NSObject + (instancetype)makeWithTestList:(nullable NSArray *)testList; -@property(nonatomic, copy, nullable) NSArray * testList; +@property(nonatomic, copy, nullable) NSArray *testList; @end /// The codec used by all APIs. @@ -202,7 +208,8 @@ NSObject *FLTGetCoreTestsCodec(void); /// Returns the passed object, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable FLTAllTypes *)echoAllTypes:(FLTAllTypes *)everything error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FLTAllTypes *)echoAllTypes:(FLTAllTypes *)everything + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns an error, to test error handling. - (nullable id)throwErrorWithError:(FlutterError *_Nullable *_Nonnull)error; /// Returns an error from a void function, to test error handling. @@ -224,11 +231,13 @@ NSObject *FLTGetCoreTestsCodec(void); /// Returns the passed in string. /// /// @return `nil` only when `error != nil`. -- (nullable NSString *)echoString:(NSString *)aString error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoString:(NSString *)aString + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in Uint8List. /// /// @return `nil` only when `error != nil`. -- (nullable FlutterStandardTypedData *)echoUint8List:(FlutterStandardTypedData *)aUint8List error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FlutterStandardTypedData *)echoUint8List:(FlutterStandardTypedData *)aUint8List + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in generic Object. /// /// @return `nil` only when `error != nil`. @@ -236,160 +245,279 @@ NSObject *FLTGetCoreTestsCodec(void); /// Returns the passed list, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable NSArray *)echoList:(NSArray *)list error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSArray *)echoList:(NSArray *)list + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed map, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed map to test nested class serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable FLTAllClassesWrapper *)echoClassWrapper:(FLTAllClassesWrapper *)wrapper error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FLTAllClassesWrapper *)echoClassWrapper:(FLTAllClassesWrapper *)wrapper + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed enum to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (FLTAnEnumBox *_Nullable)echoEnum:(FLTAnEnum)anEnum error:(FlutterError *_Nullable *_Nonnull)error; +- (FLTAnEnumBox *_Nullable)echoEnum:(FLTAnEnum)anEnum + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the default string. /// /// @return `nil` only when `error != nil`. -- (nullable NSString *)echoNamedDefaultString:(NSString *)aString error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNamedDefaultString:(NSString *)aString + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in double. /// /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoOptionalDefaultDouble:(double)aDouble error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoOptionalDefaultDouble:(double)aDouble + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. /// /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoRequiredInt:(NSInteger)anInt error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoRequiredInt:(NSInteger)anInt + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed object, to test serialization and deserialization. -- (nullable FLTAllNullableTypes *)echoAllNullableTypes:(nullable FLTAllNullableTypes *)everything error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FLTAllNullableTypes *)echoAllNullableTypes:(nullable FLTAllNullableTypes *)everything + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed object, to test serialization and deserialization. -- (nullable FLTAllNullableTypesWithoutRecursion *)echoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FLTAllNullableTypesWithoutRecursion *) + echoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. -- (nullable NSString *)extractNestedNullableStringFrom:(FLTAllClassesWrapper *)wrapper error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)extractNestedNullableStringFrom:(FLTAllClassesWrapper *)wrapper + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. /// /// @return `nil` only when `error != nil`. -- (nullable FLTAllClassesWrapper *)createNestedObjectWithNullableString:(nullable NSString *)nullableString error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FLTAllClassesWrapper *) + createNestedObjectWithNullableString:(nullable NSString *)nullableString + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in arguments of multiple types. /// /// @return `nil` only when `error != nil`. -- (nullable FLTAllNullableTypes *)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FLTAllNullableTypes *) + sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in arguments of multiple types. /// /// @return `nil` only when `error != nil`. -- (nullable FLTAllNullableTypesWithoutRecursion *)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FLTAllNullableTypesWithoutRecursion *) + sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. -- (nullable NSNumber *)echoNullableInt:(nullable NSNumber *)aNullableInt error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableInt:(nullable NSNumber *)aNullableInt + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in double. -- (nullable NSNumber *)echoNullableDouble:(nullable NSNumber *)aNullableDouble error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableDouble:(nullable NSNumber *)aNullableDouble + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in boolean. -- (nullable NSNumber *)echoNullableBool:(nullable NSNumber *)aNullableBool error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableBool:(nullable NSNumber *)aNullableBool + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in string. -- (nullable NSString *)echoNullableString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNullableString:(nullable NSString *)aNullableString + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in Uint8List. -- (nullable FlutterStandardTypedData *)echoNullableUint8List:(nullable FlutterStandardTypedData *)aNullableUint8List error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FlutterStandardTypedData *) + echoNullableUint8List:(nullable FlutterStandardTypedData *)aNullableUint8List + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in generic Object. -- (nullable id)echoNullableObject:(nullable id)aNullableObject error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable id)echoNullableObject:(nullable id)aNullableObject + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed list, to test serialization and deserialization. -- (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)aNullableMap error:(FlutterError *_Nullable *_Nonnull)error; -- (FLTAnEnumBox *_Nullable)echoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSDictionary *)echoNullableMap: + (nullable NSDictionary *)aNullableMap + error:(FlutterError *_Nullable *_Nonnull)error; +- (FLTAnEnumBox *_Nullable)echoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. -- (nullable NSNumber *)echoOptionalNullableInt:(nullable NSNumber *)aNullableInt error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoOptionalNullableInt:(nullable NSNumber *)aNullableInt + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in string. -- (nullable NSString *)echoNamedNullableString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNamedNullableString:(nullable NSString *)aNullableString + error:(FlutterError *_Nullable *_Nonnull)error; /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Returns passed in int asynchronously. -- (void)echoAsyncInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncInt:(NSInteger)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in double asynchronously. -- (void)echoAsyncDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncDouble:(double)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in boolean asynchronously. -- (void)echoAsyncBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncBool:(BOOL)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string asynchronously. -- (void)echoAsyncString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in Uint8List asynchronously. -- (void)echoAsyncUint8List:(FlutterStandardTypedData *)aUint8List completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncUint8List:(FlutterStandardTypedData *)aUint8List + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed in generic Object asynchronously. -- (void)echoAsyncObject:(id)anObject completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncObject:(id)anObject + completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncList:(NSArray *)list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncMap:(NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAsyncEnum:(FLTAnEnum)anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncEnum:(FLTAnEnum)anEnum + completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// Responds with an error from an async function returning a value. - (void)throwAsyncErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Responds with an error from an async void function. - (void)throwAsyncErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Responds with a Flutter error from an async function returning a value. -- (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +- (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, + FlutterError *_Nullable))completion; /// Returns the passed object, to test async serialization and deserialization. -- (void)echoAsyncAllTypes:(FLTAllTypes *)everything completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncAllTypes:(FLTAllTypes *)everything + completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAsyncNullableAllNullableTypes:(nullable FLTAllNullableTypes *)everything completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableAllNullableTypes:(nullable FLTAllNullableTypes *)everything + completion:(void (^)(FLTAllNullableTypes *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAsyncNullableAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableAllNullableTypesWithoutRecursion: + (nullable FLTAllNullableTypesWithoutRecursion *)everything + completion: + (void (^)(FLTAllNullableTypesWithoutRecursion + *_Nullable, + FlutterError *_Nullable))completion; /// Returns passed in int asynchronously. -- (void)echoAsyncNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableInt:(nullable NSNumber *)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in double asynchronously. -- (void)echoAsyncNullableDouble:(nullable NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableDouble:(nullable NSNumber *)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in boolean asynchronously. -- (void)echoAsyncNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableBool:(nullable NSNumber *)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string asynchronously. -- (void)echoAsyncNullableString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableString:(nullable NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in Uint8List asynchronously. -- (void)echoAsyncNullableUint8List:(nullable FlutterStandardTypedData *)aUint8List completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableUint8List:(nullable FlutterStandardTypedData *)aUint8List + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed in generic Object asynchronously. -- (void)echoAsyncNullableObject:(nullable id)anObject completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableObject:(nullable id)anObject + completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableList:(nullable NSArray *)list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed + completion: + (void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; - (void)callFlutterNoopWithCompletion:(void (^)(FlutterError *_Nullable))completion; -- (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, + FlutterError *_Nullable))completion; - (void)callFlutterThrowErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllTypes:(FLTAllTypes *)everything completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllNullableTypes:(nullable FLTAllNullableTypes *)everything completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterSendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoEnum:(FLTAnEnum)anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableDouble:(nullable NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableUint8List:(nullable FlutterStandardTypedData *)list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterSmallApiEchoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllTypes:(FLTAllTypes *)everything + completion: + (void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllNullableTypes:(nullable FLTAllNullableTypes *)everything + completion:(void (^)(FLTAllNullableTypes *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + completion:(void (^)(FLTAllNullableTypes *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllNullableTypesWithoutRecursion: + (nullable FLTAllNullableTypesWithoutRecursion *)everything + completion: + (void (^)( + FLTAllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion; +- (void) + callFlutterSendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + completion: + (void (^)(FLTAllNullableTypesWithoutRecursion + *_Nullable, + FlutterError *_Nullable)) + completion; +- (void)callFlutterEchoBool:(BOOL)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoInt:(NSInteger)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoDouble:(double)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)list + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoList:(NSArray *)list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoMap:(NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoEnum:(FLTAnEnum)anEnum + completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool + completion: + (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableInt:(nullable NSNumber *)anInt + completion: + (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableDouble:(nullable NSNumber *)aDouble + completion: + (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableString:(nullable NSString *)aString + completion: + (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableUint8List:(nullable FlutterStandardTypedData *)list + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableList:(nullable NSArray *)list + completion: + (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed + completion: + (void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterSmallApiEchoString:(NSString *)aString + completion: + (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end -extern void SetUpFLTHostIntegrationCoreApi(id binaryMessenger, NSObject *_Nullable api); - -extern void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryMessenger, NSObject *_Nullable api, NSString *messageChannelSuffix); +extern void SetUpFLTHostIntegrationCoreApi(id binaryMessenger, + NSObject *_Nullable api); +extern void SetUpFLTHostIntegrationCoreApiWithSuffix( + id binaryMessenger, NSObject *_Nullable api, + NSString *messageChannelSuffix); /// The core interface that the Dart platform_test code implements for host /// integration tests to call into. @interface FLTFlutterIntegrationCoreApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger messageChannelSuffix:(nullable NSString *)messageChannelSuffix; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix; /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. - (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion; @@ -398,86 +526,130 @@ extern void SetUpFLTHostIntegrationCoreApiWithSuffix(id /// Responds with an error from an async void function. - (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAllTypes:(FLTAllTypes *)everything completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAllTypes:(FLTAllTypes *)everything + completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAllNullableTypes:(nullable FLTAllNullableTypes *)everything completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAllNullableTypes:(nullable FLTAllNullableTypes *)everything + completion: + (void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + completion:(void (^)(FLTAllNullableTypes *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; +- (void) + echoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)everything + completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion; /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. -- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; +- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + completion: + (void (^)( + FLTAllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed boolean, to test serialization and deserialization. -- (void)echoBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoBool:(BOOL)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed int, to test serialization and deserialization. -- (void)echoInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoInt:(NSInteger)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed double, to test serialization and deserialization. -- (void)echoDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoDouble:(double)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string, to test serialization and deserialization. -- (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed byte list, to test serialization and deserialization. -- (void)echoUint8List:(FlutterStandardTypedData *)list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)echoUint8List:(FlutterStandardTypedData *)list + completion: + (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test serialization and deserialization. -- (void)echoList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoList:(NSArray *)list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization. -- (void)echoMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)echoMap:(NSDictionary *)aMap + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. -- (void)echoEnum:(FLTAnEnum)anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoEnum:(FLTAnEnum)anEnum + completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed boolean, to test serialization and deserialization. -- (void)echoNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableBool:(nullable NSNumber *)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed int, to test serialization and deserialization. -- (void)echoNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableInt:(nullable NSNumber *)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed double, to test serialization and deserialization. -- (void)echoNullableDouble:(nullable NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableDouble:(nullable NSNumber *)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string, to test serialization and deserialization. -- (void)echoNullableString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableString:(nullable NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed byte list, to test serialization and deserialization. -- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)list + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed list, to test serialization and deserialization. -- (void)echoNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableList:(nullable NSArray *)list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableMap:(nullable NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. -- (void)echoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed + completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Returns the passed in generic Object asynchronously. -- (void)echoAsyncString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end - /// An API that can be implemented for minimal, compile-only tests. @protocol FLTHostTrivialApi - (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error; @end -extern void SetUpFLTHostTrivialApi(id binaryMessenger, NSObject *_Nullable api); - -extern void SetUpFLTHostTrivialApiWithSuffix(id binaryMessenger, NSObject *_Nullable api, NSString *messageChannelSuffix); +extern void SetUpFLTHostTrivialApi(id binaryMessenger, + NSObject *_Nullable api); +extern void SetUpFLTHostTrivialApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); /// A simple API implemented in some unit tests. @protocol FLTHostSmallApi -- (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; - (void)voidVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; @end -extern void SetUpFLTHostSmallApi(id binaryMessenger, NSObject *_Nullable api); - -extern void SetUpFLTHostSmallApiWithSuffix(id binaryMessenger, NSObject *_Nullable api, NSString *messageChannelSuffix); +extern void SetUpFLTHostSmallApi(id binaryMessenger, + NSObject *_Nullable api); +extern void SetUpFLTHostSmallApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); /// A simple API called in some unit tests. @interface FLTFlutterSmallApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -- (void)echoWrappedList:(FLTTestMessage *)msg completion:(void (^)(FLTTestMessage *_Nullable, FlutterError *_Nullable))completion; -- (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix; +- (void)echoWrappedList:(FLTTestMessage *)msg + completion:(void (^)(FLTTestMessage *_Nullable, FlutterError *_Nullable))completion; +- (void)echoString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end NS_ASSUME_NONNULL_END diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m index 19797a062968..6dae6ff2abde 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m @@ -27,7 +27,12 @@ } static FlutterError *createConnectionError(NSString *channelName) { - return [FlutterError errorWithCode:@"channel-error" message:[NSString stringWithFormat:@"%@/%@/%@", @"Unable to establish connection on channel: '", channelName, @"'."] details:@""]; + return [FlutterError + errorWithCode:@"channel-error" + message:[NSString stringWithFormat:@"%@/%@/%@", + @"Unable to establish connection on channel: '", + channelName, @"'."] + details:@""]; } static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { @@ -76,24 +81,24 @@ + (nullable FLTTestMessage *)nullableFromList:(NSArray *)list; @end @implementation FLTAllTypes -+ (instancetype)makeWithABool:(BOOL )aBool - anInt:(NSInteger )anInt - anInt64:(NSInteger )anInt64 - aDouble:(double )aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - anEnum:(FLTAnEnum)anEnum - aString:(NSString *)aString - anObject:(id )anObject - list:(NSArray *)list - stringList:(NSArray *)stringList - intList:(NSArray *)intList - doubleList:(NSArray *)doubleList - boolList:(NSArray *)boolList - map:(NSDictionary *)map { - FLTAllTypes* pigeonResult = [[FLTAllTypes alloc] init]; ++ (instancetype)makeWithABool:(BOOL)aBool + anInt:(NSInteger)anInt + anInt64:(NSInteger)anInt64 + aDouble:(double)aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + anEnum:(FLTAnEnum)anEnum + aString:(NSString *)aString + anObject:(id)anObject + list:(NSArray *)list + stringList:(NSArray *)stringList + intList:(NSArray *)intList + doubleList:(NSArray *)doubleList + boolList:(NSArray *)boolList + map:(NSDictionary *)map { + FLTAllTypes *pigeonResult = [[FLTAllTypes alloc] init]; pigeonResult.aBool = aBool; pigeonResult.anInt = anInt; pigeonResult.anInt64 = anInt64; @@ -163,28 +168,29 @@ + (nullable FLTAllTypes *)nullableFromList:(NSArray *)list { @implementation FLTAllNullableTypes + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id )aNullableObject - allNullableTypes:(nullable FLTAllNullableTypes *)allNullableTypes - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - nestedClassList:(nullable NSArray *)nestedClassList - map:(nullable NSDictionary *)map { - FLTAllNullableTypes* pigeonResult = [[FLTAllNullableTypes alloc] init]; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations: + (nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + allNullableTypes:(nullable FLTAllNullableTypes *)allNullableTypes + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + nestedClassList:(nullable NSArray *)nestedClassList + map:(nullable NSDictionary *)map { + FLTAllNullableTypes *pigeonResult = [[FLTAllNullableTypes alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; pigeonResult.aNullableInt64 = aNullableInt64; @@ -268,26 +274,28 @@ + (nullable FLTAllNullableTypes *)nullableFromList:(NSArray *)list { @implementation FLTAllNullableTypesWithoutRecursion + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id )aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - map:(nullable NSDictionary *)map { - FLTAllNullableTypesWithoutRecursion* pigeonResult = [[FLTAllNullableTypesWithoutRecursion alloc] init]; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations: + (nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + map:(nullable NSDictionary *)map { + FLTAllNullableTypesWithoutRecursion *pigeonResult = + [[FLTAllNullableTypesWithoutRecursion alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; pigeonResult.aNullableInt64 = aNullableInt64; @@ -311,7 +319,8 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool return pigeonResult; } + (FLTAllNullableTypesWithoutRecursion *)fromList:(NSArray *)list { - FLTAllNullableTypesWithoutRecursion *pigeonResult = [[FLTAllNullableTypesWithoutRecursion alloc] init]; + FLTAllNullableTypesWithoutRecursion *pigeonResult = + [[FLTAllNullableTypesWithoutRecursion alloc] init]; pigeonResult.aNullableBool = GetNullableObjectAtIndex(list, 0); pigeonResult.aNullableInt = GetNullableObjectAtIndex(list, 1); pigeonResult.aNullableInt64 = GetNullableObjectAtIndex(list, 2); @@ -365,9 +374,10 @@ + (nullable FLTAllNullableTypesWithoutRecursion *)nullableFromList:(NSArray @implementation FLTAllClassesWrapper + (instancetype)makeWithAllNullableTypes:(FLTAllNullableTypes *)allNullableTypes - allNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion - allTypes:(nullable FLTAllTypes *)allTypes { - FLTAllClassesWrapper* pigeonResult = [[FLTAllClassesWrapper alloc] init]; + allNullableTypesWithoutRecursion: + (nullable FLTAllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion + allTypes:(nullable FLTAllTypes *)allTypes { + FLTAllClassesWrapper *pigeonResult = [[FLTAllClassesWrapper alloc] init]; pigeonResult.allNullableTypes = allNullableTypes; pigeonResult.allNullableTypesWithoutRecursion = allNullableTypesWithoutRecursion; pigeonResult.allTypes = allTypes; @@ -394,7 +404,7 @@ + (nullable FLTAllClassesWrapper *)nullableFromList:(NSArray *)list { @implementation FLTTestMessage + (instancetype)makeWithTestList:(nullable NSArray *)testList { - FLTTestMessage* pigeonResult = [[FLTTestMessage alloc] init]; + FLTTestMessage *pigeonResult = [[FLTTestMessage alloc] init]; pigeonResult.testList = testList; return pigeonResult; } @@ -418,21 +428,21 @@ @interface FLTCoreTestsPigeonCodecReader : FlutterStandardReader @implementation FLTCoreTestsPigeonCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 129: + case 129: return [FLTAllTypes fromList:[self readValue]]; - case 130: + case 130: return [FLTAllNullableTypes fromList:[self readValue]]; - case 131: + case 131: return [FLTAllNullableTypesWithoutRecursion fromList:[self readValue]]; - case 132: + case 132: return [FLTAllClassesWrapper fromList:[self readValue]]; - case 133: + case 133: return [FLTTestMessage fromList:[self readValue]]; - case 134: - { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil ? nil : [[FLTAnEnumBox alloc] initWithValue:[enumAsNumber integerValue]]; - } + case 134: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[FLTAnEnumBox alloc] initWithValue:[enumAsNumber integerValue]]; + } default: return [super readValueOfType:type]; } @@ -459,7 +469,7 @@ - (void)writeValue:(id)value { [self writeByte:133]; [self writeValue:[value toList]]; } else if ([value isKindOfClass:[FLTAnEnumBox class]]) { - FLTAnEnumBox * box = (FLTAnEnumBox *)value; + FLTAnEnumBox *box = (FLTAnEnumBox *)value; [self writeByte:134]; [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; } else { @@ -483,27 +493,37 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - FLTCoreTestsPigeonCodecReaderWriter *readerWriter = [[FLTCoreTestsPigeonCodecReaderWriter alloc] init]; + FLTCoreTestsPigeonCodecReaderWriter *readerWriter = + [[FLTCoreTestsPigeonCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } -void SetUpFLTHostIntegrationCoreApi(id binaryMessenger, NSObject *api) { +void SetUpFLTHostIntegrationCoreApi(id binaryMessenger, + NSObject *api) { SetUpFLTHostIntegrationCoreApiWithSuffix(binaryMessenger, api, @""); } -void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryMessenger, NSObject *api, NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat: @".%@", messageChannelSuffix] : @""; +void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.noop", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(noopWithError:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(noopWithError:)", api); + NSCAssert([api respondsToSelector:@selector(noopWithError:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(noopWithError:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; [api noopWithError:&error]; @@ -515,13 +535,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAllTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAllTypes:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllTypes:error:)", api); + NSCAssert( + [api respondsToSelector:@selector(echoAllTypes:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllTypes:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); @@ -535,13 +560,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns an error, to test error handling. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.throwError", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwErrorWithError:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(throwErrorWithError:)", api); + NSCAssert( + [api respondsToSelector:@selector(throwErrorWithError:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(throwErrorWithError:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; id output = [api throwErrorWithError:&error]; @@ -553,13 +583,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns an error from a void function, to test error handling. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.throwErrorFromVoid", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwErrorFromVoidWithError:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(throwErrorFromVoidWithError:)", api); + NSCAssert([api respondsToSelector:@selector(throwErrorFromVoidWithError:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwErrorFromVoidWithError:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; [api throwErrorFromVoidWithError:&error]; @@ -571,13 +606,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns a Flutter error, to test error handling. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.throwFlutterError", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwFlutterErrorWithError:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(throwFlutterErrorWithError:)", api); + NSCAssert([api respondsToSelector:@selector(throwFlutterErrorWithError:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwFlutterErrorWithError:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; id output = [api throwFlutterErrorWithError:&error]; @@ -589,13 +629,17 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoInt:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoInt:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoInt:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoInt:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; @@ -609,13 +653,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoDouble:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoDouble:error:)", api); + NSCAssert( + [api respondsToSelector:@selector(echoDouble:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoDouble:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; @@ -629,13 +678,17 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in boolean. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoBool", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoBool:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoBool:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoBool:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoBool:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; @@ -649,13 +702,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoString:error:)", api); + NSCAssert( + [api respondsToSelector:@selector(echoString:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoString:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); @@ -669,13 +727,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in Uint8List. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoUint8List", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoUint8List:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoUint8List:error:)", api); + NSCAssert( + [api respondsToSelector:@selector(echoUint8List:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoUint8List:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); @@ -689,13 +752,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in generic Object. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoObject", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoObject:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoObject:error:)", api); + NSCAssert( + [api respondsToSelector:@selector(echoObject:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoObject:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_anObject = GetNullableObjectAtIndex(args, 0); @@ -709,13 +777,17 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed list, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoList:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoList:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoList:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoList:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); @@ -729,13 +801,17 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed map, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoMap:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoMap:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); @@ -749,13 +825,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed map to test nested class serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoClassWrapper", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoClassWrapper:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassWrapper:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoClassWrapper:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoClassWrapper:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); @@ -769,19 +850,23 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed enum to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoEnum", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAnEnumBox *enumBox = GetNullableObjectAtIndex(args, 0); FLTAnEnum arg_anEnum = enumBox.value; FlutterError *error; - FLTAnEnumBox * output = [api echoEnum:arg_anEnum error:&error]; + FLTAnEnumBox *output = [api echoEnum:arg_anEnum error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -790,13 +875,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the default string. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNamedDefaultString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNamedDefaultString:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNamedDefaultString:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); @@ -810,13 +900,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoOptionalDefaultDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoOptionalDefaultDouble:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoOptionalDefaultDouble:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; @@ -830,13 +926,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoRequiredInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoRequiredInt:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoRequiredInt:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoRequiredInt:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoRequiredInt:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; @@ -850,13 +951,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAllNullableTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAllNullableTypes:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllNullableTypes:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoAllNullableTypes:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAllNullableTypes:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); @@ -870,18 +976,26 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAllNullableTypesWithoutRecursion:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllNullableTypesWithoutRecursion:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoAllNullableTypesWithoutRecursion:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAllNullableTypesWithoutRecursion:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); FlutterError *error; - FLTAllNullableTypesWithoutRecursion *output = [api echoAllNullableTypesWithoutRecursion:arg_everything error:&error]; + FLTAllNullableTypesWithoutRecursion *output = + [api echoAllNullableTypesWithoutRecursion:arg_everything error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -891,13 +1005,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.extractNestedNullableString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(extractNestedNullableStringFrom:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(extractNestedNullableStringFrom:error:)", api); + NSCAssert([api respondsToSelector:@selector(extractNestedNullableStringFrom:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(extractNestedNullableStringFrom:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); @@ -912,18 +1032,25 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.createNestedNullableString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(createNestedObjectWithNullableString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(createNestedObjectWithNullableString:error:)", api); + NSCAssert([api respondsToSelector:@selector(createNestedObjectWithNullableString:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(createNestedObjectWithNullableString:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_nullableString = GetNullableObjectAtIndex(args, 0); FlutterError *error; - FLTAllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString error:&error]; + FLTAllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString + error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -932,20 +1059,30 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in arguments of multiple types. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.sendMultipleNullableTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesABool:anInt:aString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(sendMultipleNullableTypesABool:anInt:aString:error:)", api); + NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesABool: + anInt:aString:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(sendMultipleNullableTypesABool:anInt:aString:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); FlutterError *error; - FLTAllNullableTypes *output = [api sendMultipleNullableTypesABool:arg_aNullableBool anInt:arg_aNullableInt aString:arg_aNullableString error:&error]; + FLTAllNullableTypes *output = [api sendMultipleNullableTypesABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -954,20 +1091,32 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in arguments of multiple types. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)", api); + NSCAssert([api respondsToSelector:@selector + (sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); FlutterError *error; - FLTAllNullableTypesWithoutRecursion *output = [api sendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool anInt:arg_aNullableInt aString:arg_aNullableString error:&error]; + FLTAllNullableTypesWithoutRecursion *output = + [api sendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -976,13 +1125,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableInt:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableInt:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNullableInt:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableInt:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); @@ -996,13 +1150,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableDouble:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableDouble:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNullableDouble:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableDouble:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableDouble = GetNullableObjectAtIndex(args, 0); @@ -1016,13 +1175,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in boolean. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableBool", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableBool:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableBool:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNullableBool:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableBool:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); @@ -1036,13 +1200,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableString:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNullableString:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableString:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); @@ -1056,18 +1225,24 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in Uint8List. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableUint8List", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableUint8List:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableUint8List:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNullableUint8List:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableUint8List:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_aNullableUint8List = GetNullableObjectAtIndex(args, 0); FlutterError *error; - FlutterStandardTypedData *output = [api echoNullableUint8List:arg_aNullableUint8List error:&error]; + FlutterStandardTypedData *output = [api echoNullableUint8List:arg_aNullableUint8List + error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1076,13 +1251,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in generic Object. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableObject", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableObject:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableObject:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNullableObject:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableObject:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_aNullableObject = GetNullableObjectAtIndex(args, 0); @@ -1096,13 +1276,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed list, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableList:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableList:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNullableList:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableList:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_aNullableList = GetNullableObjectAtIndex(args, 0); @@ -1116,13 +1301,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed map, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableMap:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableMap:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNullableMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableMap:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aNullableMap = GetNullableObjectAtIndex(args, 0); @@ -1135,18 +1325,23 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableEnum", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableEnum:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableEnum:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNullableEnum:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableEnum:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); FlutterError *error; - FLTAnEnumBox * output = [api echoNullableEnum:arg_anEnum error:&error]; + FLTAnEnumBox *output = [api echoNullableEnum:arg_anEnum error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1155,13 +1350,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoOptionalNullableInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoOptionalNullableInt:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoOptionalNullableInt:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); @@ -1175,13 +1376,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNamedNullableString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNamedNullableString:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNamedNullableString:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); @@ -1196,13 +1403,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.noopAsync", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(noopAsyncWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(noopAsyncWithCompletion:)", api); + NSCAssert([api respondsToSelector:@selector(noopAsyncWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(noopAsyncWithCompletion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api noopAsyncWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -1214,19 +1426,25 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in int asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncInt:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncInt:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncInt:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncInt:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api echoAsyncInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncInt:arg_anInt + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1234,19 +1452,25 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in double asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncDouble:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncDouble:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncDouble:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncDouble:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api echoAsyncDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1254,19 +1478,25 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in boolean asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncBool", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncBool:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncBool:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncBool:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncBool:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api echoAsyncBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncBool:arg_aBool + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1274,19 +1504,25 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed string asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncString:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncString:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncString:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoAsyncString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1294,19 +1530,26 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in Uint8List asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncUint8List", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncUint8List:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncUint8List:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncUint8List:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncUint8List:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); - [api echoAsyncUint8List:arg_aUint8List completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncUint8List:arg_aUint8List + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1314,19 +1557,25 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in generic Object asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncObject", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncObject:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncObject:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncObject:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncObject:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_anObject = GetNullableObjectAtIndex(args, 0); - [api echoAsyncObject:arg_anObject completion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncObject:arg_anObject + completion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1334,19 +1583,25 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed list, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncList:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncList:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncList:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api echoAsyncList:arg_list completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncList:arg_list + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1354,19 +1609,26 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed map, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncMap:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncMap:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncMap:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncMap:arg_aMap completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncMap:arg_aMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1374,20 +1636,26 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed enum, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncEnum", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncEnum:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncEnum:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAnEnumBox *enumBox = GetNullableObjectAtIndex(args, 0); FLTAnEnum arg_anEnum = enumBox.value; - [api echoAsyncEnum:arg_anEnum completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncEnum:arg_anEnum + completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1395,13 +1663,18 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Responds with an error from an async function returning a value. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.throwAsyncError", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncErrorWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(throwAsyncErrorWithCompletion:)", api); + NSCAssert([api respondsToSelector:@selector(throwAsyncErrorWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwAsyncErrorWithCompletion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api throwAsyncErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); @@ -1413,13 +1686,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Responds with an error from an async void function. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.throwAsyncErrorFromVoid", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncErrorFromVoidWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(throwAsyncErrorFromVoidWithCompletion:)", api); + NSCAssert([api respondsToSelector:@selector(throwAsyncErrorFromVoidWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwAsyncErrorFromVoidWithCompletion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api throwAsyncErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -1431,15 +1710,21 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Responds with a Flutter error from an async function returning a value. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.throwAsyncFlutterError", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(throwAsyncFlutterErrorWithCompletion:)", api); + NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwAsyncFlutterErrorWithCompletion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { + [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, + FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -1449,19 +1734,25 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed object, to test async serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncAllTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncAllTypes:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncAllTypes:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncAllTypes:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncAllTypes:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncAllTypes:arg_everything completion:^(FLTAllTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncAllTypes:arg_everything + completion:^(FLTAllTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1469,19 +1760,27 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypes:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableAllNullableTypes:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypes:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableAllNullableTypes:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableAllNullableTypes:arg_everything completion:^(FLTAllNullableTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableAllNullableTypes:arg_everything + completion:^(FLTAllNullableTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1489,19 +1788,30 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi." + @"echoAsyncNullableAllNullableTypesWithoutRecursion", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)", api); + NSCAssert([api respondsToSelector:@selector + (echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableAllNullableTypesWithoutRecursion:arg_everything completion:^(FLTAllNullableTypesWithoutRecursion *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableAllNullableTypesWithoutRecursion:arg_everything + completion:^(FLTAllNullableTypesWithoutRecursion + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1509,19 +1819,25 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in int asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableInt:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableInt:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableInt:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableInt:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableInt:arg_anInt + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1529,19 +1845,26 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns passed in double asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableDouble:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableDouble:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableDouble:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableDouble:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1549,19 +1872,25 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in boolean asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableBool", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableBool:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableBool:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableBool:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableBool:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableBool:arg_aBool + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1569,19 +1898,26 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed string asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableString:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableString:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableString:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1589,19 +1925,27 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in Uint8List asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableUint8List", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableUint8List:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableUint8List:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableUint8List:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableUint8List:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableUint8List:arg_aUint8List completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableUint8List:arg_aUint8List + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1609,19 +1953,26 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed in generic Object asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableObject", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableObject:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableObject:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableObject:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableObject:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_anObject = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableObject:arg_anObject completion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableObject:arg_anObject + completion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1629,19 +1980,25 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed list, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableList:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableList:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableList:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableList:arg_list completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableList:arg_list + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1649,19 +2006,26 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed map, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableMap:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableMap:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableMap:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableMap:arg_aMap completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableMap:arg_aMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1669,32 +2033,44 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } /// Returns the passed enum, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableEnum", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableEnum:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableEnum:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableEnum:arg_anEnum completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api + echoAsyncNullableEnum:arg_anEnum + completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterNoop", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterNoopWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterNoopWithCompletion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterNoopWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterNoopWithCompletion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api callFlutterNoopWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -1705,15 +2081,21 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterThrowError", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterThrowErrorWithCompletion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterThrowErrorWithCompletion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api callFlutterThrowErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { + [api callFlutterThrowErrorWithCompletion:^(id _Nullable output, + FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -1722,13 +2104,19 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorFromVoidWithCompletion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterThrowErrorFromVoidWithCompletion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorFromVoidWithCompletion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterThrowErrorFromVoidWithCompletion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api callFlutterThrowErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -1739,423 +2127,602 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoAllTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllTypes:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoAllTypes:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllTypes:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAllTypes:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllTypes:arg_everything completion:^(FLTAllTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoAllTypes:arg_everything + completion:^(FLTAllTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoAllNullableTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoAllNullableTypes:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAllNullableTypes:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllNullableTypes:arg_everything completion:^(FLTAllNullableTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoAllNullableTypes:arg_everything + completion:^(FLTAllNullableTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)", api); + NSCAssert([api respondsToSelector:@selector + (callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); - [api callFlutterSendMultipleNullableTypesABool:arg_aNullableBool anInt:arg_aNullableInt aString:arg_aNullableString completion:^(FLTAllNullableTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterSendMultipleNullableTypesABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + completion:^(FLTAllNullableTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi." + @"callFlutterEchoAllNullableTypesWithoutRecursion", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)", api); + NSCAssert([api respondsToSelector:@selector + (callFlutterEchoAllNullableTypesWithoutRecursion:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllNullableTypesWithoutRecursion:arg_everything completion:^(FLTAllNullableTypesWithoutRecursion *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoAllNullableTypesWithoutRecursion:arg_everything + completion:^(FLTAllNullableTypesWithoutRecursion + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + @"callFlutterSendMultipleNullableTypesWithoutRecursion", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:completion:)", api); + NSCAssert( + [api respondsToSelector:@selector + (callFlutterSendMultipleNullableTypesWithoutRecursionABool: + anInt:aString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:" + @"completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); - [api callFlutterSendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool anInt:arg_aNullableInt aString:arg_aNullableString completion:^(FLTAllNullableTypesWithoutRecursion *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterSendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + completion:^( + FLTAllNullableTypesWithoutRecursion + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoBool", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoBool:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoBool:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoBool:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoBool:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api callFlutterEchoBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoBool:arg_aBool + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoInt:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoInt:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoInt:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoInt:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api callFlutterEchoInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoInt:arg_anInt + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoDouble:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoDouble:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoDouble:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoDouble:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api callFlutterEchoDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoString:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoString:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoString:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoUint8List", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoUint8List:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoUint8List:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoUint8List:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoUint8List:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoUint8List:arg_list completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoUint8List:arg_list + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoList:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoList:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoList:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoList:arg_list completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoList:arg_list + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoMap:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoMap:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoMap:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoMap:arg_aMap completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoMap:arg_aMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoEnum", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoEnum:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoEnum:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAnEnumBox *enumBox = GetNullableObjectAtIndex(args, 0); FLTAnEnum arg_anEnum = enumBox.value; - [api callFlutterEchoEnum:arg_anEnum completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoEnum:arg_anEnum + completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableBool", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableBool:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableBool:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableBool:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableBool:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableBool:arg_aBool + completion:^(NSNumber *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableInt:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableInt:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableInt:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableInt:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableInt:arg_anInt + completion:^(NSNumber *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableDouble:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableDouble:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableDouble:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableDouble:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableString:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableString:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableString:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableString:arg_aString + completion:^(NSString *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableUint8List", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableUint8List:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableUint8List:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableUint8List:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableUint8List:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableUint8List:arg_list completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableUint8List:arg_list + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableList:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableList:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableList:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableList:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableList:arg_list completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableList:arg_list + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableMap:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableMap:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableMap:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableMap:arg_aMap completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableMap:arg_aMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableEnum", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableEnum:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableEnum:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FLTAnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableEnum:arg_anEnum completion:^(FLTAnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableEnum:arg_anEnum + completion:^(FLTAnEnumBox *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterSmallApiEchoString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterSmallApiEchoString:completion:)], @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterSmallApiEchoString:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterSmallApiEchoString:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterSmallApiEchoString:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterSmallApiEchoString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterSmallApiEchoString:arg_aString + completion:^(NSString *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -2172,547 +2739,762 @@ @implementation FLTFlutterIntegrationCoreApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; } -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger messageChannelSuffix:(nullable NSString*)messageChannelSuffix{ +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix { self = [self init]; if (self) { _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 ? @"" : [NSString stringWithFormat: @".%@", messageChannelSuffix]; + _messageChannelSuffix = [messageChannelSuffix length] == 0 + ? @"" + : [NSString stringWithFormat:@".%@", messageChannelSuffix]; } return self; } - (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop", _messageChannelSuffix]; + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:nil reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:nil + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } - (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError", _messageChannelSuffix]; + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:nil reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - id output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:nil + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + id output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } - (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid", _messageChannelSuffix]; + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.throwErrorFromVoid", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:nil reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)echoAllTypes:(FLTAllTypes *)arg_everything completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:nil + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; +} +- (void)echoAllTypes:(FLTAllTypes *)arg_everything + completion:(void (^)(FLTAllTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - FLTAllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoAllNullableTypes:(nullable FLTAllNullableTypes *)arg_everything completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoAllNullableTypes:(nullable FLTAllNullableTypes *)arg_everything + completion:(void (^)(FLTAllNullableTypes *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoAllNullableTypes", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - FLTAllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool anInt:(nullable NSNumber *)arg_aNullableInt aString:(nullable NSString *)arg_aNullableString completion:(void (^)(FLTAllNullableTypes *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool + anInt:(nullable NSNumber *)arg_aNullableInt + aString:(nullable NSString *)arg_aNullableString + completion:(void (^)(FLTAllNullableTypes *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.sendMultipleNullableTypes", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], arg_aNullableString ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - FLTAllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoAllNullableTypesWithoutRecursion:(nullable FLTAllNullableTypesWithoutRecursion *)arg_everything completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ + arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], + arg_aNullableString ?: [NSNull null] + ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoAllNullableTypesWithoutRecursion: + (nullable FLTAllNullableTypesWithoutRecursion *)arg_everything + completion: + (void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - FLTAllNullableTypesWithoutRecursion *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)arg_aNullableBool anInt:(nullable NSNumber *)arg_aNullableInt aString:(nullable NSString *)arg_aNullableString completion:(void (^)(FLTAllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAllNullableTypesWithoutRecursion *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)arg_aNullableBool + anInt:(nullable NSNumber *)arg_aNullableInt + aString:(nullable NSString *)arg_aNullableString + completion: + (void (^)( + FLTAllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + @"sendMultipleNullableTypesWithoutRecursion", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], arg_aNullableString ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - FLTAllNullableTypesWithoutRecursion *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoBool:(BOOL)arg_aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ + arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], + arg_aNullableString ?: [NSNull null] + ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAllNullableTypesWithoutRecursion *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoBool:(BOOL)arg_aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[@(arg_aBool)] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoInt:(NSInteger)arg_anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ @(arg_aBool) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoInt:(NSInteger)arg_anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[@(arg_anInt)] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoDouble:(double)arg_aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ @(arg_anInt) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoDouble:(double)arg_aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[@(arg_aDouble)] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ @(arg_aDouble) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoString:(NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoUint8List:(FlutterStandardTypedData *)arg_list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoUint8List:(FlutterStandardTypedData *)arg_list + completion: + (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_list ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - FlutterStandardTypedData *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoList:(NSArray *)arg_list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_list ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FlutterStandardTypedData *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoList:(NSArray *)arg_list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_list ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoMap:(NSDictionary *)arg_aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_list ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoMap:(NSDictionary *)arg_aMap + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_aMap ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoEnum:(FLTAnEnum)arg_anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoEnum:(FLTAnEnum)arg_anEnum + completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[[[FLTAnEnumBox alloc] initWithValue:arg_anEnum]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - FLTAnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableBool:(nullable NSNumber *)arg_aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ [[FLTAnEnumBox alloc] initWithValue:arg_anEnum] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableBool:(nullable NSNumber *)arg_aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_aBool ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableInt:(nullable NSNumber *)arg_anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableInt:(nullable NSNumber *)arg_anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_anInt ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableDouble", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_aDouble ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableString:(nullable NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableString:(nullable NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableString", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableUint8List", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_list ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - FlutterStandardTypedData *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableList:(nullable NSArray *)arg_list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_list ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FlutterStandardTypedData *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableList:(nullable NSArray *)arg_list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_list ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_list ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_aMap ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableEnum:(nullable FLTAnEnumBox *)arg_anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableEnum:(nullable FLTAnEnumBox *)arg_anEnum + completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_anEnum == nil ? [NSNull null] : arg_anEnum] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - FLTAnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_anEnum == nil ? [NSNull null] : arg_anEnum ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTAnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync", _messageChannelSuffix]; + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:nil reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)echoAsyncString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:nil + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; +} +- (void)echoAsyncString:(NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } @end -void SetUpFLTHostTrivialApi(id binaryMessenger, NSObject *api) { +void SetUpFLTHostTrivialApi(id binaryMessenger, + NSObject *api) { SetUpFLTHostTrivialApiWithSuffix(binaryMessenger, api, @""); } -void SetUpFLTHostTrivialApiWithSuffix(id binaryMessenger, NSObject *api, NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat: @".%@", messageChannelSuffix] : @""; +void SetUpFLTHostTrivialApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(noopWithError:)], @"FLTHostTrivialApi api (%@) doesn't respond to @selector(noopWithError:)", api); + NSCAssert([api respondsToSelector:@selector(noopWithError:)], + @"FLTHostTrivialApi api (%@) doesn't respond to @selector(noopWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; [api noopWithError:&error]; @@ -2723,39 +3505,54 @@ void SetUpFLTHostTrivialApiWithSuffix(id binaryMessenger } } } -void SetUpFLTHostSmallApi(id binaryMessenger, NSObject *api) { +void SetUpFLTHostSmallApi(id binaryMessenger, + NSObject *api) { SetUpFLTHostSmallApiWithSuffix(binaryMessenger, api, @""); } -void SetUpFLTHostSmallApiWithSuffix(id binaryMessenger, NSObject *api, NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat: @".%@", messageChannelSuffix] : @""; +void SetUpFLTHostSmallApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoString:completion:)], @"FLTHostSmallApi api (%@) doesn't respond to @selector(echoString:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoString:completion:)], + @"FLTHostSmallApi api (%@) doesn't respond to @selector(echoString:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostSmallApi.voidVoid", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:FLTGetCoreTestsCodec()]; + codec:FLTGetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(voidVoidWithCompletion:)], @"FLTHostSmallApi api (%@) doesn't respond to @selector(voidVoidWithCompletion:)", api); + NSCAssert([api respondsToSelector:@selector(voidVoidWithCompletion:)], + @"FLTHostSmallApi api (%@) doesn't respond to @selector(voidVoidWithCompletion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api voidVoidWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -2776,53 +3573,67 @@ @implementation FLTFlutterSmallApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; } -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger messageChannelSuffix:(nullable NSString*)messageChannelSuffix{ +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix { self = [self init]; if (self) { _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 ? @"" : [NSString stringWithFormat: @".%@", messageChannelSuffix]; + _messageChannelSuffix = [messageChannelSuffix length] == 0 + ? @"" + : [NSString stringWithFormat:@".%@", messageChannelSuffix]; } return self; } -- (void)echoWrappedList:(FLTTestMessage *)arg_msg completion:(void (^)(FLTTestMessage *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList", _messageChannelSuffix]; +- (void)echoWrappedList:(FLTTestMessage *)arg_msg + completion:(void (^)(FLTTestMessage *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_msg ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - FLTTestMessage *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_msg ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FLTTestMessage *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoString:(NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } @end - diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h index 154e7844969e..f2b2c0747555 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h @@ -38,88 +38,90 @@ typedef NS_ENUM(NSUInteger, AnEnum) { @interface AllTypes : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithABool:(BOOL )aBool - anInt:(NSInteger )anInt - anInt64:(NSInteger )anInt64 - aDouble:(double )aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - anEnum:(AnEnum)anEnum - aString:(NSString *)aString - anObject:(id )anObject - list:(NSArray *)list - stringList:(NSArray *)stringList - intList:(NSArray *)intList - doubleList:(NSArray *)doubleList - boolList:(NSArray *)boolList - map:(NSDictionary *)map; -@property(nonatomic, assign) BOOL aBool; -@property(nonatomic, assign) NSInteger anInt; -@property(nonatomic, assign) NSInteger anInt64; -@property(nonatomic, assign) double aDouble; -@property(nonatomic, strong) FlutterStandardTypedData * aByteArray; -@property(nonatomic, strong) FlutterStandardTypedData * a4ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData * a8ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData * aFloatArray; ++ (instancetype)makeWithABool:(BOOL)aBool + anInt:(NSInteger)anInt + anInt64:(NSInteger)anInt64 + aDouble:(double)aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + anEnum:(AnEnum)anEnum + aString:(NSString *)aString + anObject:(id)anObject + list:(NSArray *)list + stringList:(NSArray *)stringList + intList:(NSArray *)intList + doubleList:(NSArray *)doubleList + boolList:(NSArray *)boolList + map:(NSDictionary *)map; +@property(nonatomic, assign) BOOL aBool; +@property(nonatomic, assign) NSInteger anInt; +@property(nonatomic, assign) NSInteger anInt64; +@property(nonatomic, assign) double aDouble; +@property(nonatomic, strong) FlutterStandardTypedData *aByteArray; +@property(nonatomic, strong) FlutterStandardTypedData *a4ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData *a8ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData *aFloatArray; @property(nonatomic, assign) AnEnum anEnum; -@property(nonatomic, copy) NSString * aString; -@property(nonatomic, strong) id anObject; -@property(nonatomic, copy) NSArray * list; -@property(nonatomic, copy) NSArray * stringList; -@property(nonatomic, copy) NSArray * intList; -@property(nonatomic, copy) NSArray * doubleList; -@property(nonatomic, copy) NSArray * boolList; -@property(nonatomic, copy) NSDictionary * map; +@property(nonatomic, copy) NSString *aString; +@property(nonatomic, strong) id anObject; +@property(nonatomic, copy) NSArray *list; +@property(nonatomic, copy) NSArray *stringList; +@property(nonatomic, copy) NSArray *intList; +@property(nonatomic, copy) NSArray *doubleList; +@property(nonatomic, copy) NSArray *boolList; +@property(nonatomic, copy) NSDictionary *map; @end /// A class containing all supported nullable types. @interface AllNullableTypes : NSObject + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable AnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id )aNullableObject - allNullableTypes:(nullable AllNullableTypes *)allNullableTypes - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - nestedClassList:(nullable NSArray *)nestedClassList - map:(nullable NSDictionary *)map; -@property(nonatomic, strong, nullable) NSNumber * aNullableBool; -@property(nonatomic, strong, nullable) NSNumber * aNullableInt; -@property(nonatomic, strong, nullable) NSNumber * aNullableInt64; -@property(nonatomic, strong, nullable) NSNumber * aNullableDouble; -@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable4ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable8ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *> * nullableNestedList; -@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithObject; -@property(nonatomic, strong, nullable) AnEnumBox * aNullableEnum; -@property(nonatomic, copy, nullable) NSString * aNullableString; -@property(nonatomic, strong, nullable) id aNullableObject; -@property(nonatomic, strong, nullable) AllNullableTypes * allNullableTypes; -@property(nonatomic, copy, nullable) NSArray * list; -@property(nonatomic, copy, nullable) NSArray * stringList; -@property(nonatomic, copy, nullable) NSArray * intList; -@property(nonatomic, copy, nullable) NSArray * doubleList; -@property(nonatomic, copy, nullable) NSArray * boolList; -@property(nonatomic, copy, nullable) NSArray * nestedClassList; -@property(nonatomic, copy, nullable) NSDictionary * map; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations: + (nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable AnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + allNullableTypes:(nullable AllNullableTypes *)allNullableTypes + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + nestedClassList:(nullable NSArray *)nestedClassList + map:(nullable NSDictionary *)map; +@property(nonatomic, strong, nullable) NSNumber *aNullableBool; +@property(nonatomic, strong, nullable) NSNumber *aNullableInt; +@property(nonatomic, strong, nullable) NSNumber *aNullableInt64; +@property(nonatomic, strong, nullable) NSNumber *aNullableDouble; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; +@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; +@property(nonatomic, copy, nullable) + NSDictionary *nullableMapWithAnnotations; +@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; +@property(nonatomic, strong, nullable) AnEnumBox *aNullableEnum; +@property(nonatomic, copy, nullable) NSString *aNullableString; +@property(nonatomic, strong, nullable) id aNullableObject; +@property(nonatomic, strong, nullable) AllNullableTypes *allNullableTypes; +@property(nonatomic, copy, nullable) NSArray *list; +@property(nonatomic, copy, nullable) NSArray *stringList; +@property(nonatomic, copy, nullable) NSArray *intList; +@property(nonatomic, copy, nullable) NSArray *doubleList; +@property(nonatomic, copy, nullable) NSArray *boolList; +@property(nonatomic, copy, nullable) NSArray *nestedClassList; +@property(nonatomic, copy, nullable) NSDictionary *map; @end /// The primary purpose for this class is to ensure coverage of Swift structs @@ -127,45 +129,47 @@ typedef NS_ENUM(NSUInteger, AnEnum) { /// test Swift classes. @interface AllNullableTypesWithoutRecursion : NSObject + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable AnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id )aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - map:(nullable NSDictionary *)map; -@property(nonatomic, strong, nullable) NSNumber * aNullableBool; -@property(nonatomic, strong, nullable) NSNumber * aNullableInt; -@property(nonatomic, strong, nullable) NSNumber * aNullableInt64; -@property(nonatomic, strong, nullable) NSNumber * aNullableDouble; -@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable4ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullable8ByteArray; -@property(nonatomic, strong, nullable) FlutterStandardTypedData * aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *> * nullableNestedList; -@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary * nullableMapWithObject; -@property(nonatomic, strong, nullable) AnEnumBox * aNullableEnum; -@property(nonatomic, copy, nullable) NSString * aNullableString; -@property(nonatomic, strong, nullable) id aNullableObject; -@property(nonatomic, copy, nullable) NSArray * list; -@property(nonatomic, copy, nullable) NSArray * stringList; -@property(nonatomic, copy, nullable) NSArray * intList; -@property(nonatomic, copy, nullable) NSArray * doubleList; -@property(nonatomic, copy, nullable) NSArray * boolList; -@property(nonatomic, copy, nullable) NSDictionary * map; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations: + (nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable AnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + map:(nullable NSDictionary *)map; +@property(nonatomic, strong, nullable) NSNumber *aNullableBool; +@property(nonatomic, strong, nullable) NSNumber *aNullableInt; +@property(nonatomic, strong, nullable) NSNumber *aNullableInt64; +@property(nonatomic, strong, nullable) NSNumber *aNullableDouble; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; +@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; +@property(nonatomic, copy, nullable) + NSDictionary *nullableMapWithAnnotations; +@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; +@property(nonatomic, strong, nullable) AnEnumBox *aNullableEnum; +@property(nonatomic, copy, nullable) NSString *aNullableString; +@property(nonatomic, strong, nullable) id aNullableObject; +@property(nonatomic, copy, nullable) NSArray *list; +@property(nonatomic, copy, nullable) NSArray *stringList; +@property(nonatomic, copy, nullable) NSArray *intList; +@property(nonatomic, copy, nullable) NSArray *doubleList; +@property(nonatomic, copy, nullable) NSArray *boolList; +@property(nonatomic, copy, nullable) NSDictionary *map; @end /// A class for testing nested class handling. @@ -177,17 +181,19 @@ typedef NS_ENUM(NSUInteger, AnEnum) { /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithAllNullableTypes:(AllNullableTypes *)allNullableTypes - allNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion - allTypes:(nullable AllTypes *)allTypes; -@property(nonatomic, strong) AllNullableTypes * allNullableTypes; -@property(nonatomic, strong, nullable) AllNullableTypesWithoutRecursion * allNullableTypesWithoutRecursion; -@property(nonatomic, strong, nullable) AllTypes * allTypes; + allNullableTypesWithoutRecursion: + (nullable AllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion + allTypes:(nullable AllTypes *)allTypes; +@property(nonatomic, strong) AllNullableTypes *allNullableTypes; +@property(nonatomic, strong, nullable) + AllNullableTypesWithoutRecursion *allNullableTypesWithoutRecursion; +@property(nonatomic, strong, nullable) AllTypes *allTypes; @end /// A data class containing a List, used in unit tests. @interface TestMessage : NSObject + (instancetype)makeWithTestList:(nullable NSArray *)testList; -@property(nonatomic, copy, nullable) NSArray * testList; +@property(nonatomic, copy, nullable) NSArray *testList; @end /// The codec used by all APIs. @@ -202,7 +208,8 @@ NSObject *GetCoreTestsCodec(void); /// Returns the passed object, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable AllTypes *)echoAllTypes:(AllTypes *)everything error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllTypes *)echoAllTypes:(AllTypes *)everything + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns an error, to test error handling. - (nullable id)throwErrorWithError:(FlutterError *_Nullable *_Nonnull)error; /// Returns an error from a void function, to test error handling. @@ -224,11 +231,13 @@ NSObject *GetCoreTestsCodec(void); /// Returns the passed in string. /// /// @return `nil` only when `error != nil`. -- (nullable NSString *)echoString:(NSString *)aString error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoString:(NSString *)aString + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in Uint8List. /// /// @return `nil` only when `error != nil`. -- (nullable FlutterStandardTypedData *)echoUint8List:(FlutterStandardTypedData *)aUint8List error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FlutterStandardTypedData *)echoUint8List:(FlutterStandardTypedData *)aUint8List + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in generic Object. /// /// @return `nil` only when `error != nil`. @@ -236,15 +245,18 @@ NSObject *GetCoreTestsCodec(void); /// Returns the passed list, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable NSArray *)echoList:(NSArray *)list error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSArray *)echoList:(NSArray *)list + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed map, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed map to test nested class serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable AllClassesWrapper *)echoClassWrapper:(AllClassesWrapper *)wrapper error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllClassesWrapper *)echoClassWrapper:(AllClassesWrapper *)wrapper + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed enum to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. @@ -252,144 +264,257 @@ NSObject *GetCoreTestsCodec(void); /// Returns the default string. /// /// @return `nil` only when `error != nil`. -- (nullable NSString *)echoNamedDefaultString:(NSString *)aString error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNamedDefaultString:(NSString *)aString + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in double. /// /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoOptionalDefaultDouble:(double)aDouble error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoOptionalDefaultDouble:(double)aDouble + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. /// /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoRequiredInt:(NSInteger)anInt error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoRequiredInt:(NSInteger)anInt + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed object, to test serialization and deserialization. -- (nullable AllNullableTypes *)echoAllNullableTypes:(nullable AllNullableTypes *)everything error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllNullableTypes *)echoAllNullableTypes:(nullable AllNullableTypes *)everything + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed object, to test serialization and deserialization. -- (nullable AllNullableTypesWithoutRecursion *)echoAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)everything error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllNullableTypesWithoutRecursion *) + echoAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)everything + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. -- (nullable NSString *)extractNestedNullableStringFrom:(AllClassesWrapper *)wrapper error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)extractNestedNullableStringFrom:(AllClassesWrapper *)wrapper + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. /// /// @return `nil` only when `error != nil`. -- (nullable AllClassesWrapper *)createNestedObjectWithNullableString:(nullable NSString *)nullableString error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllClassesWrapper *) + createNestedObjectWithNullableString:(nullable NSString *)nullableString + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in arguments of multiple types. /// /// @return `nil` only when `error != nil`. -- (nullable AllNullableTypes *)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllNullableTypes *)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + error:(FlutterError *_Nullable *_Nonnull) + error; /// Returns passed in arguments of multiple types. /// /// @return `nil` only when `error != nil`. -- (nullable AllNullableTypesWithoutRecursion *)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllNullableTypesWithoutRecursion *) + sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. -- (nullable NSNumber *)echoNullableInt:(nullable NSNumber *)aNullableInt error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableInt:(nullable NSNumber *)aNullableInt + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in double. -- (nullable NSNumber *)echoNullableDouble:(nullable NSNumber *)aNullableDouble error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableDouble:(nullable NSNumber *)aNullableDouble + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in boolean. -- (nullable NSNumber *)echoNullableBool:(nullable NSNumber *)aNullableBool error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoNullableBool:(nullable NSNumber *)aNullableBool + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in string. -- (nullable NSString *)echoNullableString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNullableString:(nullable NSString *)aNullableString + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in Uint8List. -- (nullable FlutterStandardTypedData *)echoNullableUint8List:(nullable FlutterStandardTypedData *)aNullableUint8List error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable FlutterStandardTypedData *) + echoNullableUint8List:(nullable FlutterStandardTypedData *)aNullableUint8List + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in generic Object. -- (nullable id)echoNullableObject:(nullable id)aNullableObject error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable id)echoNullableObject:(nullable id)aNullableObject + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed list, to test serialization and deserialization. -- (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)aNullableMap error:(FlutterError *_Nullable *_Nonnull)error; -- (AnEnumBox *_Nullable)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSDictionary *)echoNullableMap: + (nullable NSDictionary *)aNullableMap + error:(FlutterError *_Nullable *_Nonnull)error; +- (AnEnumBox *_Nullable)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns passed in int. -- (nullable NSNumber *)echoOptionalNullableInt:(nullable NSNumber *)aNullableInt error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoOptionalNullableInt:(nullable NSNumber *)aNullableInt + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in string. -- (nullable NSString *)echoNamedNullableString:(nullable NSString *)aNullableString error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)echoNamedNullableString:(nullable NSString *)aNullableString + error:(FlutterError *_Nullable *_Nonnull)error; /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Returns passed in int asynchronously. -- (void)echoAsyncInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncInt:(NSInteger)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in double asynchronously. -- (void)echoAsyncDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncDouble:(double)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in boolean asynchronously. -- (void)echoAsyncBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncBool:(BOOL)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string asynchronously. -- (void)echoAsyncString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in Uint8List asynchronously. -- (void)echoAsyncUint8List:(FlutterStandardTypedData *)aUint8List completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncUint8List:(FlutterStandardTypedData *)aUint8List + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed in generic Object asynchronously. -- (void)echoAsyncObject:(id)anObject completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncObject:(id)anObject + completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncList:(NSArray *)list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncMap:(NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAsyncEnum:(AnEnum)anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncEnum:(AnEnum)anEnum + completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// Responds with an error from an async function returning a value. - (void)throwAsyncErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Responds with an error from an async void function. - (void)throwAsyncErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Responds with a Flutter error from an async function returning a value. -- (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +- (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, + FlutterError *_Nullable))completion; /// Returns the passed object, to test async serialization and deserialization. -- (void)echoAsyncAllTypes:(AllTypes *)everything completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncAllTypes:(AllTypes *)everything + completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAsyncNullableAllNullableTypes:(nullable AllNullableTypes *)everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableAllNullableTypes:(nullable AllNullableTypes *)everything + completion:(void (^)(AllNullableTypes *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAsyncNullableAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)everything completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableAllNullableTypesWithoutRecursion: + (nullable AllNullableTypesWithoutRecursion *)everything + completion: + (void (^)( + AllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion; /// Returns passed in int asynchronously. -- (void)echoAsyncNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableInt:(nullable NSNumber *)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in double asynchronously. -- (void)echoAsyncNullableDouble:(nullable NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableDouble:(nullable NSNumber *)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in boolean asynchronously. -- (void)echoAsyncNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableBool:(nullable NSNumber *)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string asynchronously. -- (void)echoAsyncNullableString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableString:(nullable NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in Uint8List asynchronously. -- (void)echoAsyncNullableUint8List:(nullable FlutterStandardTypedData *)aUint8List completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableUint8List:(nullable FlutterStandardTypedData *)aUint8List + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed in generic Object asynchronously. -- (void)echoAsyncNullableObject:(nullable id)anObject completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableObject:(nullable id)anObject + completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableList:(nullable NSArray *)list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableEnum:(nullable AnEnumBox *)anEnumBoxed completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableEnum:(nullable AnEnumBox *)anEnumBoxed + completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; - (void)callFlutterNoopWithCompletion:(void (^)(FlutterError *_Nullable))completion; -- (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, + FlutterError *_Nullable))completion; - (void)callFlutterThrowErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllTypes:(AllTypes *)everything completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllNullableTypes:(nullable AllNullableTypes *)everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)everything completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterSendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoEnum:(AnEnum)anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableDouble:(nullable NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableUint8List:(nullable FlutterStandardTypedData *)list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableEnum:(nullable AnEnumBox *)anEnumBoxed completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterSmallApiEchoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllTypes:(AllTypes *)everything + completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllNullableTypes:(nullable AllNullableTypes *)everything + completion:(void (^)(AllNullableTypes *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + completion:(void (^)(AllNullableTypes *_Nullable, + FlutterError *_Nullable))completion; +- (void) + callFlutterEchoAllNullableTypesWithoutRecursion: + (nullable AllNullableTypesWithoutRecursion *)everything + completion: + (void (^)(AllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion; +- (void) + callFlutterSendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + completion: + (void (^)(AllNullableTypesWithoutRecursion + *_Nullable, + FlutterError *_Nullable)) + completion; +- (void)callFlutterEchoBool:(BOOL)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoInt:(NSInteger)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoDouble:(double)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)list + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoList:(NSArray *)list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoMap:(NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoEnum:(AnEnum)anEnum + completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool + completion: + (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableInt:(nullable NSNumber *)anInt + completion: + (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableDouble:(nullable NSNumber *)aDouble + completion: + (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableString:(nullable NSString *)aString + completion: + (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableUint8List:(nullable FlutterStandardTypedData *)list + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableList:(nullable NSArray *)list + completion: + (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableEnum:(nullable AnEnumBox *)anEnumBoxed + completion: + (void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterSmallApiEchoString:(NSString *)aString + completion: + (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end -extern void SetUpHostIntegrationCoreApi(id binaryMessenger, NSObject *_Nullable api); - -extern void SetUpHostIntegrationCoreApiWithSuffix(id binaryMessenger, NSObject *_Nullable api, NSString *messageChannelSuffix); +extern void SetUpHostIntegrationCoreApi(id binaryMessenger, + NSObject *_Nullable api); +extern void SetUpHostIntegrationCoreApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); /// The core interface that the Dart platform_test code implements for host /// integration tests to call into. @interface FlutterIntegrationCoreApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger messageChannelSuffix:(nullable NSString *)messageChannelSuffix; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix; /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. - (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion; @@ -398,86 +523,129 @@ extern void SetUpHostIntegrationCoreApiWithSuffix(id bin /// Responds with an error from an async void function. - (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAllTypes:(AllTypes *)everything completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAllTypes:(AllTypes *)everything + completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAllNullableTypes:(nullable AllNullableTypes *)everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAllNullableTypes:(nullable AllNullableTypes *)everything + completion: + (void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + completion:(void (^)(AllNullableTypes *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed object, to test serialization and deserialization. -- (void)echoAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)everything completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)everything + completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion; /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. -- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion; +- (void) + sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + completion: + (void (^)(AllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed boolean, to test serialization and deserialization. -- (void)echoBool:(BOOL)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoBool:(BOOL)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed int, to test serialization and deserialization. -- (void)echoInt:(NSInteger)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoInt:(NSInteger)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed double, to test serialization and deserialization. -- (void)echoDouble:(double)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoDouble:(double)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string, to test serialization and deserialization. -- (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed byte list, to test serialization and deserialization. -- (void)echoUint8List:(FlutterStandardTypedData *)list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)echoUint8List:(FlutterStandardTypedData *)list + completion: + (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test serialization and deserialization. -- (void)echoList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoList:(NSArray *)list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization. -- (void)echoMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)echoMap:(NSDictionary *)aMap + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. -- (void)echoEnum:(AnEnum)anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoEnum:(AnEnum)anEnum + completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed boolean, to test serialization and deserialization. -- (void)echoNullableBool:(nullable NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableBool:(nullable NSNumber *)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed int, to test serialization and deserialization. -- (void)echoNullableInt:(nullable NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableInt:(nullable NSNumber *)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed double, to test serialization and deserialization. -- (void)echoNullableDouble:(nullable NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableDouble:(nullable NSNumber *)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed string, to test serialization and deserialization. -- (void)echoNullableString:(nullable NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableString:(nullable NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed byte list, to test serialization and deserialization. -- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)list + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed list, to test serialization and deserialization. -- (void)echoNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableList:(nullable NSArray *)list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableMap:(nullable NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. -- (void)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed + completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion; /// Returns the passed in generic Object asynchronously. -- (void)echoAsyncString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end - /// An API that can be implemented for minimal, compile-only tests. @protocol HostTrivialApi - (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error; @end -extern void SetUpHostTrivialApi(id binaryMessenger, NSObject *_Nullable api); - -extern void SetUpHostTrivialApiWithSuffix(id binaryMessenger, NSObject *_Nullable api, NSString *messageChannelSuffix); +extern void SetUpHostTrivialApi(id binaryMessenger, + NSObject *_Nullable api); +extern void SetUpHostTrivialApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); /// A simple API implemented in some unit tests. @protocol HostSmallApi -- (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)echoString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; - (void)voidVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; @end -extern void SetUpHostSmallApi(id binaryMessenger, NSObject *_Nullable api); - -extern void SetUpHostSmallApiWithSuffix(id binaryMessenger, NSObject *_Nullable api, NSString *messageChannelSuffix); +extern void SetUpHostSmallApi(id binaryMessenger, + NSObject *_Nullable api); +extern void SetUpHostSmallApiWithSuffix(id binaryMessenger, + NSObject *_Nullable api, + NSString *messageChannelSuffix); /// A simple API called in some unit tests. @interface FlutterSmallApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -- (void)echoWrappedList:(TestMessage *)msg completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion; -- (void)echoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix; +- (void)echoWrappedList:(TestMessage *)msg + completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion; +- (void)echoString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; @end NS_ASSUME_NONNULL_END diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m index de96e96d4a82..be3810ceae8d 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m @@ -27,7 +27,12 @@ } static FlutterError *createConnectionError(NSString *channelName) { - return [FlutterError errorWithCode:@"channel-error" message:[NSString stringWithFormat:@"%@/%@/%@", @"Unable to establish connection on channel: '", channelName, @"'."] details:@""]; + return [FlutterError + errorWithCode:@"channel-error" + message:[NSString stringWithFormat:@"%@/%@/%@", + @"Unable to establish connection on channel: '", + channelName, @"'."] + details:@""]; } static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { @@ -76,24 +81,24 @@ + (nullable TestMessage *)nullableFromList:(NSArray *)list; @end @implementation AllTypes -+ (instancetype)makeWithABool:(BOOL )aBool - anInt:(NSInteger )anInt - anInt64:(NSInteger )anInt64 - aDouble:(double )aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - anEnum:(AnEnum)anEnum - aString:(NSString *)aString - anObject:(id )anObject - list:(NSArray *)list - stringList:(NSArray *)stringList - intList:(NSArray *)intList - doubleList:(NSArray *)doubleList - boolList:(NSArray *)boolList - map:(NSDictionary *)map { - AllTypes* pigeonResult = [[AllTypes alloc] init]; ++ (instancetype)makeWithABool:(BOOL)aBool + anInt:(NSInteger)anInt + anInt64:(NSInteger)anInt64 + aDouble:(double)aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + anEnum:(AnEnum)anEnum + aString:(NSString *)aString + anObject:(id)anObject + list:(NSArray *)list + stringList:(NSArray *)stringList + intList:(NSArray *)intList + doubleList:(NSArray *)doubleList + boolList:(NSArray *)boolList + map:(NSDictionary *)map { + AllTypes *pigeonResult = [[AllTypes alloc] init]; pigeonResult.aBool = aBool; pigeonResult.anInt = anInt; pigeonResult.anInt64 = anInt64; @@ -163,28 +168,29 @@ + (nullable AllTypes *)nullableFromList:(NSArray *)list { @implementation AllNullableTypes + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable AnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id )aNullableObject - allNullableTypes:(nullable AllNullableTypes *)allNullableTypes - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - nestedClassList:(nullable NSArray *)nestedClassList - map:(nullable NSDictionary *)map { - AllNullableTypes* pigeonResult = [[AllNullableTypes alloc] init]; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations: + (nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable AnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + allNullableTypes:(nullable AllNullableTypes *)allNullableTypes + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + nestedClassList:(nullable NSArray *)nestedClassList + map:(nullable NSDictionary *)map { + AllNullableTypes *pigeonResult = [[AllNullableTypes alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; pigeonResult.aNullableInt64 = aNullableInt64; @@ -268,26 +274,27 @@ + (nullable AllNullableTypes *)nullableFromList:(NSArray *)list { @implementation AllNullableTypesWithoutRecursion + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(nullable AnEnumBox *)aNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id )aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - map:(nullable NSDictionary *)map { - AllNullableTypesWithoutRecursion* pigeonResult = [[AllNullableTypesWithoutRecursion alloc] init]; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations: + (nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(nullable AnEnumBox *)aNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + map:(nullable NSDictionary *)map { + AllNullableTypesWithoutRecursion *pigeonResult = [[AllNullableTypesWithoutRecursion alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; pigeonResult.aNullableInt64 = aNullableInt64; @@ -365,9 +372,10 @@ + (nullable AllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)l @implementation AllClassesWrapper + (instancetype)makeWithAllNullableTypes:(AllNullableTypes *)allNullableTypes - allNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion - allTypes:(nullable AllTypes *)allTypes { - AllClassesWrapper* pigeonResult = [[AllClassesWrapper alloc] init]; + allNullableTypesWithoutRecursion: + (nullable AllNullableTypesWithoutRecursion *)allNullableTypesWithoutRecursion + allTypes:(nullable AllTypes *)allTypes { + AllClassesWrapper *pigeonResult = [[AllClassesWrapper alloc] init]; pigeonResult.allNullableTypes = allNullableTypes; pigeonResult.allNullableTypesWithoutRecursion = allNullableTypesWithoutRecursion; pigeonResult.allTypes = allTypes; @@ -394,7 +402,7 @@ + (nullable AllClassesWrapper *)nullableFromList:(NSArray *)list { @implementation TestMessage + (instancetype)makeWithTestList:(nullable NSArray *)testList { - TestMessage* pigeonResult = [[TestMessage alloc] init]; + TestMessage *pigeonResult = [[TestMessage alloc] init]; pigeonResult.testList = testList; return pigeonResult; } @@ -418,21 +426,21 @@ @interface CoreTestsPigeonCodecReader : FlutterStandardReader @implementation CoreTestsPigeonCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 129: + case 129: return [AllTypes fromList:[self readValue]]; - case 130: + case 130: return [AllNullableTypes fromList:[self readValue]]; - case 131: + case 131: return [AllNullableTypesWithoutRecursion fromList:[self readValue]]; - case 132: + case 132: return [AllClassesWrapper fromList:[self readValue]]; - case 133: + case 133: return [TestMessage fromList:[self readValue]]; - case 134: - { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil ? nil : [[AnEnumBox alloc] initWithValue:[enumAsNumber integerValue]]; - } + case 134: { + NSNumber *enumAsNumber = [self readValue]; + return enumAsNumber == nil ? nil + : [[AnEnumBox alloc] initWithValue:[enumAsNumber integerValue]]; + } default: return [super readValueOfType:type]; } @@ -459,7 +467,7 @@ - (void)writeValue:(id)value { [self writeByte:133]; [self writeValue:[value toList]]; } else if ([value isKindOfClass:[AnEnumBox class]]) { - AnEnumBox * box = (AnEnumBox *)value; + AnEnumBox *box = (AnEnumBox *)value; [self writeByte:134]; [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; } else { @@ -483,27 +491,37 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - CoreTestsPigeonCodecReaderWriter *readerWriter = [[CoreTestsPigeonCodecReaderWriter alloc] init]; + CoreTestsPigeonCodecReaderWriter *readerWriter = + [[CoreTestsPigeonCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } -void SetUpHostIntegrationCoreApi(id binaryMessenger, NSObject *api) { +void SetUpHostIntegrationCoreApi(id binaryMessenger, + NSObject *api) { SetUpHostIntegrationCoreApiWithSuffix(binaryMessenger, api, @""); } -void SetUpHostIntegrationCoreApiWithSuffix(id binaryMessenger, NSObject *api, NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat: @".%@", messageChannelSuffix] : @""; +void SetUpHostIntegrationCoreApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.noop", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(noopWithError:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(noopWithError:)", api); + NSCAssert([api respondsToSelector:@selector(noopWithError:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(noopWithError:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; [api noopWithError:&error]; @@ -515,13 +533,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAllTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAllTypes:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllTypes:error:)", api); + NSCAssert( + [api respondsToSelector:@selector(echoAllTypes:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllTypes:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); @@ -535,13 +558,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns an error, to test error handling. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.throwError", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwErrorWithError:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwErrorWithError:)", api); + NSCAssert( + [api respondsToSelector:@selector(throwErrorWithError:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwErrorWithError:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; id output = [api throwErrorWithError:&error]; @@ -553,13 +581,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns an error from a void function, to test error handling. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.throwErrorFromVoid", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwErrorFromVoidWithError:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwErrorFromVoidWithError:)", api); + NSCAssert([api respondsToSelector:@selector(throwErrorFromVoidWithError:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwErrorFromVoidWithError:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; [api throwErrorFromVoidWithError:&error]; @@ -571,13 +604,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns a Flutter error, to test error handling. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.throwFlutterError", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwFlutterErrorWithError:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwFlutterErrorWithError:)", api); + NSCAssert([api respondsToSelector:@selector(throwFlutterErrorWithError:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwFlutterErrorWithError:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; id output = [api throwFlutterErrorWithError:&error]; @@ -589,13 +627,17 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoInt:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoInt:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoInt:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoInt:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; @@ -609,13 +651,17 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoDouble:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoDouble:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoDouble:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoDouble:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; @@ -629,13 +675,17 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in boolean. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoBool", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoBool:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoBool:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoBool:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoBool:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; @@ -649,13 +699,17 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoString:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoString:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoString:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); @@ -669,13 +723,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in Uint8List. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoUint8List", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoUint8List:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoUint8List:error:)", api); + NSCAssert( + [api respondsToSelector:@selector(echoUint8List:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoUint8List:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); @@ -689,13 +748,17 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in generic Object. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoObject", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoObject:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoObject:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoObject:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoObject:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_anObject = GetNullableObjectAtIndex(args, 0); @@ -709,13 +772,17 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed list, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoList:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoList:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoList:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoList:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); @@ -729,13 +796,17 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed map, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoMap:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoMap:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoMap:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoMap:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); @@ -749,13 +820,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed map to test nested class serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoClassWrapper", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoClassWrapper:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassWrapper:error:)", api); + NSCAssert( + [api respondsToSelector:@selector(echoClassWrapper:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoClassWrapper:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); @@ -769,19 +845,23 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed enum to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoEnum", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoEnum:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoEnum:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnumBox *enumBox = GetNullableObjectAtIndex(args, 0); AnEnum arg_anEnum = enumBox.value; FlutterError *error; - AnEnumBox * output = [api echoEnum:arg_anEnum error:&error]; + AnEnumBox *output = [api echoEnum:arg_anEnum error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -790,13 +870,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the default string. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNamedDefaultString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNamedDefaultString:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNamedDefaultString:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNamedDefaultString:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); @@ -810,13 +895,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoOptionalDefaultDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoOptionalDefaultDouble:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoOptionalDefaultDouble:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoOptionalDefaultDouble:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; @@ -830,13 +921,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoRequiredInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoRequiredInt:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoRequiredInt:error:)", api); + NSCAssert( + [api respondsToSelector:@selector(echoRequiredInt:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoRequiredInt:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; @@ -850,13 +946,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAllNullableTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAllNullableTypes:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllNullableTypes:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoAllNullableTypes:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAllNullableTypes:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); @@ -870,18 +971,26 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAllNullableTypesWithoutRecursion:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllNullableTypesWithoutRecursion:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoAllNullableTypesWithoutRecursion:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAllNullableTypesWithoutRecursion:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); FlutterError *error; - AllNullableTypesWithoutRecursion *output = [api echoAllNullableTypesWithoutRecursion:arg_everything error:&error]; + AllNullableTypesWithoutRecursion *output = + [api echoAllNullableTypesWithoutRecursion:arg_everything error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -891,13 +1000,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.extractNestedNullableString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(extractNestedNullableStringFrom:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(extractNestedNullableStringFrom:error:)", api); + NSCAssert([api respondsToSelector:@selector(extractNestedNullableStringFrom:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(extractNestedNullableStringFrom:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllClassesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); @@ -912,18 +1027,25 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.createNestedNullableString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(createNestedObjectWithNullableString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(createNestedObjectWithNullableString:error:)", api); + NSCAssert([api respondsToSelector:@selector(createNestedObjectWithNullableString:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(createNestedObjectWithNullableString:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_nullableString = GetNullableObjectAtIndex(args, 0); FlutterError *error; - AllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString error:&error]; + AllClassesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString + error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -932,20 +1054,30 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in arguments of multiple types. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.sendMultipleNullableTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesABool:anInt:aString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(sendMultipleNullableTypesABool:anInt:aString:error:)", api); + NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesABool: + anInt:aString:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(sendMultipleNullableTypesABool:anInt:aString:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); FlutterError *error; - AllNullableTypes *output = [api sendMultipleNullableTypesABool:arg_aNullableBool anInt:arg_aNullableInt aString:arg_aNullableString error:&error]; + AllNullableTypes *output = [api sendMultipleNullableTypesABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -954,20 +1086,32 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in arguments of multiple types. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)", api); + NSCAssert([api respondsToSelector:@selector + (sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(sendMultipleNullableTypesWithoutRecursionABool:anInt:aString:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); FlutterError *error; - AllNullableTypesWithoutRecursion *output = [api sendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool anInt:arg_aNullableInt aString:arg_aNullableString error:&error]; + AllNullableTypesWithoutRecursion *output = + [api sendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -976,13 +1120,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableInt:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableInt:error:)", api); + NSCAssert( + [api respondsToSelector:@selector(echoNullableInt:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableInt:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); @@ -996,13 +1145,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableDouble:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableDouble:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNullableDouble:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableDouble:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableDouble = GetNullableObjectAtIndex(args, 0); @@ -1016,13 +1170,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in boolean. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableBool", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableBool:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableBool:error:)", api); + NSCAssert( + [api respondsToSelector:@selector(echoNullableBool:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableBool:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); @@ -1036,13 +1195,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableString:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNullableString:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableString:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); @@ -1056,18 +1220,24 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in Uint8List. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableUint8List", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableUint8List:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableUint8List:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNullableUint8List:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableUint8List:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_aNullableUint8List = GetNullableObjectAtIndex(args, 0); FlutterError *error; - FlutterStandardTypedData *output = [api echoNullableUint8List:arg_aNullableUint8List error:&error]; + FlutterStandardTypedData *output = [api echoNullableUint8List:arg_aNullableUint8List + error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1076,13 +1246,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in generic Object. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableObject", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableObject:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableObject:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNullableObject:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableObject:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_aNullableObject = GetNullableObjectAtIndex(args, 0); @@ -1096,13 +1271,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed list, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableList:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableList:error:)", api); + NSCAssert( + [api respondsToSelector:@selector(echoNullableList:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableList:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_aNullableList = GetNullableObjectAtIndex(args, 0); @@ -1116,13 +1296,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed map, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableMap:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableMap:error:)", api); + NSCAssert( + [api respondsToSelector:@selector(echoNullableMap:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableMap:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aNullableMap = GetNullableObjectAtIndex(args, 0); @@ -1135,18 +1320,23 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableEnum", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNullableEnum:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableEnum:error:)", api); + NSCAssert( + [api respondsToSelector:@selector(echoNullableEnum:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableEnum:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); FlutterError *error; - AnEnumBox * output = [api echoNullableEnum:arg_anEnum error:&error]; + AnEnumBox *output = [api echoNullableEnum:arg_anEnum error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1155,13 +1345,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoOptionalNullableInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoOptionalNullableInt:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoOptionalNullableInt:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoOptionalNullableInt:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); @@ -1175,13 +1371,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNamedNullableString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNamedNullableString:error:)", api); + NSCAssert([api respondsToSelector:@selector(echoNamedNullableString:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNamedNullableString:error:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); @@ -1196,13 +1398,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.noopAsync", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(noopAsyncWithCompletion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(noopAsyncWithCompletion:)", api); + NSCAssert( + [api respondsToSelector:@selector(noopAsyncWithCompletion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(noopAsyncWithCompletion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api noopAsyncWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -1214,19 +1421,25 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in int asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncInt:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncInt:completion:)", api); + NSCAssert( + [api respondsToSelector:@selector(echoAsyncInt:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncInt:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api echoAsyncInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncInt:arg_anInt + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1234,19 +1447,25 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in double asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncDouble:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncDouble:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncDouble:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncDouble:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api echoAsyncDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1254,19 +1473,25 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in boolean asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncBool", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncBool:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncBool:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncBool:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncBool:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api echoAsyncBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncBool:arg_aBool + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1274,19 +1499,25 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed string asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncString:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncString:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncString:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncString:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoAsyncString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1294,19 +1525,26 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in Uint8List asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncUint8List", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncUint8List:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncUint8List:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncUint8List:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncUint8List:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); - [api echoAsyncUint8List:arg_aUint8List completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncUint8List:arg_aUint8List + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1314,19 +1552,25 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in generic Object asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncObject", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncObject:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncObject:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncObject:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncObject:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_anObject = GetNullableObjectAtIndex(args, 0); - [api echoAsyncObject:arg_anObject completion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncObject:arg_anObject + completion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1334,19 +1578,25 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed list, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncList:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncList:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncList:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncList:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api echoAsyncList:arg_list completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncList:arg_list + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1354,19 +1604,26 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed map, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncMap:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncMap:completion:)", api); + NSCAssert( + [api respondsToSelector:@selector(echoAsyncMap:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncMap:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncMap:arg_aMap completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncMap:arg_aMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1374,20 +1631,26 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed enum, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncEnum", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncEnum:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncEnum:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncEnum:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnumBox *enumBox = GetNullableObjectAtIndex(args, 0); AnEnum arg_anEnum = enumBox.value; - [api echoAsyncEnum:arg_anEnum completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncEnum:arg_anEnum + completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1395,13 +1658,18 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Responds with an error from an async function returning a value. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.throwAsyncError", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncErrorWithCompletion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwAsyncErrorWithCompletion:)", api); + NSCAssert([api respondsToSelector:@selector(throwAsyncErrorWithCompletion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwAsyncErrorWithCompletion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api throwAsyncErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); @@ -1413,13 +1681,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Responds with an error from an async void function. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.throwAsyncErrorFromVoid", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncErrorFromVoidWithCompletion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwAsyncErrorFromVoidWithCompletion:)", api); + NSCAssert([api respondsToSelector:@selector(throwAsyncErrorFromVoidWithCompletion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwAsyncErrorFromVoidWithCompletion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api throwAsyncErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -1431,15 +1705,21 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Responds with a Flutter error from an async function returning a value. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.throwAsyncFlutterError", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwAsyncFlutterErrorWithCompletion:)", api); + NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwAsyncFlutterErrorWithCompletion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { + [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, + FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -1449,19 +1729,25 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed object, to test async serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncAllTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncAllTypes:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncAllTypes:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncAllTypes:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncAllTypes:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncAllTypes:arg_everything completion:^(AllTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncAllTypes:arg_everything + completion:^(AllTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1469,19 +1755,27 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypes:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableAllNullableTypes:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypes:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableAllNullableTypes:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableAllNullableTypes:arg_everything completion:^(AllNullableTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableAllNullableTypes:arg_everything + completion:^(AllNullableTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1489,19 +1783,30 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi." + @"echoAsyncNullableAllNullableTypesWithoutRecursion", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)", api); + NSCAssert([api respondsToSelector:@selector + (echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableAllNullableTypesWithoutRecursion:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableAllNullableTypesWithoutRecursion:arg_everything completion:^(AllNullableTypesWithoutRecursion *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableAllNullableTypesWithoutRecursion:arg_everything + completion:^(AllNullableTypesWithoutRecursion + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1509,19 +1814,25 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in int asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableInt:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableInt:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableInt:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableInt:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableInt:arg_anInt + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1529,19 +1840,26 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns passed in double asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableDouble:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableDouble:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableDouble:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableDouble:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1549,19 +1867,25 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in boolean asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableBool", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableBool:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableBool:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableBool:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableBool:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableBool:arg_aBool + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1569,19 +1893,26 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed string asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableString:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableString:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableString:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableString:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1589,19 +1920,27 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in Uint8List asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableUint8List", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableUint8List:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableUint8List:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableUint8List:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableUint8List:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableUint8List:arg_aUint8List completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableUint8List:arg_aUint8List + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1609,19 +1948,26 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed in generic Object asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableObject", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableObject:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableObject:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableObject:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableObject:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; id arg_anObject = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableObject:arg_anObject completion:^(id _Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableObject:arg_anObject + completion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1629,19 +1975,25 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed list, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableList:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableList:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableList:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableList:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableList:arg_list completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableList:arg_list + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1649,19 +2001,26 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed map, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableMap:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableMap:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableMap:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableMap:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableMap:arg_aMap completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableMap:arg_aMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1669,32 +2028,43 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } /// Returns the passed enum, to test asynchronous serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableEnum", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncNullableEnum:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableEnum:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableEnum:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableEnum:arg_anEnum completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableEnum:arg_anEnum + completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterNoop", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterNoopWithCompletion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterNoopWithCompletion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterNoopWithCompletion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterNoopWithCompletion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api callFlutterNoopWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -1705,15 +2075,21 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterThrowError", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorWithCompletion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterThrowErrorWithCompletion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorWithCompletion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterThrowErrorWithCompletion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - [api callFlutterThrowErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { + [api callFlutterThrowErrorWithCompletion:^(id _Nullable output, + FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -1722,13 +2098,19 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorFromVoidWithCompletion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterThrowErrorFromVoidWithCompletion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorFromVoidWithCompletion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterThrowErrorFromVoidWithCompletion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api callFlutterThrowErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -1739,423 +2121,601 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoAllTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllTypes:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoAllTypes:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllTypes:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAllTypes:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllTypes:arg_everything completion:^(AllTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoAllTypes:arg_everything + completion:^(AllTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoAllNullableTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoAllNullableTypes:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypes:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAllNullableTypes:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllNullableTypes:arg_everything completion:^(AllNullableTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoAllNullableTypes:arg_everything + completion:^(AllNullableTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)", api); + NSCAssert([api respondsToSelector:@selector + (callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); - [api callFlutterSendMultipleNullableTypesABool:arg_aNullableBool anInt:arg_aNullableInt aString:arg_aNullableString completion:^(AllNullableTypes *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterSendMultipleNullableTypesABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + completion:^(AllNullableTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi." + @"callFlutterEchoAllNullableTypesWithoutRecursion", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)", api); + NSCAssert([api respondsToSelector:@selector + (callFlutterEchoAllNullableTypesWithoutRecursion:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAllNullableTypesWithoutRecursion:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AllNullableTypesWithoutRecursion *arg_everything = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoAllNullableTypesWithoutRecursion:arg_everything completion:^(AllNullableTypesWithoutRecursion *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoAllNullableTypesWithoutRecursion:arg_everything + completion:^(AllNullableTypesWithoutRecursion + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + @"callFlutterSendMultipleNullableTypesWithoutRecursion", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:completion:)", api); + NSCAssert( + [api respondsToSelector:@selector + (callFlutterSendMultipleNullableTypesWithoutRecursionABool: + anInt:aString:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterSendMultipleNullableTypesWithoutRecursionABool:anInt:aString:" + @"completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); - [api callFlutterSendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool anInt:arg_aNullableInt aString:arg_aNullableString completion:^(AllNullableTypesWithoutRecursion *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterSendMultipleNullableTypesWithoutRecursionABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + completion:^( + AllNullableTypesWithoutRecursion + *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoBool", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoBool:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoBool:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoBool:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoBool:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; BOOL arg_aBool = [GetNullableObjectAtIndex(args, 0) boolValue]; - [api callFlutterEchoBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoBool:arg_aBool + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoInt:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoInt:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoInt:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoInt:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSInteger arg_anInt = [GetNullableObjectAtIndex(args, 0) integerValue]; - [api callFlutterEchoInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoInt:arg_anInt + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoDouble:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoDouble:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoDouble:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoDouble:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; double arg_aDouble = [GetNullableObjectAtIndex(args, 0) doubleValue]; - [api callFlutterEchoDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoString:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoString:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoString:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoString:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoUint8List", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoUint8List:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoUint8List:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoUint8List:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoUint8List:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoUint8List:arg_list completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoUint8List:arg_list + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoList:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoList:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoList:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoList:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoList:arg_list completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoList:arg_list + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoMap:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoMap:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoMap:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoMap:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoMap:arg_aMap completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoMap:arg_aMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoEnum", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoEnum:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoEnum:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoEnum:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnumBox *enumBox = GetNullableObjectAtIndex(args, 0); AnEnum arg_anEnum = enumBox.value; - [api callFlutterEchoEnum:arg_anEnum completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoEnum:arg_anEnum + completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableBool", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableBool:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableBool:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableBool:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableBool:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableBool:arg_aBool completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableBool:arg_aBool + completion:^(NSNumber *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableInt", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableInt:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableInt:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableInt:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableInt:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableInt:arg_anInt completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableInt:arg_anInt + completion:^(NSNumber *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableDouble", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableDouble:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableDouble:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableDouble:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableDouble:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableDouble:arg_aDouble completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableString:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableString:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableString:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableString:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableString:arg_aString + completion:^(NSString *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableUint8List", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableUint8List:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableUint8List:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableUint8List:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableUint8List:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; FlutterStandardTypedData *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableUint8List:arg_list completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableUint8List:arg_list + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableList", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableList:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableList:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableList:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableList:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSArray *arg_list = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableList:arg_list completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableList:arg_list + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableMap", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableMap:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableMap:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableMap:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableMap:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableMap:arg_aMap completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableMap:arg_aMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableEnum", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterEchoNullableEnum:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableEnum:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableEnum:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; AnEnumBox *arg_anEnum = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableEnum:arg_anEnum completion:^(AnEnumBox *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableEnum:arg_anEnum + completion:^(AnEnumBox *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterSmallApiEchoString", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(callFlutterSmallApiEchoString:completion:)], @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(callFlutterSmallApiEchoString:completion:)", api); + NSCAssert([api respondsToSelector:@selector(callFlutterSmallApiEchoString:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterSmallApiEchoString:completion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api callFlutterSmallApiEchoString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterSmallApiEchoString:arg_aString + completion:^(NSString *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -2172,547 +2732,760 @@ @implementation FlutterIntegrationCoreApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; } -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger messageChannelSuffix:(nullable NSString*)messageChannelSuffix{ +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix { self = [self init]; if (self) { _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 ? @"" : [NSString stringWithFormat: @".%@", messageChannelSuffix]; + _messageChannelSuffix = [messageChannelSuffix length] == 0 + ? @"" + : [NSString stringWithFormat:@".%@", messageChannelSuffix]; } return self; } - (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop", _messageChannelSuffix]; + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:nil reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:nil + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; } - (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError", _messageChannelSuffix]; + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:nil reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - id output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:nil + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + id output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } - (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid", _messageChannelSuffix]; + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.throwErrorFromVoid", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:nil reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)echoAllTypes:(AllTypes *)arg_everything completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:nil + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; +} +- (void)echoAllTypes:(AllTypes *)arg_everything + completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - AllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoAllNullableTypes:(nullable AllNullableTypes *)arg_everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + AllTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoAllNullableTypes:(nullable AllNullableTypes *)arg_everything + completion: + (void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoAllNullableTypes", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool anInt:(nullable NSNumber *)arg_aNullableInt aString:(nullable NSString *)arg_aNullableString completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool + anInt:(nullable NSNumber *)arg_aNullableInt + aString:(nullable NSString *)arg_aNullableString + completion:(void (^)(AllNullableTypes *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.sendMultipleNullableTypes", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], arg_aNullableString ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoAllNullableTypesWithoutRecursion:(nullable AllNullableTypesWithoutRecursion *)arg_everything completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ + arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], + arg_aNullableString ?: [NSNull null] + ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + AllNullableTypes *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoAllNullableTypesWithoutRecursion: + (nullable AllNullableTypesWithoutRecursion *)arg_everything + completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - AllNullableTypesWithoutRecursion *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)arg_aNullableBool anInt:(nullable NSNumber *)arg_aNullableInt aString:(nullable NSString *)arg_aNullableString completion:(void (^)(AllNullableTypesWithoutRecursion *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + AllNullableTypesWithoutRecursion *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void) + sendMultipleNullableTypesWithoutRecursionABool:(nullable NSNumber *)arg_aNullableBool + anInt:(nullable NSNumber *)arg_aNullableInt + aString:(nullable NSString *)arg_aNullableString + completion: + (void (^)(AllNullableTypesWithoutRecursion *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + @"sendMultipleNullableTypesWithoutRecursion", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], arg_aNullableString ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - AllNullableTypesWithoutRecursion *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoBool:(BOOL)arg_aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ + arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], + arg_aNullableString ?: [NSNull null] + ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + AllNullableTypesWithoutRecursion *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoBool:(BOOL)arg_aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[@(arg_aBool)] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoInt:(NSInteger)arg_anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ @(arg_aBool) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoInt:(NSInteger)arg_anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[@(arg_anInt)] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoDouble:(double)arg_aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ @(arg_anInt) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoDouble:(double)arg_aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[@(arg_aDouble)] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ @(arg_aDouble) ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoString:(NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoUint8List:(FlutterStandardTypedData *)arg_list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoUint8List:(FlutterStandardTypedData *)arg_list + completion: + (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_list ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - FlutterStandardTypedData *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoList:(NSArray *)arg_list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_list ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FlutterStandardTypedData *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoList:(NSArray *)arg_list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_list ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoMap:(NSDictionary *)arg_aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_list ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoMap:(NSDictionary *)arg_aMap + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_aMap ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoEnum:(AnEnum)arg_anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoEnum:(AnEnum)arg_anEnum + completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[[[AnEnumBox alloc] initWithValue:arg_anEnum]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - AnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableBool:(nullable NSNumber *)arg_aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ [[AnEnumBox alloc] initWithValue:arg_anEnum] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + AnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableBool:(nullable NSNumber *)arg_aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_aBool ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableInt:(nullable NSNumber *)arg_anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableInt:(nullable NSNumber *)arg_anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_anInt ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableDouble", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_aDouble ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableString:(nullable NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSNumber *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableString:(nullable NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableString", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_list + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableUint8List", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_list ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - FlutterStandardTypedData *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableList:(nullable NSArray *)arg_list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_list ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + FlutterStandardTypedData *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableList:(nullable NSArray *)arg_list + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_list ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_list ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSArray *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_aMap ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoNullableEnum:(nullable AnEnumBox *)arg_anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableEnum:(nullable AnEnumBox *)arg_anEnum + completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_anEnum == nil ? [NSNull null] : arg_anEnum] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - AnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_anEnum == nil ? [NSNull null] : arg_anEnum ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + AnEnumBox *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync", _messageChannelSuffix]; + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:nil reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)echoAsyncString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:nil + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion([FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + completion(nil); + } + } else { + completion(createConnectionError(channelName)); + } + }]; +} +- (void)echoAsyncString:(NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } @end -void SetUpHostTrivialApi(id binaryMessenger, NSObject *api) { +void SetUpHostTrivialApi(id binaryMessenger, + NSObject *api) { SetUpHostTrivialApiWithSuffix(binaryMessenger, api, @""); } -void SetUpHostTrivialApiWithSuffix(id binaryMessenger, NSObject *api, NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat: @".%@", messageChannelSuffix] : @""; +void SetUpHostTrivialApiWithSuffix(id binaryMessenger, + NSObject *api, NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(noopWithError:)], @"HostTrivialApi api (%@) doesn't respond to @selector(noopWithError:)", api); + NSCAssert([api respondsToSelector:@selector(noopWithError:)], + @"HostTrivialApi api (%@) doesn't respond to @selector(noopWithError:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { FlutterError *error; [api noopWithError:&error]; @@ -2727,35 +3500,47 @@ void SetUpHostSmallApi(id binaryMessenger, NSObject binaryMessenger, NSObject *api, NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 ? [NSString stringWithFormat: @".%@", messageChannelSuffix] : @""; +void SetUpHostSmallApiWithSuffix(id binaryMessenger, + NSObject *api, NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(echoString:completion:)], @"HostSmallApi api (%@) doesn't respond to @selector(echoString:completion:)", api); + NSCAssert([api respondsToSelector:@selector(echoString:completion:)], + @"HostSmallApi api (%@) doesn't respond to @selector(echoString:completion:)", api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; NSString *arg_aString = GetNullableObjectAtIndex(args, 0); - [api echoString:arg_aString completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid", messageChannelSuffix] + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostSmallApi.voidVoid", + messageChannelSuffix] binaryMessenger:binaryMessenger - codec:GetCoreTestsCodec()]; + codec:GetCoreTestsCodec()]; if (api) { - NSCAssert([api respondsToSelector:@selector(voidVoidWithCompletion:)], @"HostSmallApi api (%@) doesn't respond to @selector(voidVoidWithCompletion:)", api); + NSCAssert([api respondsToSelector:@selector(voidVoidWithCompletion:)], + @"HostSmallApi api (%@) doesn't respond to @selector(voidVoidWithCompletion:)", + api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [api voidVoidWithCompletion:^(FlutterError *_Nullable error) { callback(wrapResult(nil, error)); @@ -2776,53 +3561,67 @@ @implementation FlutterSmallApi - (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; } -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger messageChannelSuffix:(nullable NSString*)messageChannelSuffix{ +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger + messageChannelSuffix:(nullable NSString *)messageChannelSuffix { self = [self init]; if (self) { _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 ? @"" : [NSString stringWithFormat: @".%@", messageChannelSuffix]; + _messageChannelSuffix = [messageChannelSuffix length] == 0 + ? @"" + : [NSString stringWithFormat:@".%@", messageChannelSuffix]; } return self; } -- (void)echoWrappedList:(TestMessage *)arg_msg completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList", _messageChannelSuffix]; +- (void)echoWrappedList:(TestMessage *)arg_msg + completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_msg ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - TestMessage *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -- (void)echoString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - NSString *channelName = [NSString stringWithFormat:@"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString", _messageChannelSuffix]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_msg ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + TestMessage *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoString:(NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString", + _messageChannelSuffix]; FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:GetCoreTestsCodec()]; - [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] message:reply[1] details:reply[2]]); - } else { - NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSString *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; } @end - diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/background_platform_channels.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/background_platform_channels.gen.dart index ab533554272f..e9e063126c1a 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/background_platform_channels.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/background_platform_channels.gen.dart @@ -19,7 +19,6 @@ PlatformException _createConnectionError(String channelName) { ); } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); } @@ -28,9 +27,11 @@ class BackgroundApi2Host { /// Constructor for [BackgroundApi2Host]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - BackgroundApi2Host({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + BackgroundApi2Host( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -38,8 +39,10 @@ class BackgroundApi2Host { final String __pigeon_messageChannelSuffix; Future add(int x, int y) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.BackgroundApi2Host.add$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.BackgroundApi2Host.add$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart index 74a8f145b2d9..e192a84ceea1 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart @@ -19,7 +19,8 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -249,8 +250,10 @@ class AllNullableTypes { aNullable8ByteArray: result[6] as Int64List?, aNullableFloatArray: result[7] as Float64List?, nullableNestedList: (result[8] as List?)?.cast?>(), - nullableMapWithAnnotations: (result[9] as Map?)?.cast(), - nullableMapWithObject: (result[10] as Map?)?.cast(), + nullableMapWithAnnotations: + (result[9] as Map?)?.cast(), + nullableMapWithObject: + (result[10] as Map?)?.cast(), aNullableEnum: result[11] as AnEnum?, aNullableString: result[12] as String?, aNullableObject: result[13], @@ -260,7 +263,8 @@ class AllNullableTypes { intList: (result[17] as List?)?.cast(), doubleList: (result[18] as List?)?.cast(), boolList: (result[19] as List?)?.cast(), - nestedClassList: (result[20] as List?)?.cast(), + nestedClassList: + (result[20] as List?)?.cast(), map: result[21] as Map?, ); } @@ -370,8 +374,10 @@ class AllNullableTypesWithoutRecursion { aNullable8ByteArray: result[6] as Int64List?, aNullableFloatArray: result[7] as Float64List?, nullableNestedList: (result[8] as List?)?.cast?>(), - nullableMapWithAnnotations: (result[9] as Map?)?.cast(), - nullableMapWithObject: (result[10] as Map?)?.cast(), + nullableMapWithAnnotations: + (result[9] as Map?)?.cast(), + nullableMapWithObject: + (result[10] as Map?)?.cast(), aNullableEnum: result[11] as AnEnum?, aNullableString: result[12] as String?, aNullableObject: result[13], @@ -415,7 +421,8 @@ class AllClassesWrapper { result as List; return AllClassesWrapper( allNullableTypes: result[0]! as AllNullableTypes, - allNullableTypesWithoutRecursion: result[1] as AllNullableTypesWithoutRecursion?, + allNullableTypesWithoutRecursion: + result[1] as AllNullableTypesWithoutRecursion?, allTypes: result[2] as AllTypes?, ); } @@ -443,7 +450,6 @@ class TestMessage { } } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -451,19 +457,19 @@ class _PigeonCodec extends StandardMessageCodec { if (value is AllTypes) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is AllNullableTypes) { + } else if (value is AllNullableTypes) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is AllNullableTypesWithoutRecursion) { + } else if (value is AllNullableTypesWithoutRecursion) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is AllClassesWrapper) { + } else if (value is AllClassesWrapper) { buffer.putUint8(132); writeValue(buffer, value.encode()); - } else if (value is TestMessage) { + } else if (value is TestMessage) { buffer.putUint8(133); writeValue(buffer, value.encode()); - } else if (value is AnEnum) { + } else if (value is AnEnum) { buffer.putUint8(134); writeValue(buffer, value.index); } else { @@ -474,17 +480,17 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return AllTypes.decode(readValue(buffer)!); - case 130: + case 130: return AllNullableTypes.decode(readValue(buffer)!); - case 131: + case 131: return AllNullableTypesWithoutRecursion.decode(readValue(buffer)!); - case 132: + case 132: return AllClassesWrapper.decode(readValue(buffer)!); - case 133: + case 133: return TestMessage.decode(readValue(buffer)!); - case 134: + case 134: final int? value = readValue(buffer) as int?; return value == null ? null : AnEnum.values[value]; default: @@ -499,9 +505,11 @@ class HostIntegrationCoreApi { /// Constructor for [HostIntegrationCoreApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - HostIntegrationCoreApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + HostIntegrationCoreApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -511,8 +519,10 @@ class HostIntegrationCoreApi { /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. Future noop() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -534,8 +544,10 @@ class HostIntegrationCoreApi { /// Returns the passed object, to test serialization and deserialization. Future echoAllTypes(AllTypes everything) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -562,8 +574,10 @@ class HostIntegrationCoreApi { /// Returns an error, to test error handling. Future throwError() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -585,8 +599,10 @@ class HostIntegrationCoreApi { /// Returns an error from a void function, to test error handling. Future throwErrorFromVoid() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -608,8 +624,10 @@ class HostIntegrationCoreApi { /// Returns a Flutter error, to test error handling. Future throwFlutterError() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -631,8 +649,10 @@ class HostIntegrationCoreApi { /// Returns passed in int. Future echoInt(int anInt) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -659,8 +679,10 @@ class HostIntegrationCoreApi { /// Returns passed in double. Future echoDouble(double aDouble) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -687,8 +709,10 @@ class HostIntegrationCoreApi { /// Returns the passed in boolean. Future echoBool(bool aBool) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -715,8 +739,10 @@ class HostIntegrationCoreApi { /// Returns the passed in string. Future echoString(String aString) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -743,8 +769,10 @@ class HostIntegrationCoreApi { /// Returns the passed in Uint8List. Future echoUint8List(Uint8List aUint8List) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -771,8 +799,10 @@ class HostIntegrationCoreApi { /// Returns the passed in generic Object. Future echoObject(Object anObject) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -799,8 +829,10 @@ class HostIntegrationCoreApi { /// Returns the passed list, to test serialization and deserialization. Future> echoList(List list) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -827,8 +859,10 @@ class HostIntegrationCoreApi { /// Returns the passed map, to test serialization and deserialization. Future> echoMap(Map aMap) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -849,14 +883,17 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as Map?)!.cast(); + return (__pigeon_replyList[0] as Map?)! + .cast(); } } /// Returns the passed map to test nested class serialization and deserialization. Future echoClassWrapper(AllClassesWrapper wrapper) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -883,8 +920,10 @@ class HostIntegrationCoreApi { /// Returns the passed enum to test serialization and deserialization. Future echoEnum(AnEnum anEnum) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -911,8 +950,10 @@ class HostIntegrationCoreApi { /// Returns the default string. Future echoNamedDefaultString({String aString = 'default'}) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -939,8 +980,10 @@ class HostIntegrationCoreApi { /// Returns passed in double. Future echoOptionalDefaultDouble([double aDouble = 3.14]) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -967,8 +1010,10 @@ class HostIntegrationCoreApi { /// Returns passed in int. Future echoRequiredInt({required int anInt}) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -994,9 +1039,12 @@ class HostIntegrationCoreApi { } /// Returns the passed object, to test serialization and deserialization. - Future echoAllNullableTypes(AllNullableTypes? everything) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future echoAllNullableTypes( + AllNullableTypes? everything) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1017,9 +1065,13 @@ class HostIntegrationCoreApi { } /// Returns the passed object, to test serialization and deserialization. - Future echoAllNullableTypesWithoutRecursion(AllNullableTypesWithoutRecursion? everything) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future + echoAllNullableTypesWithoutRecursion( + AllNullableTypesWithoutRecursion? everything) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1042,8 +1094,10 @@ class HostIntegrationCoreApi { /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. Future extractNestedNullableString(AllClassesWrapper wrapper) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1065,15 +1119,18 @@ class HostIntegrationCoreApi { /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. - Future createNestedNullableString(String? nullableString) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future createNestedNullableString( + String? nullableString) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([nullableString]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([nullableString]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1093,15 +1150,19 @@ class HostIntegrationCoreApi { } /// Returns passed in arguments of multiple types. - Future sendMultipleNullableTypes(bool? aNullableBool, int? aNullableInt, String? aNullableString) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future sendMultipleNullableTypes( + bool? aNullableBool, int? aNullableInt, String? aNullableString) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([aNullableBool, aNullableInt, aNullableString]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([aNullableBool, aNullableInt, aNullableString]) + as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1121,15 +1182,20 @@ class HostIntegrationCoreApi { } /// Returns passed in arguments of multiple types. - Future sendMultipleNullableTypesWithoutRecursion(bool? aNullableBool, int? aNullableInt, String? aNullableString) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future + sendMultipleNullableTypesWithoutRecursion(bool? aNullableBool, + int? aNullableInt, String? aNullableString) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([aNullableBool, aNullableInt, aNullableString]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([aNullableBool, aNullableInt, aNullableString]) + as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1150,8 +1216,10 @@ class HostIntegrationCoreApi { /// Returns passed in int. Future echoNullableInt(int? aNullableInt) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1173,14 +1241,16 @@ class HostIntegrationCoreApi { /// Returns passed in double. Future echoNullableDouble(double? aNullableDouble) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([aNullableDouble]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([aNullableDouble]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1196,8 +1266,10 @@ class HostIntegrationCoreApi { /// Returns the passed in boolean. Future echoNullableBool(bool? aNullableBool) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1219,14 +1291,16 @@ class HostIntegrationCoreApi { /// Returns the passed in string. Future echoNullableString(String? aNullableString) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([aNullableString]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([aNullableString]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1241,15 +1315,18 @@ class HostIntegrationCoreApi { } /// Returns the passed in Uint8List. - Future echoNullableUint8List(Uint8List? aNullableUint8List) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future echoNullableUint8List( + Uint8List? aNullableUint8List) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([aNullableUint8List]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([aNullableUint8List]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1265,14 +1342,16 @@ class HostIntegrationCoreApi { /// Returns the passed in generic Object. Future echoNullableObject(Object? aNullableObject) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([aNullableObject]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([aNullableObject]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1288,8 +1367,10 @@ class HostIntegrationCoreApi { /// Returns the passed list, to test serialization and deserialization. Future?> echoNullableList(List? aNullableList) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1310,9 +1391,12 @@ class HostIntegrationCoreApi { } /// Returns the passed map, to test serialization and deserialization. - Future?> echoNullableMap(Map? aNullableMap) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future?> echoNullableMap( + Map? aNullableMap) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1328,13 +1412,16 @@ class HostIntegrationCoreApi { details: __pigeon_replyList[2], ); } else { - return (__pigeon_replyList[0] as Map?)?.cast(); + return (__pigeon_replyList[0] as Map?) + ?.cast(); } } Future echoNullableEnum(AnEnum? anEnum) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1356,8 +1443,10 @@ class HostIntegrationCoreApi { /// Returns passed in int. Future echoOptionalNullableInt([int? aNullableInt]) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1379,14 +1468,16 @@ class HostIntegrationCoreApi { /// Returns the passed in string. Future echoNamedNullableString({String? aNullableString}) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([aNullableString]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([aNullableString]) as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -1403,8 +1494,10 @@ class HostIntegrationCoreApi { /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. Future noopAsync() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1426,8 +1519,10 @@ class HostIntegrationCoreApi { /// Returns passed in int asynchronously. Future echoAsyncInt(int anInt) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1454,8 +1549,10 @@ class HostIntegrationCoreApi { /// Returns passed in double asynchronously. Future echoAsyncDouble(double aDouble) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1482,8 +1579,10 @@ class HostIntegrationCoreApi { /// Returns the passed in boolean asynchronously. Future echoAsyncBool(bool aBool) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1510,8 +1609,10 @@ class HostIntegrationCoreApi { /// Returns the passed string asynchronously. Future echoAsyncString(String aString) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1538,8 +1639,10 @@ class HostIntegrationCoreApi { /// Returns the passed in Uint8List asynchronously. Future echoAsyncUint8List(Uint8List aUint8List) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1566,8 +1669,10 @@ class HostIntegrationCoreApi { /// Returns the passed in generic Object asynchronously. Future echoAsyncObject(Object anObject) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1594,8 +1699,10 @@ class HostIntegrationCoreApi { /// Returns the passed list, to test asynchronous serialization and deserialization. Future> echoAsyncList(List list) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1622,8 +1729,10 @@ class HostIntegrationCoreApi { /// Returns the passed map, to test asynchronous serialization and deserialization. Future> echoAsyncMap(Map aMap) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1644,14 +1753,17 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as Map?)!.cast(); + return (__pigeon_replyList[0] as Map?)! + .cast(); } } /// Returns the passed enum, to test asynchronous serialization and deserialization. Future echoAsyncEnum(AnEnum anEnum) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1678,8 +1790,10 @@ class HostIntegrationCoreApi { /// Responds with an error from an async function returning a value. Future throwAsyncError() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1701,8 +1815,10 @@ class HostIntegrationCoreApi { /// Responds with an error from an async void function. Future throwAsyncErrorFromVoid() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1724,8 +1840,10 @@ class HostIntegrationCoreApi { /// Responds with a Flutter error from an async function returning a value. Future throwAsyncFlutterError() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1747,8 +1865,10 @@ class HostIntegrationCoreApi { /// Returns the passed object, to test async serialization and deserialization. Future echoAsyncAllTypes(AllTypes everything) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1774,9 +1894,12 @@ class HostIntegrationCoreApi { } /// Returns the passed object, to test serialization and deserialization. - Future echoAsyncNullableAllNullableTypes(AllNullableTypes? everything) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future echoAsyncNullableAllNullableTypes( + AllNullableTypes? everything) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1797,9 +1920,13 @@ class HostIntegrationCoreApi { } /// Returns the passed object, to test serialization and deserialization. - Future echoAsyncNullableAllNullableTypesWithoutRecursion(AllNullableTypesWithoutRecursion? everything) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future + echoAsyncNullableAllNullableTypesWithoutRecursion( + AllNullableTypesWithoutRecursion? everything) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1821,8 +1948,10 @@ class HostIntegrationCoreApi { /// Returns passed in int asynchronously. Future echoAsyncNullableInt(int? anInt) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1844,8 +1973,10 @@ class HostIntegrationCoreApi { /// Returns passed in double asynchronously. Future echoAsyncNullableDouble(double? aDouble) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1867,8 +1998,10 @@ class HostIntegrationCoreApi { /// Returns the passed in boolean asynchronously. Future echoAsyncNullableBool(bool? aBool) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1890,8 +2023,10 @@ class HostIntegrationCoreApi { /// Returns the passed string asynchronously. Future echoAsyncNullableString(String? aString) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1913,8 +2048,10 @@ class HostIntegrationCoreApi { /// Returns the passed in Uint8List asynchronously. Future echoAsyncNullableUint8List(Uint8List? aUint8List) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1936,8 +2073,10 @@ class HostIntegrationCoreApi { /// Returns the passed in generic Object asynchronously. Future echoAsyncNullableObject(Object? anObject) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1959,8 +2098,10 @@ class HostIntegrationCoreApi { /// Returns the passed list, to test asynchronous serialization and deserialization. Future?> echoAsyncNullableList(List? list) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1981,9 +2122,12 @@ class HostIntegrationCoreApi { } /// Returns the passed map, to test asynchronous serialization and deserialization. - Future?> echoAsyncNullableMap(Map? aMap) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future?> echoAsyncNullableMap( + Map? aMap) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -1999,14 +2143,17 @@ class HostIntegrationCoreApi { details: __pigeon_replyList[2], ); } else { - return (__pigeon_replyList[0] as Map?)?.cast(); + return (__pigeon_replyList[0] as Map?) + ?.cast(); } } /// Returns the passed enum, to test asynchronous serialization and deserialization. Future echoAsyncNullableEnum(AnEnum? anEnum) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2027,8 +2174,10 @@ class HostIntegrationCoreApi { } Future callFlutterNoop() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2049,8 +2198,10 @@ class HostIntegrationCoreApi { } Future callFlutterThrowError() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2071,8 +2222,10 @@ class HostIntegrationCoreApi { } Future callFlutterThrowErrorFromVoid() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2093,8 +2246,10 @@ class HostIntegrationCoreApi { } Future callFlutterEchoAllTypes(AllTypes everything) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2119,9 +2274,12 @@ class HostIntegrationCoreApi { } } - Future callFlutterEchoAllNullableTypes(AllNullableTypes? everything) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future callFlutterEchoAllNullableTypes( + AllNullableTypes? everything) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2141,15 +2299,19 @@ class HostIntegrationCoreApi { } } - Future callFlutterSendMultipleNullableTypes(bool? aNullableBool, int? aNullableInt, String? aNullableString) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future callFlutterSendMultipleNullableTypes( + bool? aNullableBool, int? aNullableInt, String? aNullableString) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([aNullableBool, aNullableInt, aNullableString]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([aNullableBool, aNullableInt, aNullableString]) + as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2168,9 +2330,13 @@ class HostIntegrationCoreApi { } } - Future callFlutterEchoAllNullableTypesWithoutRecursion(AllNullableTypesWithoutRecursion? everything) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future + callFlutterEchoAllNullableTypesWithoutRecursion( + AllNullableTypesWithoutRecursion? everything) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2190,15 +2356,20 @@ class HostIntegrationCoreApi { } } - Future callFlutterSendMultipleNullableTypesWithoutRecursion(bool? aNullableBool, int? aNullableInt, String? aNullableString) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future + callFlutterSendMultipleNullableTypesWithoutRecursion(bool? aNullableBool, + int? aNullableInt, String? aNullableString) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, ); - final List? __pigeon_replyList = - await __pigeon_channel.send([aNullableBool, aNullableInt, aNullableString]) as List?; + final List? __pigeon_replyList = await __pigeon_channel + .send([aNullableBool, aNullableInt, aNullableString]) + as List?; if (__pigeon_replyList == null) { throw _createConnectionError(__pigeon_channelName); } else if (__pigeon_replyList.length > 1) { @@ -2218,8 +2389,10 @@ class HostIntegrationCoreApi { } Future callFlutterEchoBool(bool aBool) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2245,8 +2418,10 @@ class HostIntegrationCoreApi { } Future callFlutterEchoInt(int anInt) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2272,8 +2447,10 @@ class HostIntegrationCoreApi { } Future callFlutterEchoDouble(double aDouble) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2299,8 +2476,10 @@ class HostIntegrationCoreApi { } Future callFlutterEchoString(String aString) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2326,8 +2505,10 @@ class HostIntegrationCoreApi { } Future callFlutterEchoUint8List(Uint8List list) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2353,8 +2534,10 @@ class HostIntegrationCoreApi { } Future> callFlutterEchoList(List list) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2379,9 +2562,12 @@ class HostIntegrationCoreApi { } } - Future> callFlutterEchoMap(Map aMap) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future> callFlutterEchoMap( + Map aMap) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2402,13 +2588,16 @@ class HostIntegrationCoreApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as Map?)!.cast(); + return (__pigeon_replyList[0] as Map?)! + .cast(); } } Future callFlutterEchoEnum(AnEnum anEnum) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2434,8 +2623,10 @@ class HostIntegrationCoreApi { } Future callFlutterEchoNullableBool(bool? aBool) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2456,8 +2647,10 @@ class HostIntegrationCoreApi { } Future callFlutterEchoNullableInt(int? anInt) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2478,8 +2671,10 @@ class HostIntegrationCoreApi { } Future callFlutterEchoNullableDouble(double? aDouble) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2500,8 +2695,10 @@ class HostIntegrationCoreApi { } Future callFlutterEchoNullableString(String? aString) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2522,8 +2719,10 @@ class HostIntegrationCoreApi { } Future callFlutterEchoNullableUint8List(Uint8List? list) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2543,9 +2742,12 @@ class HostIntegrationCoreApi { } } - Future?> callFlutterEchoNullableList(List? list) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future?> callFlutterEchoNullableList( + List? list) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2565,9 +2767,12 @@ class HostIntegrationCoreApi { } } - Future?> callFlutterEchoNullableMap(Map? aMap) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future?> callFlutterEchoNullableMap( + Map? aMap) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2583,13 +2788,16 @@ class HostIntegrationCoreApi { details: __pigeon_replyList[2], ); } else { - return (__pigeon_replyList[0] as Map?)?.cast(); + return (__pigeon_replyList[0] as Map?) + ?.cast(); } } Future callFlutterEchoNullableEnum(AnEnum? anEnum) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2610,8 +2818,10 @@ class HostIntegrationCoreApi { } Future callFlutterSmallApiEchoString(String aString) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -2661,15 +2871,18 @@ abstract class FlutterIntegrationCoreApi { /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - AllNullableTypes sendMultipleNullableTypes(bool? aNullableBool, int? aNullableInt, String? aNullableString); + AllNullableTypes sendMultipleNullableTypes( + bool? aNullableBool, int? aNullableInt, String? aNullableString); /// Returns the passed object, to test serialization and deserialization. - AllNullableTypesWithoutRecursion? echoAllNullableTypesWithoutRecursion(AllNullableTypesWithoutRecursion? everything); + AllNullableTypesWithoutRecursion? echoAllNullableTypesWithoutRecursion( + AllNullableTypesWithoutRecursion? everything); /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - AllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion(bool? aNullableBool, int? aNullableInt, String? aNullableString); + AllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion( + bool? aNullableBool, int? aNullableInt, String? aNullableString); /// Returns the passed boolean, to test serialization and deserialization. bool echoBool(bool aBool); @@ -2726,11 +2939,18 @@ abstract class FlutterIntegrationCoreApi { /// Returns the passed in generic Object asynchronously. Future echoAsyncString(String aString); - static void setUp(FlutterIntegrationCoreApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp( + FlutterIntegrationCoreApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -2741,15 +2961,18 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -2760,15 +2983,18 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -2779,22 +3005,25 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes was null.'); final List args = (message as List?)!; final AllTypes? arg_everything = (args[0] as AllTypes?); assert(arg_everything != null, @@ -2804,118 +3033,140 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes was null.'); final List args = (message as List?)!; - final AllNullableTypes? arg_everything = (args[0] as AllNullableTypes?); + final AllNullableTypes? arg_everything = + (args[0] as AllNullableTypes?); try { - final AllNullableTypes? output = api.echoAllNullableTypes(arg_everything); + final AllNullableTypes? output = + api.echoAllNullableTypes(arg_everything); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes was null.'); final List args = (message as List?)!; final bool? arg_aNullableBool = (args[0] as bool?); final int? arg_aNullableInt = (args[1] as int?); final String? arg_aNullableString = (args[2] as String?); try { - final AllNullableTypes output = api.sendMultipleNullableTypes(arg_aNullableBool, arg_aNullableInt, arg_aNullableString); + final AllNullableTypes output = api.sendMultipleNullableTypes( + arg_aNullableBool, arg_aNullableInt, arg_aNullableString); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion was null.'); final List args = (message as List?)!; - final AllNullableTypesWithoutRecursion? arg_everything = (args[0] as AllNullableTypesWithoutRecursion?); + final AllNullableTypesWithoutRecursion? arg_everything = + (args[0] as AllNullableTypesWithoutRecursion?); try { - final AllNullableTypesWithoutRecursion? output = api.echoAllNullableTypesWithoutRecursion(arg_everything); + final AllNullableTypesWithoutRecursion? output = + api.echoAllNullableTypesWithoutRecursion(arg_everything); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion was null.'); final List args = (message as List?)!; final bool? arg_aNullableBool = (args[0] as bool?); final int? arg_aNullableInt = (args[1] as int?); final String? arg_aNullableString = (args[2] as String?); try { - final AllNullableTypesWithoutRecursion output = api.sendMultipleNullableTypesWithoutRecursion(arg_aNullableBool, arg_aNullableInt, arg_aNullableString); + final AllNullableTypesWithoutRecursion output = + api.sendMultipleNullableTypesWithoutRecursion( + arg_aNullableBool, arg_aNullableInt, arg_aNullableString); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool was null.'); final List args = (message as List?)!; final bool? arg_aBool = (args[0] as bool?); assert(arg_aBool != null, @@ -2925,22 +3176,25 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt was null.'); final List args = (message as List?)!; final int? arg_anInt = (args[0] as int?); assert(arg_anInt != null, @@ -2950,22 +3204,25 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble was null.'); final List args = (message as List?)!; final double? arg_aDouble = (args[0] as double?); assert(arg_aDouble != null, @@ -2975,22 +3232,25 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); assert(arg_aString != null, @@ -3000,22 +3260,25 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List was null.'); final List args = (message as List?)!; final Uint8List? arg_list = (args[0] as Uint8List?); assert(arg_list != null, @@ -3025,24 +3288,28 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList was null.'); final List args = (message as List?)!; - final List? arg_list = (args[0] as List?)?.cast(); + final List? arg_list = + (args[0] as List?)?.cast(); assert(arg_list != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList was null, expected non-null List.'); try { @@ -3050,24 +3317,28 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap was null.'); final List args = (message as List?)!; - final Map? arg_aMap = (args[0] as Map?)?.cast(); + final Map? arg_aMap = + (args[0] as Map?)?.cast(); assert(arg_aMap != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap was null, expected non-null Map.'); try { @@ -3075,22 +3346,25 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum was null.'); final List args = (message as List?)!; final AnEnum? arg_anEnum = (args[0] as AnEnum?); assert(arg_anEnum != null, @@ -3100,22 +3374,25 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool was null.'); final List args = (message as List?)!; final bool? arg_aBool = (args[0] as bool?); try { @@ -3123,22 +3400,25 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt was null.'); final List args = (message as List?)!; final int? arg_anInt = (args[0] as int?); try { @@ -3146,22 +3426,25 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble was null.'); final List args = (message as List?)!; final double? arg_aDouble = (args[0] as double?); try { @@ -3169,22 +3452,25 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); try { @@ -3192,22 +3478,25 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List was null.'); final List args = (message as List?)!; final Uint8List? arg_list = (args[0] as Uint8List?); try { @@ -3215,68 +3504,79 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList was null.'); final List args = (message as List?)!; - final List? arg_list = (args[0] as List?)?.cast(); + final List? arg_list = + (args[0] as List?)?.cast(); try { final List? output = api.echoNullableList(arg_list); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap was null.'); final List args = (message as List?)!; - final Map? arg_aMap = (args[0] as Map?)?.cast(); + final Map? arg_aMap = + (args[0] as Map?)?.cast(); try { final Map? output = api.echoNullableMap(arg_aMap); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum was null.'); final List args = (message as List?)!; final AnEnum? arg_anEnum = (args[0] as AnEnum?); try { @@ -3284,15 +3584,18 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -3303,22 +3606,25 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); assert(arg_aString != null, @@ -3328,8 +3634,9 @@ abstract class FlutterIntegrationCoreApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } @@ -3342,9 +3649,11 @@ class HostTrivialApi { /// Constructor for [HostTrivialApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - HostTrivialApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + HostTrivialApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -3352,8 +3661,10 @@ class HostTrivialApi { final String __pigeon_messageChannelSuffix; Future noop() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3379,9 +3690,11 @@ class HostSmallApi { /// Constructor for [HostSmallApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - HostSmallApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + HostSmallApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -3389,8 +3702,10 @@ class HostSmallApi { final String __pigeon_messageChannelSuffix; Future echo(String aString) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3416,8 +3731,10 @@ class HostSmallApi { } Future voidVoid() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -3446,18 +3763,25 @@ abstract class FlutterSmallApi { String echoString(String aString); - static void setUp(FlutterSmallApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp( + FlutterSmallApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList was null.'); final List args = (message as List?)!; final TestMessage? arg_msg = (args[0] as TestMessage?); assert(arg_msg != null, @@ -3467,22 +3791,25 @@ abstract class FlutterSmallApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); assert(arg_aString != null, @@ -3492,8 +3819,9 @@ abstract class FlutterSmallApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart index 359b0f0bc3f2..e2ca92672ed7 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart @@ -19,7 +19,8 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -33,10 +34,13 @@ List wrapResponse({Object? result, PlatformException? error, bool empty enum EnumState { /// This comment is to test enum member (Pending) documentation comments. Pending, + /// This comment is to test enum member (Success) documentation comments. Success, + /// This comment is to test enum member (Error) documentation comments. Error, + /// This comment is to test enum member (SnakeCase) documentation comments. SnakeCase, } @@ -64,7 +68,6 @@ class DataWithEnum { } } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -72,7 +75,7 @@ class _PigeonCodec extends StandardMessageCodec { if (value is DataWithEnum) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is EnumState) { + } else if (value is EnumState) { buffer.putUint8(130); writeValue(buffer, value.index); } else { @@ -83,9 +86,9 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return DataWithEnum.decode(readValue(buffer)!); - case 130: + case 130: final int? value = readValue(buffer) as int?; return value == null ? null : EnumState.values[value]; default: @@ -99,9 +102,11 @@ class EnumApi2Host { /// Constructor for [EnumApi2Host]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - EnumApi2Host({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + EnumApi2Host( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -110,8 +115,10 @@ class EnumApi2Host { /// This comment is to test method documentation comments. Future echo(DataWithEnum data) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.EnumApi2Host.echo$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.EnumApi2Host.echo$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -144,18 +151,25 @@ abstract class EnumApi2Flutter { /// This comment is to test method documentation comments. DataWithEnum echo(DataWithEnum data); - static void setUp(EnumApi2Flutter? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp( + EnumApi2Flutter? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.EnumApi2Flutter.echo$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.EnumApi2Flutter.echo$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.EnumApi2Flutter.echo was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.EnumApi2Flutter.echo was null.'); final List args = (message as List?)!; final DataWithEnum? arg_data = (args[0] as DataWithEnum?); assert(arg_data != null, @@ -165,8 +179,9 @@ abstract class EnumApi2Flutter { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart index d24eb571f933..61e4b97a5fe0 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart @@ -108,7 +108,6 @@ class FlutterSearchReplies { } } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -116,13 +115,13 @@ class _PigeonCodec extends StandardMessageCodec { if (value is FlutterSearchRequest) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is FlutterSearchReply) { + } else if (value is FlutterSearchReply) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is FlutterSearchRequests) { + } else if (value is FlutterSearchRequests) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is FlutterSearchReplies) { + } else if (value is FlutterSearchReplies) { buffer.putUint8(132); writeValue(buffer, value.encode()); } else { @@ -133,13 +132,13 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return FlutterSearchRequest.decode(readValue(buffer)!); - case 130: + case 130: return FlutterSearchReply.decode(readValue(buffer)!); - case 131: + case 131: return FlutterSearchRequests.decode(readValue(buffer)!); - case 132: + case 132: return FlutterSearchReplies.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -153,7 +152,8 @@ class Api { /// BinaryMessenger will be used which routes to the host platform. Api({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -161,8 +161,10 @@ class Api { final String __pigeon_messageChannelSuffix; Future search(FlutterSearchRequest request) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.Api.search$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.Api.search$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -188,8 +190,10 @@ class Api { } Future doSearches(FlutterSearchRequests request) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.Api.doSearches$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.Api.doSearches$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -215,8 +219,10 @@ class Api { } Future echo(FlutterSearchRequests requests) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.Api.echo$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.Api.echo$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -242,8 +248,10 @@ class Api { } Future anInt(int value) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.Api.anInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.Api.anInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart index 2d833e477c61..fb7e65c9483f 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart @@ -19,7 +19,8 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -139,7 +140,6 @@ class MessageNested { } } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -147,13 +147,13 @@ class _PigeonCodec extends StandardMessageCodec { if (value is MessageSearchRequest) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is MessageSearchReply) { + } else if (value is MessageSearchReply) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is MessageNested) { + } else if (value is MessageNested) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is MessageRequestState) { + } else if (value is MessageRequestState) { buffer.putUint8(132); writeValue(buffer, value.index); } else { @@ -164,13 +164,13 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return MessageSearchRequest.decode(readValue(buffer)!); - case 130: + case 130: return MessageSearchReply.decode(readValue(buffer)!); - case 131: + case 131: return MessageNested.decode(readValue(buffer)!); - case 132: + case 132: final int? value = readValue(buffer) as int?; return value == null ? null : MessageRequestState.values[value]; default: @@ -186,9 +186,11 @@ class MessageApi { /// Constructor for [MessageApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - MessageApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + MessageApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -199,8 +201,10 @@ class MessageApi { /// /// This comment also tests multiple line comments. Future initialize() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.MessageApi.initialize$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.MessageApi.initialize$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -222,8 +226,10 @@ class MessageApi { /// This comment is to test method documentation comments. Future search(MessageSearchRequest request) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.MessageApi.search$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.MessageApi.search$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -254,9 +260,11 @@ class MessageNestedApi { /// Constructor for [MessageNestedApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - MessageNestedApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + MessageNestedApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -267,8 +275,10 @@ class MessageNestedApi { /// /// This comment also tests multiple line comments. Future search(MessageNested nested) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.MessageNestedApi.search$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.MessageNestedApi.search$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -301,20 +311,28 @@ abstract class MessageFlutterSearchApi { /// This comment is to test method documentation comments. MessageSearchReply search(MessageSearchRequest request); - static void setUp(MessageFlutterSearchApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp( + MessageFlutterSearchApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.MessageFlutterSearchApi.search$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.MessageFlutterSearchApi.search$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MessageFlutterSearchApi.search was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MessageFlutterSearchApi.search was null.'); final List args = (message as List?)!; - final MessageSearchRequest? arg_request = (args[0] as MessageSearchRequest?); + final MessageSearchRequest? arg_request = + (args[0] as MessageSearchRequest?); assert(arg_request != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MessageFlutterSearchApi.search was null, expected non-null MessageSearchRequest.'); try { @@ -322,8 +340,9 @@ abstract class MessageFlutterSearchApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart index a5cb97b796f2..33b984077af0 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/multiple_arity.gen.dart @@ -19,7 +19,8 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -29,7 +30,6 @@ List wrapResponse({Object? result, PlatformException? error, bool empty return [error.code, error.message, error.details]; } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); } @@ -38,9 +38,11 @@ class MultipleArityHostApi { /// Constructor for [MultipleArityHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - MultipleArityHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + MultipleArityHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -48,8 +50,10 @@ class MultipleArityHostApi { final String __pigeon_messageChannelSuffix; Future subtract(int x, int y) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.MultipleArityHostApi.subtract$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.MultipleArityHostApi.subtract$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -80,18 +84,25 @@ abstract class MultipleArityFlutterApi { int subtract(int x, int y); - static void setUp(MultipleArityFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp( + MultipleArityFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.MultipleArityFlutterApi.subtract$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.MultipleArityFlutterApi.subtract$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MultipleArityFlutterApi.subtract was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MultipleArityFlutterApi.subtract was null.'); final List args = (message as List?)!; final int? arg_x = (args[0] as int?); assert(arg_x != null, @@ -104,8 +115,9 @@ abstract class MultipleArityFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart index 346c28207515..c9c7fe5a638e 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart @@ -19,7 +19,8 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -122,7 +123,6 @@ class NonNullFieldSearchReply { } } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -130,13 +130,13 @@ class _PigeonCodec extends StandardMessageCodec { if (value is NonNullFieldSearchRequest) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is ExtraData) { + } else if (value is ExtraData) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is NonNullFieldSearchReply) { + } else if (value is NonNullFieldSearchReply) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is ReplyType) { + } else if (value is ReplyType) { buffer.putUint8(132); writeValue(buffer, value.index); } else { @@ -147,13 +147,13 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return NonNullFieldSearchRequest.decode(readValue(buffer)!); - case 130: + case 130: return ExtraData.decode(readValue(buffer)!); - case 131: + case 131: return NonNullFieldSearchReply.decode(readValue(buffer)!); - case 132: + case 132: final int? value = readValue(buffer) as int?; return value == null ? null : ReplyType.values[value]; default: @@ -166,18 +166,23 @@ class NonNullFieldHostApi { /// Constructor for [NonNullFieldHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - NonNullFieldHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + NonNullFieldHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); final String __pigeon_messageChannelSuffix; - Future search(NonNullFieldSearchRequest nested) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.NonNullFieldHostApi.search$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + Future search( + NonNullFieldSearchRequest nested) async { + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.NonNullFieldHostApi.search$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -208,20 +213,28 @@ abstract class NonNullFieldFlutterApi { NonNullFieldSearchReply search(NonNullFieldSearchRequest request); - static void setUp(NonNullFieldFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp( + NonNullFieldFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.NonNullFieldFlutterApi.search$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.NonNullFieldFlutterApi.search$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NonNullFieldFlutterApi.search was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NonNullFieldFlutterApi.search was null.'); final List args = (message as List?)!; - final NonNullFieldSearchRequest? arg_request = (args[0] as NonNullFieldSearchRequest?); + final NonNullFieldSearchRequest? arg_request = + (args[0] as NonNullFieldSearchRequest?); assert(arg_request != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NonNullFieldFlutterApi.search was null, expected non-null NonNullFieldSearchRequest.'); try { @@ -229,8 +242,9 @@ abstract class NonNullFieldFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart index 75d4ebbc0b92..578a7c28c316 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart @@ -19,7 +19,8 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -101,7 +102,6 @@ class NullFieldsSearchReply { } } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -109,10 +109,10 @@ class _PigeonCodec extends StandardMessageCodec { if (value is NullFieldsSearchRequest) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is NullFieldsSearchReply) { + } else if (value is NullFieldsSearchReply) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is NullFieldsSearchReplyType) { + } else if (value is NullFieldsSearchReplyType) { buffer.putUint8(131); writeValue(buffer, value.index); } else { @@ -123,11 +123,11 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return NullFieldsSearchRequest.decode(readValue(buffer)!); - case 130: + case 130: return NullFieldsSearchReply.decode(readValue(buffer)!); - case 131: + case 131: final int? value = readValue(buffer) as int?; return value == null ? null : NullFieldsSearchReplyType.values[value]; default: @@ -140,9 +140,11 @@ class NullFieldsHostApi { /// Constructor for [NullFieldsHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - NullFieldsHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + NullFieldsHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -150,8 +152,10 @@ class NullFieldsHostApi { final String __pigeon_messageChannelSuffix; Future search(NullFieldsSearchRequest nested) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.NullFieldsHostApi.search$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.NullFieldsHostApi.search$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -182,20 +186,28 @@ abstract class NullFieldsFlutterApi { NullFieldsSearchReply search(NullFieldsSearchRequest request); - static void setUp(NullFieldsFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp( + NullFieldsFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.NullFieldsFlutterApi.search$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.NullFieldsFlutterApi.search$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NullFieldsFlutterApi.search was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NullFieldsFlutterApi.search was null.'); final List args = (message as List?)!; - final NullFieldsSearchRequest? arg_request = (args[0] as NullFieldsSearchRequest?); + final NullFieldsSearchRequest? arg_request = + (args[0] as NullFieldsSearchRequest?); assert(arg_request != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NullFieldsFlutterApi.search was null, expected non-null NullFieldsSearchRequest.'); try { @@ -203,8 +215,9 @@ abstract class NullFieldsFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/nullable_returns.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/nullable_returns.gen.dart index 7d5cd700fda9..72ea0ae7363f 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/nullable_returns.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/nullable_returns.gen.dart @@ -19,7 +19,8 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -29,7 +30,6 @@ List wrapResponse({Object? result, PlatformException? error, bool empty return [error.code, error.message, error.details]; } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); } @@ -38,9 +38,11 @@ class NullableReturnHostApi { /// Constructor for [NullableReturnHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - NullableReturnHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + NullableReturnHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -48,8 +50,10 @@ class NullableReturnHostApi { final String __pigeon_messageChannelSuffix; Future doit() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.NullableReturnHostApi.doit$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.NullableReturnHostApi.doit$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -75,11 +79,18 @@ abstract class NullableReturnFlutterApi { int? doit(); - static void setUp(NullableReturnFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp( + NullableReturnFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.NullableReturnFlutterApi.doit$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.NullableReturnFlutterApi.doit$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -90,8 +101,9 @@ abstract class NullableReturnFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } @@ -103,9 +115,11 @@ class NullableArgHostApi { /// Constructor for [NullableArgHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - NullableArgHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + NullableArgHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -113,8 +127,10 @@ class NullableArgHostApi { final String __pigeon_messageChannelSuffix; Future doit(int? x) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.NullableArgHostApi.doit$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.NullableArgHostApi.doit$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -145,18 +161,25 @@ abstract class NullableArgFlutterApi { int? doit(int? x); - static void setUp(NullableArgFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp( + NullableArgFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.NullableArgFlutterApi.doit$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.NullableArgFlutterApi.doit$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NullableArgFlutterApi.doit was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NullableArgFlutterApi.doit was null.'); final List args = (message as List?)!; final int? arg_x = (args[0] as int?); try { @@ -164,8 +187,9 @@ abstract class NullableArgFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } @@ -177,9 +201,11 @@ class NullableCollectionReturnHostApi { /// Constructor for [NullableCollectionReturnHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - NullableCollectionReturnHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + NullableCollectionReturnHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -187,8 +213,10 @@ class NullableCollectionReturnHostApi { final String __pigeon_messageChannelSuffix; Future?> doit() async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionReturnHostApi.doit$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionReturnHostApi.doit$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -214,11 +242,18 @@ abstract class NullableCollectionReturnFlutterApi { List? doit(); - static void setUp(NullableCollectionReturnFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp( + NullableCollectionReturnFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionReturnFlutterApi.doit$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionReturnFlutterApi.doit$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); @@ -229,8 +264,9 @@ abstract class NullableCollectionReturnFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } @@ -242,9 +278,11 @@ class NullableCollectionArgHostApi { /// Constructor for [NullableCollectionArgHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - NullableCollectionArgHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + NullableCollectionArgHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -252,8 +290,10 @@ class NullableCollectionArgHostApi { final String __pigeon_messageChannelSuffix; Future> doit(List? x) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionArgHostApi.doit$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionArgHostApi.doit$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -284,27 +324,36 @@ abstract class NullableCollectionArgFlutterApi { List doit(List? x); - static void setUp(NullableCollectionArgFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp( + NullableCollectionArgFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionArgFlutterApi.doit$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionArgFlutterApi.doit$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionArgFlutterApi.doit was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.NullableCollectionArgFlutterApi.doit was null.'); final List args = (message as List?)!; - final List? arg_x = (args[0] as List?)?.cast(); + final List? arg_x = + (args[0] as List?)?.cast(); try { final List output = api.doit(arg_x); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/primitive.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/primitive.gen.dart index 7868fb1d09e8..8ac914eb6fad 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/primitive.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/primitive.gen.dart @@ -19,7 +19,8 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -29,7 +30,6 @@ List wrapResponse({Object? result, PlatformException? error, bool empty return [error.code, error.message, error.details]; } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); } @@ -38,9 +38,11 @@ class PrimitiveHostApi { /// Constructor for [PrimitiveHostApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default /// BinaryMessenger will be used which routes to the host platform. - PrimitiveHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) + PrimitiveHostApi( + {BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) : __pigeon_binaryMessenger = binaryMessenger, - __pigeon_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + __pigeon_messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; final BinaryMessenger? __pigeon_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -48,8 +50,10 @@ class PrimitiveHostApi { final String __pigeon_messageChannelSuffix; Future anInt(int value) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.anInt$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.anInt$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -75,8 +79,10 @@ class PrimitiveHostApi { } Future aBool(bool value) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aBool$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aBool$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -102,8 +108,10 @@ class PrimitiveHostApi { } Future aString(String value) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aString$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aString$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -129,8 +137,10 @@ class PrimitiveHostApi { } Future aDouble(double value) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aDouble$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aDouble$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -156,8 +166,10 @@ class PrimitiveHostApi { } Future> aMap(Map value) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -183,8 +195,10 @@ class PrimitiveHostApi { } Future> aList(List value) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aList$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aList$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -210,8 +224,10 @@ class PrimitiveHostApi { } Future anInt32List(Int32List value) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.anInt32List$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.anInt32List$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -237,8 +253,10 @@ class PrimitiveHostApi { } Future> aBoolList(List value) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aBoolList$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aBoolList$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -264,8 +282,10 @@ class PrimitiveHostApi { } Future> aStringIntMap(Map value) async { - final String __pigeon_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aStringIntMap$__pigeon_messageChannelSuffix'; - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( + final String __pigeon_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.aStringIntMap$__pigeon_messageChannelSuffix'; + final BasicMessageChannel __pigeon_channel = + BasicMessageChannel( __pigeon_channelName, pigeonChannelCodec, binaryMessenger: __pigeon_binaryMessenger, @@ -286,7 +306,8 @@ class PrimitiveHostApi { message: 'Host platform returned null value for non-null return value.', ); } else { - return (__pigeon_replyList[0] as Map?)!.cast(); + return (__pigeon_replyList[0] as Map?)! + .cast(); } } } @@ -312,18 +333,25 @@ abstract class PrimitiveFlutterApi { Map aStringIntMap(Map value); - static void setUp(PrimitiveFlutterApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp( + PrimitiveFlutterApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.anInt$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.anInt$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.anInt was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.anInt was null.'); final List args = (message as List?)!; final int? arg_value = (args[0] as int?); assert(arg_value != null, @@ -333,22 +361,25 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBool$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBool$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBool was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBool was null.'); final List args = (message as List?)!; final bool? arg_value = (args[0] as bool?); assert(arg_value != null, @@ -358,22 +389,25 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aString$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aString$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aString was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aString was null.'); final List args = (message as List?)!; final String? arg_value = (args[0] as String?); assert(arg_value != null, @@ -383,22 +417,25 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aDouble$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aDouble$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aDouble was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aDouble was null.'); final List args = (message as List?)!; final double? arg_value = (args[0] as double?); assert(arg_value != null, @@ -408,24 +445,28 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aMap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aMap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aMap was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aMap was null.'); final List args = (message as List?)!; - final Map? arg_value = (args[0] as Map?); + final Map? arg_value = + (args[0] as Map?); assert(arg_value != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aMap was null, expected non-null Map.'); try { @@ -433,22 +474,25 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aList$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aList$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aList was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aList was null.'); final List args = (message as List?)!; final List? arg_value = (args[0] as List?); assert(arg_value != null, @@ -458,22 +502,25 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.anInt32List$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.anInt32List$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.anInt32List was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.anInt32List was null.'); final List args = (message as List?)!; final Int32List? arg_value = (args[0] as Int32List?); assert(arg_value != null, @@ -483,24 +530,28 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBoolList$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBoolList$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBoolList was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBoolList was null.'); final List args = (message as List?)!; - final List? arg_value = (args[0] as List?)?.cast(); + final List? arg_value = + (args[0] as List?)?.cast(); assert(arg_value != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aBoolList was null, expected non-null List.'); try { @@ -508,24 +559,28 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aStringIntMap$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aStringIntMap$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { __pigeon_channel.setMessageHandler(null); } else { __pigeon_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aStringIntMap was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aStringIntMap was null.'); final List args = (message as List?)!; - final Map? arg_value = (args[0] as Map?)?.cast(); + final Map? arg_value = + (args[0] as Map?)?.cast(); assert(arg_value != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PrimitiveFlutterApi.aStringIntMap was null, expected non-null Map.'); try { @@ -533,8 +588,9 @@ abstract class PrimitiveFlutterApi { return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart index 6553d5daaff2..160581c270f2 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart @@ -9,7 +9,8 @@ import 'dart:async'; import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; -import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer, immutable, protected; +import 'package:flutter/foundation.dart' + show ReadBuffer, WriteBuffer, immutable, protected; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart' show WidgetsFlutterBinding; @@ -20,7 +21,8 @@ PlatformException _createConnectionError(String channelName) { ); } -List wrapResponse({Object? result, PlatformException? error, bool empty = false}) { +List wrapResponse( + {Object? result, PlatformException? error, bool empty = false}) { if (empty) { return []; } @@ -29,6 +31,7 @@ List wrapResponse({Object? result, PlatformException? error, bool empty } return [error.code, error.message, error.details]; } + /// An immutable object that serves as the base class for all ProxyApis and /// can provide functional copies of itself. /// @@ -114,7 +117,8 @@ class PigeonInstanceManager { final Expando _identifiers = Expando(); final Map> _weakInstances = >{}; - final Map _strongInstances = {}; + final Map _strongInstances = + {}; late final Finalizer _finalizer; int _nextIdentifier = 0; @@ -132,11 +136,16 @@ class PigeonInstanceManager { api.removeStrongReference(identifier); }, ); - _PigeonInstanceManagerApi.setUpMessageHandlers(instanceManager: instanceManager); - ProxyApiTestClass.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - ProxyApiSuperClass.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - ProxyApiInterface.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); - ClassWithApiRequirement.pigeon_setUpMessageHandlers(pigeon_instanceManager: instanceManager); + _PigeonInstanceManagerApi.setUpMessageHandlers( + instanceManager: instanceManager); + ProxyApiTestClass.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + ProxyApiSuperClass.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + ProxyApiInterface.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); + ClassWithApiRequirement.pigeon_setUpMessageHandlers( + pigeon_instanceManager: instanceManager); return instanceManager; } @@ -200,15 +209,19 @@ class PigeonInstanceManager { /// /// This method also expects the host `InstanceManager` to have a strong /// reference to the instance the identifier is associated with. - T? getInstanceWithWeakReference(int identifier) { - final PigeonProxyApiBaseClass? weakInstance = _weakInstances[identifier]?.target; + T? getInstanceWithWeakReference( + int identifier) { + final PigeonProxyApiBaseClass? weakInstance = + _weakInstances[identifier]?.target; if (weakInstance == null) { - final PigeonProxyApiBaseClass? strongInstance = _strongInstances[identifier]; + final PigeonProxyApiBaseClass? strongInstance = + _strongInstances[identifier]; if (strongInstance != null) { final PigeonProxyApiBaseClass copy = strongInstance.pigeon_copy(); _identifiers[copy] = identifier; - _weakInstances[identifier] = WeakReference(copy); + _weakInstances[identifier] = + WeakReference(copy); _finalizer.attach(copy, identifier, detach: copy); return copy as T; } @@ -232,17 +245,20 @@ class PigeonInstanceManager { /// added. /// /// Returns unique identifier of the [instance] added. - void addHostCreatedInstance(PigeonProxyApiBaseClass instance, int identifier) { + void addHostCreatedInstance( + PigeonProxyApiBaseClass instance, int identifier) { _addInstanceWithIdentifier(instance, identifier); } - void _addInstanceWithIdentifier(PigeonProxyApiBaseClass instance, int identifier) { + void _addInstanceWithIdentifier( + PigeonProxyApiBaseClass instance, int identifier) { assert(!containsIdentifier(identifier)); assert(getIdentifier(instance) == null); assert(identifier >= 0); _identifiers[instance] = identifier; - _weakInstances[identifier] = WeakReference(instance); + _weakInstances[identifier] = + WeakReference(instance); _finalizer.attach(instance, identifier, detach: instance); final PigeonProxyApiBaseClass copy = instance.pigeon_copy(); @@ -366,29 +382,29 @@ class _PigeonInstanceManagerApi { } class _PigeonProxyApiBaseCodec extends _PigeonCodec { - const _PigeonProxyApiBaseCodec(this.instanceManager); - final PigeonInstanceManager instanceManager; - @override - void writeValue(WriteBuffer buffer, Object? value) { - if (value is PigeonProxyApiBaseClass) { - buffer.putUint8(128); - writeValue(buffer, instanceManager.getIdentifier(value)); - } else { - super.writeValue(buffer, value); - } - } - @override - Object? readValueOfType(int type, ReadBuffer buffer) { - switch (type) { - case 128: - return instanceManager - .getInstanceWithWeakReference(readValue(buffer)! as int); - default: - return super.readValueOfType(type, buffer); - } - } -} + const _PigeonProxyApiBaseCodec(this.instanceManager); + final PigeonInstanceManager instanceManager; + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is PigeonProxyApiBaseClass) { + buffer.putUint8(128); + writeValue(buffer, instanceManager.getIdentifier(value)); + } else { + super.writeValue(buffer, value); + } + } + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 128: + return instanceManager + .getInstanceWithWeakReference(readValue(buffer)! as int); + default: + return super.readValueOfType(type, buffer); + } + } +} enum ProxyApiTestEnum { one, @@ -396,7 +412,6 @@ enum ProxyApiTestEnum { three, } - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -412,7 +427,7 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: final int? value = readValue(buffer) as int?; return value == null ? null : ProxyApiTestEnum.values[value]; default: @@ -420,6 +435,7 @@ class _PigeonCodec extends StandardMessageCodec { } } } + /// The core ProxyApi test class that each supported host language must /// implement in platform_tests integration tests. class ProxyApiTestClass extends ProxyApiSuperClass @@ -5166,4 +5182,3 @@ class ClassWithApiRequirement extends PigeonProxyApiBaseClass { ); } } - diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/test/test_message.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/test/test_message.gen.dart index bc796055d14a..27add3253372 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/test/test_message.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/test/test_message.gen.dart @@ -14,7 +14,6 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:shared_test_plugin_code/src/generated/message.gen.dart'; - class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override @@ -22,13 +21,13 @@ class _PigeonCodec extends StandardMessageCodec { if (value is MessageSearchRequest) { buffer.putUint8(129); writeValue(buffer, value.encode()); - } else if (value is MessageSearchReply) { + } else if (value is MessageSearchReply) { buffer.putUint8(130); writeValue(buffer, value.encode()); - } else if (value is MessageNested) { + } else if (value is MessageNested) { buffer.putUint8(131); writeValue(buffer, value.encode()); - } else if (value is MessageRequestState) { + } else if (value is MessageRequestState) { buffer.putUint8(132); writeValue(buffer, value.index); } else { @@ -39,13 +38,13 @@ class _PigeonCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 129: + case 129: return MessageSearchRequest.decode(readValue(buffer)!); - case 130: + case 130: return MessageSearchReply.decode(readValue(buffer)!); - case 131: + case 131: return MessageNested.decode(readValue(buffer)!); - case 132: + case 132: final int? value = readValue(buffer) as int?; return value == null ? null : MessageRequestState.values[value]; default: @@ -58,7 +57,8 @@ class _PigeonCodec extends StandardMessageCodec { /// /// This comment also tests multiple line comments. abstract class TestHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); /// This comment is to test documentation comments. @@ -69,39 +69,56 @@ abstract class TestHostApi { /// This comment is to test method documentation comments. MessageSearchReply search(MessageSearchRequest request); - static void setUp(TestHostApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp( + TestHostApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.MessageApi.initialize$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.MessageApi.initialize$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { try { api.initialize(); return wrapResponse(empty: true); } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } } { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.MessageApi.search$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.MessageApi.search$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MessageApi.search was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MessageApi.search was null.'); final List args = (message as List?)!; - final MessageSearchRequest? arg_request = (args[0] as MessageSearchRequest?); + final MessageSearchRequest? arg_request = + (args[0] as MessageSearchRequest?); assert(arg_request != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MessageApi.search was null, expected non-null MessageSearchRequest.'); try { @@ -109,8 +126,9 @@ abstract class TestHostApi { return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } @@ -120,7 +138,8 @@ abstract class TestHostApi { /// This comment is to test api documentation comments. abstract class TestNestedApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); /// This comment is to test method documentation comments. @@ -128,18 +147,28 @@ abstract class TestNestedApi { /// This comment also tests multiple line comments. MessageSearchReply search(MessageNested nested); - static void setUp(TestNestedApi? api, {BinaryMessenger? binaryMessenger, String messageChannelSuffix = '',}) { - messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + static void setUp( + TestNestedApi? api, { + BinaryMessenger? binaryMessenger, + String messageChannelSuffix = '', + }) { + messageChannelSuffix = + messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; { - final BasicMessageChannel __pigeon_channel = BasicMessageChannel( - 'dev.flutter.pigeon.pigeon_integration_tests.MessageNestedApi.search$messageChannelSuffix', pigeonChannelCodec, + final BasicMessageChannel __pigeon_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.MessageNestedApi.search$messageChannelSuffix', + pigeonChannelCodec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(__pigeon_channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(__pigeon_channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MessageNestedApi.search was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.MessageNestedApi.search was null.'); final List args = (message as List?)!; final MessageNested? arg_nested = (args[0] as MessageNested?); assert(arg_nested != null, @@ -149,8 +178,9 @@ abstract class TestNestedApi { return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); - } catch (e) { - return wrapResponse(error: PlatformException(code: 'error', message: e.toString())); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); } }); } diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt index 94b4e78af0cb..cd8b26c0d257 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt @@ -22,22 +22,19 @@ private fun wrapResult(result: Any?): List { private fun wrapError(exception: Throwable): List { return if (exception is FlutterError) { - listOf( - exception.code, - exception.message, - exception.details - ) + listOf(exception.code, exception.message, exception.details) } else { listOf( - exception.javaClass.simpleName, - exception.toString(), - "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) - ) + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)) } } private fun createConnectionError(channelName: String): FlutterError { - return FlutterError("channel-error", "Unable to establish connection on channel: '$channelName'.", "")} + return FlutterError( + "channel-error", "Unable to establish connection on channel: '$channelName'.", "") +} enum class AnEnum(val raw: Int) { ONE(0), @@ -58,25 +55,24 @@ enum class AnEnum(val raw: Int) { * * Generated class from Pigeon that represents data sent in messages. */ -data class AllTypes ( - val aBool: Boolean, - val anInt: Long, - val anInt64: Long, - val aDouble: Double, - val aByteArray: ByteArray, - val a4ByteArray: IntArray, - val a8ByteArray: LongArray, - val aFloatArray: DoubleArray, - val anEnum: AnEnum, - val aString: String, - val anObject: Any, - val list: List, - val stringList: List, - val intList: List, - val doubleList: List, - val boolList: List, - val map: Map - +data class AllTypes( + val aBool: Boolean, + val anInt: Long, + val anInt64: Long, + val aDouble: Double, + val aByteArray: ByteArray, + val a4ByteArray: IntArray, + val a8ByteArray: LongArray, + val aFloatArray: DoubleArray, + val anEnum: AnEnum, + val aString: String, + val anObject: Any, + val list: List, + val stringList: List, + val intList: List, + val doubleList: List, + val boolList: List, + val map: Map ) { companion object { @Suppress("LocalVariableName") @@ -98,28 +94,46 @@ data class AllTypes ( val doubleList = __pigeon_list[14] as List val boolList = __pigeon_list[15] as List val map = __pigeon_list[16] as Map - return AllTypes(aBool, anInt, anInt64, aDouble, aByteArray, a4ByteArray, a8ByteArray, aFloatArray, anEnum, aString, anObject, list, stringList, intList, doubleList, boolList, map) + return AllTypes( + aBool, + anInt, + anInt64, + aDouble, + aByteArray, + a4ByteArray, + a8ByteArray, + aFloatArray, + anEnum, + aString, + anObject, + list, + stringList, + intList, + doubleList, + boolList, + map) } } + fun toList(): List { return listOf( - aBool, - anInt, - anInt64, - aDouble, - aByteArray, - a4ByteArray, - a8ByteArray, - aFloatArray, - anEnum, - aString, - anObject, - list, - stringList, - intList, - doubleList, - boolList, - map, + aBool, + anInt, + anInt64, + aDouble, + aByteArray, + a4ByteArray, + a8ByteArray, + aFloatArray, + anEnum, + aString, + anObject, + list, + stringList, + intList, + doubleList, + boolList, + map, ) } } @@ -129,37 +143,38 @@ data class AllTypes ( * * Generated class from Pigeon that represents data sent in messages. */ -data class AllNullableTypes ( - val aNullableBool: Boolean? = null, - val aNullableInt: Long? = null, - val aNullableInt64: Long? = null, - val aNullableDouble: Double? = null, - val aNullableByteArray: ByteArray? = null, - val aNullable4ByteArray: IntArray? = null, - val aNullable8ByteArray: LongArray? = null, - val aNullableFloatArray: DoubleArray? = null, - val nullableNestedList: List?>? = null, - val nullableMapWithAnnotations: Map? = null, - val nullableMapWithObject: Map? = null, - val aNullableEnum: AnEnum? = null, - val aNullableString: String? = null, - val aNullableObject: Any? = null, - val allNullableTypes: AllNullableTypes? = null, - val list: List? = null, - val stringList: List? = null, - val intList: List? = null, - val doubleList: List? = null, - val boolList: List? = null, - val nestedClassList: List? = null, - val map: Map? = null - +data class AllNullableTypes( + val aNullableBool: Boolean? = null, + val aNullableInt: Long? = null, + val aNullableInt64: Long? = null, + val aNullableDouble: Double? = null, + val aNullableByteArray: ByteArray? = null, + val aNullable4ByteArray: IntArray? = null, + val aNullable8ByteArray: LongArray? = null, + val aNullableFloatArray: DoubleArray? = null, + val nullableNestedList: List?>? = null, + val nullableMapWithAnnotations: Map? = null, + val nullableMapWithObject: Map? = null, + val aNullableEnum: AnEnum? = null, + val aNullableString: String? = null, + val aNullableObject: Any? = null, + val allNullableTypes: AllNullableTypes? = null, + val list: List? = null, + val stringList: List? = null, + val intList: List? = null, + val doubleList: List? = null, + val boolList: List? = null, + val nestedClassList: List? = null, + val map: Map? = null ) { companion object { @Suppress("LocalVariableName") fun fromList(__pigeon_list: List): AllNullableTypes { val aNullableBool = __pigeon_list[0] as Boolean? - val aNullableInt = __pigeon_list[1].let { num -> if (num is Int) num.toLong() else num as Long? } - val aNullableInt64 = __pigeon_list[2].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableInt = + __pigeon_list[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableInt64 = + __pigeon_list[2].let { num -> if (num is Int) num.toLong() else num as Long? } val aNullableDouble = __pigeon_list[3] as Double? val aNullableByteArray = __pigeon_list[4] as ByteArray? val aNullable4ByteArray = __pigeon_list[5] as IntArray? @@ -179,73 +194,96 @@ data class AllNullableTypes ( val boolList = __pigeon_list[19] as List? val nestedClassList = __pigeon_list[20] as List? val map = __pigeon_list[21] as Map? - return AllNullableTypes(aNullableBool, aNullableInt, aNullableInt64, aNullableDouble, aNullableByteArray, aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, nullableNestedList, nullableMapWithAnnotations, nullableMapWithObject, aNullableEnum, aNullableString, aNullableObject, allNullableTypes, list, stringList, intList, doubleList, boolList, nestedClassList, map) + return AllNullableTypes( + aNullableBool, + aNullableInt, + aNullableInt64, + aNullableDouble, + aNullableByteArray, + aNullable4ByteArray, + aNullable8ByteArray, + aNullableFloatArray, + nullableNestedList, + nullableMapWithAnnotations, + nullableMapWithObject, + aNullableEnum, + aNullableString, + aNullableObject, + allNullableTypes, + list, + stringList, + intList, + doubleList, + boolList, + nestedClassList, + map) } } + fun toList(): List { return listOf( - aNullableBool, - aNullableInt, - aNullableInt64, - aNullableDouble, - aNullableByteArray, - aNullable4ByteArray, - aNullable8ByteArray, - aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, - aNullableEnum, - aNullableString, - aNullableObject, - allNullableTypes, - list, - stringList, - intList, - doubleList, - boolList, - nestedClassList, - map, + aNullableBool, + aNullableInt, + aNullableInt64, + aNullableDouble, + aNullableByteArray, + aNullable4ByteArray, + aNullable8ByteArray, + aNullableFloatArray, + nullableNestedList, + nullableMapWithAnnotations, + nullableMapWithObject, + aNullableEnum, + aNullableString, + aNullableObject, + allNullableTypes, + list, + stringList, + intList, + doubleList, + boolList, + nestedClassList, + map, ) } } /** - * The primary purpose for this class is to ensure coverage of Swift structs - * with nullable items, as the primary [AllNullableTypes] class is being used to - * test Swift classes. + * The primary purpose for this class is to ensure coverage of Swift structs with nullable items, as + * the primary [AllNullableTypes] class is being used to test Swift classes. * * Generated class from Pigeon that represents data sent in messages. */ -data class AllNullableTypesWithoutRecursion ( - val aNullableBool: Boolean? = null, - val aNullableInt: Long? = null, - val aNullableInt64: Long? = null, - val aNullableDouble: Double? = null, - val aNullableByteArray: ByteArray? = null, - val aNullable4ByteArray: IntArray? = null, - val aNullable8ByteArray: LongArray? = null, - val aNullableFloatArray: DoubleArray? = null, - val nullableNestedList: List?>? = null, - val nullableMapWithAnnotations: Map? = null, - val nullableMapWithObject: Map? = null, - val aNullableEnum: AnEnum? = null, - val aNullableString: String? = null, - val aNullableObject: Any? = null, - val list: List? = null, - val stringList: List? = null, - val intList: List? = null, - val doubleList: List? = null, - val boolList: List? = null, - val map: Map? = null - +data class AllNullableTypesWithoutRecursion( + val aNullableBool: Boolean? = null, + val aNullableInt: Long? = null, + val aNullableInt64: Long? = null, + val aNullableDouble: Double? = null, + val aNullableByteArray: ByteArray? = null, + val aNullable4ByteArray: IntArray? = null, + val aNullable8ByteArray: LongArray? = null, + val aNullableFloatArray: DoubleArray? = null, + val nullableNestedList: List?>? = null, + val nullableMapWithAnnotations: Map? = null, + val nullableMapWithObject: Map? = null, + val aNullableEnum: AnEnum? = null, + val aNullableString: String? = null, + val aNullableObject: Any? = null, + val list: List? = null, + val stringList: List? = null, + val intList: List? = null, + val doubleList: List? = null, + val boolList: List? = null, + val map: Map? = null ) { companion object { @Suppress("LocalVariableName") fun fromList(__pigeon_list: List): AllNullableTypesWithoutRecursion { val aNullableBool = __pigeon_list[0] as Boolean? - val aNullableInt = __pigeon_list[1].let { num -> if (num is Int) num.toLong() else num as Long? } - val aNullableInt64 = __pigeon_list[2].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableInt = + __pigeon_list[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableInt64 = + __pigeon_list[2].let { num -> if (num is Int) num.toLong() else num as Long? } val aNullableDouble = __pigeon_list[3] as Double? val aNullableByteArray = __pigeon_list[4] as ByteArray? val aNullable4ByteArray = __pigeon_list[5] as IntArray? @@ -263,31 +301,52 @@ data class AllNullableTypesWithoutRecursion ( val doubleList = __pigeon_list[17] as List? val boolList = __pigeon_list[18] as List? val map = __pigeon_list[19] as Map? - return AllNullableTypesWithoutRecursion(aNullableBool, aNullableInt, aNullableInt64, aNullableDouble, aNullableByteArray, aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, nullableNestedList, nullableMapWithAnnotations, nullableMapWithObject, aNullableEnum, aNullableString, aNullableObject, list, stringList, intList, doubleList, boolList, map) + return AllNullableTypesWithoutRecursion( + aNullableBool, + aNullableInt, + aNullableInt64, + aNullableDouble, + aNullableByteArray, + aNullable4ByteArray, + aNullable8ByteArray, + aNullableFloatArray, + nullableNestedList, + nullableMapWithAnnotations, + nullableMapWithObject, + aNullableEnum, + aNullableString, + aNullableObject, + list, + stringList, + intList, + doubleList, + boolList, + map) } } + fun toList(): List { return listOf( - aNullableBool, - aNullableInt, - aNullableInt64, - aNullableDouble, - aNullableByteArray, - aNullable4ByteArray, - aNullable8ByteArray, - aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, - aNullableEnum, - aNullableString, - aNullableObject, - list, - stringList, - intList, - doubleList, - boolList, - map, + aNullableBool, + aNullableInt, + aNullableInt64, + aNullableDouble, + aNullableByteArray, + aNullable4ByteArray, + aNullable8ByteArray, + aNullableFloatArray, + nullableNestedList, + nullableMapWithAnnotations, + nullableMapWithObject, + aNullableEnum, + aNullableString, + aNullableObject, + list, + stringList, + intList, + doubleList, + boolList, + map, ) } } @@ -295,17 +354,16 @@ data class AllNullableTypesWithoutRecursion ( /** * A class for testing nested class handling. * - * This is needed to test nested nullable and non-nullable classes, - * `AllNullableTypes` is non-nullable here as it is easier to instantiate - * than `AllTypes` when testing doesn't require both (ie. testing null classes). + * This is needed to test nested nullable and non-nullable classes, `AllNullableTypes` is + * non-nullable here as it is easier to instantiate than `AllTypes` when testing doesn't require + * both (ie. testing null classes). * * Generated class from Pigeon that represents data sent in messages. */ -data class AllClassesWrapper ( - val allNullableTypes: AllNullableTypes, - val allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = null, - val allTypes: AllTypes? = null - +data class AllClassesWrapper( + val allNullableTypes: AllNullableTypes, + val allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = null, + val allTypes: AllTypes? = null ) { companion object { @Suppress("LocalVariableName") @@ -316,11 +374,12 @@ data class AllClassesWrapper ( return AllClassesWrapper(allNullableTypes, allNullableTypesWithoutRecursion, allTypes) } } + fun toList(): List { return listOf( - allNullableTypes, - allNullableTypesWithoutRecursion, - allTypes, + allNullableTypes, + allNullableTypesWithoutRecursion, + allTypes, ) } } @@ -330,10 +389,8 @@ data class AllClassesWrapper ( * * Generated class from Pigeon that represents data sent in messages. */ -data class TestMessage ( - val testList: List? = null +data class TestMessage(val testList: List? = null) { -) { companion object { @Suppress("LocalVariableName") fun fromList(__pigeon_list: List): TestMessage { @@ -341,24 +398,22 @@ data class TestMessage ( return TestMessage(testList) } } + fun toList(): List { return listOf( - testList, + testList, ) } } + private open class CoreTestsPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as? List)?.let { - AllTypes.fromList(it) - } + return (readValue(buffer) as? List)?.let { AllTypes.fromList(it) } } 130.toByte() -> { - return (readValue(buffer) as? List)?.let { - AllNullableTypes.fromList(it) - } + return (readValue(buffer) as? List)?.let { AllNullableTypes.fromList(it) } } 131.toByte() -> { return (readValue(buffer) as? List)?.let { @@ -366,24 +421,19 @@ private open class CoreTestsPigeonCodec : StandardMessageCodec() { } } 132.toByte() -> { - return (readValue(buffer) as? List)?.let { - AllClassesWrapper.fromList(it) - } + return (readValue(buffer) as? List)?.let { AllClassesWrapper.fromList(it) } } 133.toByte() -> { - return (readValue(buffer) as? List)?.let { - TestMessage.fromList(it) - } + return (readValue(buffer) as? List)?.let { TestMessage.fromList(it) } } 134.toByte() -> { - return (readValue(buffer) as Int?)?.let { - AnEnum.ofRaw(it) - } + return (readValue(buffer) as Int?)?.let { AnEnum.ofRaw(it) } } else -> super.readValueOfType(type, buffer) } } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is AllTypes -> { stream.write(129) @@ -414,18 +464,14 @@ private open class CoreTestsPigeonCodec : StandardMessageCodec() { } } - /** - * The core interface that each host language plugin must implement in - * platform_test integration tests. + * The core interface that each host language plugin must implement in platform_test integration + * tests. * * Generated interface from Pigeon that represents a handler of messages from Flutter. */ interface HostIntegrationCoreApi { - /** - * A no-op function taking no arguments and returning no value, to sanity - * test basic calling. - */ + /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ fun noop() /** Returns the passed object, to test serialization and deserialization. */ fun echoAllTypes(everything: AllTypes): AllTypes @@ -464,21 +510,29 @@ interface HostIntegrationCoreApi { /** Returns the passed object, to test serialization and deserialization. */ fun echoAllNullableTypes(everything: AllNullableTypes?): AllNullableTypes? /** Returns the passed object, to test serialization and deserialization. */ - fun echoAllNullableTypesWithoutRecursion(everything: AllNullableTypesWithoutRecursion?): AllNullableTypesWithoutRecursion? + fun echoAllNullableTypesWithoutRecursion( + everything: AllNullableTypesWithoutRecursion? + ): AllNullableTypesWithoutRecursion? /** - * Returns the inner `aString` value from the wrapped object, to test - * sending of nested objects. + * Returns the inner `aString` value from the wrapped object, to test sending of nested objects. */ fun extractNestedNullableString(wrapper: AllClassesWrapper): String? /** - * Returns the inner `aString` value from the wrapped object, to test - * sending of nested objects. + * Returns the inner `aString` value from the wrapped object, to test sending of nested objects. */ fun createNestedNullableString(nullableString: String?): AllClassesWrapper /** Returns passed in arguments of multiple types. */ - fun sendMultipleNullableTypes(aNullableBool: Boolean?, aNullableInt: Long?, aNullableString: String?): AllNullableTypes + fun sendMultipleNullableTypes( + aNullableBool: Boolean?, + aNullableInt: Long?, + aNullableString: String? + ): AllNullableTypes /** Returns passed in arguments of multiple types. */ - fun sendMultipleNullableTypesWithoutRecursion(aNullableBool: Boolean?, aNullableInt: Long?, aNullableString: String?): AllNullableTypesWithoutRecursion + fun sendMultipleNullableTypesWithoutRecursion( + aNullableBool: Boolean?, + aNullableInt: Long?, + aNullableString: String? + ): AllNullableTypesWithoutRecursion /** Returns passed in int. */ fun echoNullableInt(aNullableInt: Long?): Long? /** Returns passed in double. */ @@ -495,14 +549,15 @@ interface HostIntegrationCoreApi { fun echoNullableList(aNullableList: List?): List? /** Returns the passed map, to test serialization and deserialization. */ fun echoNullableMap(aNullableMap: Map?): Map? + fun echoNullableEnum(anEnum: AnEnum?): AnEnum? /** Returns passed in int. */ fun echoOptionalNullableInt(aNullableInt: Long?): Long? /** Returns the passed in string. */ fun echoNamedNullableString(aNullableString: String?): String? /** - * A no-op function taking no arguments and returning no value, to sanity - * test basic asynchronous calling. + * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous + * calling. */ fun noopAsync(callback: (Result) -> Unit) /** Returns passed in int asynchronously. */ @@ -532,9 +587,15 @@ interface HostIntegrationCoreApi { /** Returns the passed object, to test async serialization and deserialization. */ fun echoAsyncAllTypes(everything: AllTypes, callback: (Result) -> Unit) /** Returns the passed object, to test serialization and deserialization. */ - fun echoAsyncNullableAllNullableTypes(everything: AllNullableTypes?, callback: (Result) -> Unit) + fun echoAsyncNullableAllNullableTypes( + everything: AllNullableTypes?, + callback: (Result) -> Unit + ) /** Returns the passed object, to test serialization and deserialization. */ - fun echoAsyncNullableAllNullableTypesWithoutRecursion(everything: AllNullableTypesWithoutRecursion?, callback: (Result) -> Unit) + fun echoAsyncNullableAllNullableTypesWithoutRecursion( + everything: AllNullableTypesWithoutRecursion?, + callback: (Result) -> Unit + ) /** Returns passed in int asynchronously. */ fun echoAsyncNullableInt(anInt: Long?, callback: (Result) -> Unit) /** Returns passed in double asynchronously. */ @@ -550,54 +611,112 @@ interface HostIntegrationCoreApi { /** Returns the passed list, to test asynchronous serialization and deserialization. */ fun echoAsyncNullableList(list: List?, callback: (Result?>) -> Unit) /** Returns the passed map, to test asynchronous serialization and deserialization. */ - fun echoAsyncNullableMap(aMap: Map?, callback: (Result?>) -> Unit) + fun echoAsyncNullableMap( + aMap: Map?, + callback: (Result?>) -> Unit + ) /** Returns the passed enum, to test asynchronous serialization and deserialization. */ fun echoAsyncNullableEnum(anEnum: AnEnum?, callback: (Result) -> Unit) + fun callFlutterNoop(callback: (Result) -> Unit) + fun callFlutterThrowError(callback: (Result) -> Unit) + fun callFlutterThrowErrorFromVoid(callback: (Result) -> Unit) + fun callFlutterEchoAllTypes(everything: AllTypes, callback: (Result) -> Unit) - fun callFlutterEchoAllNullableTypes(everything: AllNullableTypes?, callback: (Result) -> Unit) - fun callFlutterSendMultipleNullableTypes(aNullableBool: Boolean?, aNullableInt: Long?, aNullableString: String?, callback: (Result) -> Unit) - fun callFlutterEchoAllNullableTypesWithoutRecursion(everything: AllNullableTypesWithoutRecursion?, callback: (Result) -> Unit) - fun callFlutterSendMultipleNullableTypesWithoutRecursion(aNullableBool: Boolean?, aNullableInt: Long?, aNullableString: String?, callback: (Result) -> Unit) + + fun callFlutterEchoAllNullableTypes( + everything: AllNullableTypes?, + callback: (Result) -> Unit + ) + + fun callFlutterSendMultipleNullableTypes( + aNullableBool: Boolean?, + aNullableInt: Long?, + aNullableString: String?, + callback: (Result) -> Unit + ) + + fun callFlutterEchoAllNullableTypesWithoutRecursion( + everything: AllNullableTypesWithoutRecursion?, + callback: (Result) -> Unit + ) + + fun callFlutterSendMultipleNullableTypesWithoutRecursion( + aNullableBool: Boolean?, + aNullableInt: Long?, + aNullableString: String?, + callback: (Result) -> Unit + ) + fun callFlutterEchoBool(aBool: Boolean, callback: (Result) -> Unit) + fun callFlutterEchoInt(anInt: Long, callback: (Result) -> Unit) + fun callFlutterEchoDouble(aDouble: Double, callback: (Result) -> Unit) + fun callFlutterEchoString(aString: String, callback: (Result) -> Unit) + fun callFlutterEchoUint8List(list: ByteArray, callback: (Result) -> Unit) + fun callFlutterEchoList(list: List, callback: (Result>) -> Unit) + fun callFlutterEchoMap(aMap: Map, callback: (Result>) -> Unit) + fun callFlutterEchoEnum(anEnum: AnEnum, callback: (Result) -> Unit) + fun callFlutterEchoNullableBool(aBool: Boolean?, callback: (Result) -> Unit) + fun callFlutterEchoNullableInt(anInt: Long?, callback: (Result) -> Unit) + fun callFlutterEchoNullableDouble(aDouble: Double?, callback: (Result) -> Unit) + fun callFlutterEchoNullableString(aString: String?, callback: (Result) -> Unit) + fun callFlutterEchoNullableUint8List(list: ByteArray?, callback: (Result) -> Unit) + fun callFlutterEchoNullableList(list: List?, callback: (Result?>) -> Unit) - fun callFlutterEchoNullableMap(aMap: Map?, callback: (Result?>) -> Unit) + + fun callFlutterEchoNullableMap( + aMap: Map?, + callback: (Result?>) -> Unit + ) + fun callFlutterEchoNullableEnum(anEnum: AnEnum?, callback: (Result) -> Unit) + fun callFlutterSmallApiEchoString(aString: String, callback: (Result) -> Unit) companion object { /** The codec used by HostIntegrationCoreApi. */ - val codec: MessageCodec by lazy { - CoreTestsPigeonCodec() - } - /** Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binaryMessenger`. */ + val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } + /** + * Sets up an instance of `HostIntegrationCoreApi` to handle messages through the + * `binaryMessenger`. + */ @JvmOverloads - fun setUp(binaryMessenger: BinaryMessenger, api: HostIntegrationCoreApi?, messageChannelSuffix: String = "") { - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop$separatedMessageChannelSuffix", codec) + fun setUp( + binaryMessenger: BinaryMessenger, + api: HostIntegrationCoreApi?, + messageChannelSuffix: String = "" + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = try { - api.noop() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.noop() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -605,16 +724,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val everythingArg = args[0] as AllTypes - val wrapped: List = try { - listOf(api.echoAllTypes(everythingArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoAllTypes(everythingArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -622,14 +746,19 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = try { - listOf(api.throwError()) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.throwError()) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -637,15 +766,20 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = try { - api.throwErrorFromVoid() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.throwErrorFromVoid() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -653,14 +787,19 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = try { - listOf(api.throwFlutterError()) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.throwFlutterError()) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -668,16 +807,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val anIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = try { - listOf(api.echoInt(anIntArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoInt(anIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -685,16 +829,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aDoubleArg = args[0] as Double - val wrapped: List = try { - listOf(api.echoDouble(aDoubleArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoDouble(aDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -702,16 +851,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aBoolArg = args[0] as Boolean - val wrapped: List = try { - listOf(api.echoBool(aBoolArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoBool(aBoolArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -719,16 +873,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aStringArg = args[0] as String - val wrapped: List = try { - listOf(api.echoString(aStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoString(aStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -736,16 +895,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aUint8ListArg = args[0] as ByteArray - val wrapped: List = try { - listOf(api.echoUint8List(aUint8ListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoUint8List(aUint8ListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -753,16 +917,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val anObjectArg = args[0] as Any - val wrapped: List = try { - listOf(api.echoObject(anObjectArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoObject(anObjectArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -770,16 +939,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val listArg = args[0] as List - val wrapped: List = try { - listOf(api.echoList(listArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoList(listArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -787,16 +961,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aMapArg = args[0] as Map - val wrapped: List = try { - listOf(api.echoMap(aMapArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoMap(aMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -804,16 +983,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val wrapperArg = args[0] as AllClassesWrapper - val wrapped: List = try { - listOf(api.echoClassWrapper(wrapperArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoClassWrapper(wrapperArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -821,16 +1005,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val anEnumArg = args[0] as AnEnum - val wrapped: List = try { - listOf(api.echoEnum(anEnumArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoEnum(anEnumArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -838,16 +1027,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aStringArg = args[0] as String - val wrapped: List = try { - listOf(api.echoNamedDefaultString(aStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNamedDefaultString(aStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -855,16 +1049,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aDoubleArg = args[0] as Double - val wrapped: List = try { - listOf(api.echoOptionalDefaultDouble(aDoubleArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoOptionalDefaultDouble(aDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -872,16 +1071,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val anIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = try { - listOf(api.echoRequiredInt(anIntArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoRequiredInt(anIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -889,16 +1093,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val everythingArg = args[0] as AllNullableTypes? - val wrapped: List = try { - listOf(api.echoAllNullableTypes(everythingArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoAllNullableTypes(everythingArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -906,16 +1115,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val everythingArg = args[0] as AllNullableTypesWithoutRecursion? - val wrapped: List = try { - listOf(api.echoAllNullableTypesWithoutRecursion(everythingArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoAllNullableTypesWithoutRecursion(everythingArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -923,16 +1137,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val wrapperArg = args[0] as AllClassesWrapper - val wrapped: List = try { - listOf(api.extractNestedNullableString(wrapperArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.extractNestedNullableString(wrapperArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -940,16 +1159,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val nullableStringArg = args[0] as String? - val wrapped: List = try { - listOf(api.createNestedNullableString(nullableStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.createNestedNullableString(nullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -957,18 +1181,26 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableBoolArg = args[0] as Boolean? - val aNullableIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = + args[1].let { num -> if (num is Int) num.toLong() else num as Long? } val aNullableStringArg = args[2] as String? - val wrapped: List = try { - listOf(api.sendMultipleNullableTypes(aNullableBoolArg, aNullableIntArg, aNullableStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf( + api.sendMultipleNullableTypes( + aNullableBoolArg, aNullableIntArg, aNullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -976,18 +1208,26 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableBoolArg = args[0] as Boolean? - val aNullableIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = + args[1].let { num -> if (num is Int) num.toLong() else num as Long? } val aNullableStringArg = args[2] as String? - val wrapped: List = try { - listOf(api.sendMultipleNullableTypesWithoutRecursion(aNullableBoolArg, aNullableIntArg, aNullableStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf( + api.sendMultipleNullableTypesWithoutRecursion( + aNullableBoolArg, aNullableIntArg, aNullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -995,16 +1235,22 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long? } - val wrapped: List = try { - listOf(api.echoNullableInt(aNullableIntArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val aNullableIntArg = + args[0].let { num -> if (num is Int) num.toLong() else num as Long? } + val wrapped: List = + try { + listOf(api.echoNullableInt(aNullableIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1012,16 +1258,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableDoubleArg = args[0] as Double? - val wrapped: List = try { - listOf(api.echoNullableDouble(aNullableDoubleArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableDouble(aNullableDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1029,16 +1280,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableBoolArg = args[0] as Boolean? - val wrapped: List = try { - listOf(api.echoNullableBool(aNullableBoolArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableBool(aNullableBoolArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1046,16 +1302,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableStringArg = args[0] as String? - val wrapped: List = try { - listOf(api.echoNullableString(aNullableStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableString(aNullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1063,16 +1324,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableUint8ListArg = args[0] as ByteArray? - val wrapped: List = try { - listOf(api.echoNullableUint8List(aNullableUint8ListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableUint8List(aNullableUint8ListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1080,16 +1346,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableObjectArg = args[0] - val wrapped: List = try { - listOf(api.echoNullableObject(aNullableObjectArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableObject(aNullableObjectArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1097,16 +1368,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableListArg = args[0] as List? - val wrapped: List = try { - listOf(api.echoNullableList(aNullableListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableList(aNullableListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1114,16 +1390,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableMapArg = args[0] as Map? - val wrapped: List = try { - listOf(api.echoNullableMap(aNullableMapArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableMap(aNullableMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1131,16 +1412,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val anEnumArg = args[0] as AnEnum? - val wrapped: List = try { - listOf(api.echoNullableEnum(anEnumArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableEnum(anEnumArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1148,16 +1434,22 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long? } - val wrapped: List = try { - listOf(api.echoOptionalNullableInt(aNullableIntArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val aNullableIntArg = + args[0].let { num -> if (num is Int) num.toLong() else num as Long? } + val wrapped: List = + try { + listOf(api.echoOptionalNullableInt(aNullableIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1165,16 +1457,21 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableStringArg = args[0] as String? - val wrapped: List = try { - listOf(api.echoNamedNullableString(aNullableStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNamedNullableString(aNullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1182,10 +1479,14 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.noopAsync{ result: Result -> + api.noopAsync { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1199,7 +1500,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1219,7 +1524,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1239,7 +1548,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1259,7 +1572,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1279,7 +1596,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1299,7 +1620,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1319,7 +1644,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1339,7 +1668,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1359,7 +1692,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1379,10 +1716,14 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.throwAsyncError{ result: Result -> + api.throwAsyncError { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1397,10 +1738,14 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.throwAsyncErrorFromVoid{ result: Result -> + api.throwAsyncErrorFromVoid { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1414,10 +1759,14 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.throwAsyncFlutterError{ result: Result -> + api.throwAsyncFlutterError { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1432,7 +1781,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1452,12 +1805,17 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val everythingArg = args[0] as AllNullableTypes? - api.echoAsyncNullableAllNullableTypes(everythingArg) { result: Result -> + api.echoAsyncNullableAllNullableTypes(everythingArg) { result: Result + -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1472,12 +1830,17 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val everythingArg = args[0] as AllNullableTypesWithoutRecursion? - api.echoAsyncNullableAllNullableTypesWithoutRecursion(everythingArg) { result: Result -> + api.echoAsyncNullableAllNullableTypesWithoutRecursion(everythingArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1492,7 +1855,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1512,7 +1879,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1532,7 +1903,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1552,7 +1927,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1572,7 +1951,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1592,7 +1975,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1612,7 +1999,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1632,7 +2023,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1652,7 +2047,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1672,10 +2071,14 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.callFlutterNoop{ result: Result -> + api.callFlutterNoop { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1689,10 +2092,14 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.callFlutterThrowError{ result: Result -> + api.callFlutterThrowError { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1707,10 +2114,14 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.callFlutterThrowErrorFromVoid{ result: Result -> + api.callFlutterThrowErrorFromVoid { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1724,7 +2135,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1744,12 +2159,17 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val everythingArg = args[0] as AllNullableTypes? - api.callFlutterEchoAllNullableTypes(everythingArg) { result: Result -> + api.callFlutterEchoAllNullableTypes(everythingArg) { result: Result + -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1764,34 +2184,46 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableBoolArg = args[0] as Boolean? - val aNullableIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = + args[1].let { num -> if (num is Int) num.toLong() else num as Long? } val aNullableStringArg = args[2] as String? - api.callFlutterSendMultipleNullableTypes(aNullableBoolArg, aNullableIntArg, aNullableStringArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + api.callFlutterSendMultipleNullableTypes( + aNullableBoolArg, aNullableIntArg, aNullableStringArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } } } else { channel.setMessageHandler(null) } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val everythingArg = args[0] as AllNullableTypesWithoutRecursion? - api.callFlutterEchoAllNullableTypesWithoutRecursion(everythingArg) { result: Result -> + api.callFlutterEchoAllNullableTypesWithoutRecursion(everythingArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1806,29 +2238,40 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aNullableBoolArg = args[0] as Boolean? - val aNullableIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = + args[1].let { num -> if (num is Int) num.toLong() else num as Long? } val aNullableStringArg = args[2] as String? - api.callFlutterSendMultipleNullableTypesWithoutRecursion(aNullableBoolArg, aNullableIntArg, aNullableStringArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } + api.callFlutterSendMultipleNullableTypesWithoutRecursion( + aNullableBoolArg, aNullableIntArg, aNullableStringArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } } } else { channel.setMessageHandler(null) } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1848,7 +2291,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1868,7 +2315,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1888,7 +2339,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1908,7 +2363,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1928,7 +2387,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1948,7 +2411,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1968,7 +2435,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1988,7 +2459,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2008,7 +2483,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2028,7 +2507,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2048,7 +2531,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2068,7 +2555,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2088,7 +2579,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2108,7 +2603,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2128,7 +2627,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2148,7 +2651,11 @@ interface HostIntegrationCoreApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2171,26 +2678,25 @@ interface HostIntegrationCoreApi { } } /** - * The core interface that the Dart platform_test code implements for host - * integration tests to call into. + * The core interface that the Dart platform_test code implements for host integration tests to call + * into. * * Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. */ -class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, private val messageChannelSuffix: String = "") { +class FlutterIntegrationCoreApi( + private val binaryMessenger: BinaryMessenger, + private val messageChannelSuffix: String = "" +) { companion object { /** The codec used by FlutterIntegrationCoreApi. */ - val codec: MessageCodec by lazy { - CoreTestsPigeonCodec() - } + val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } } - /** - * A no-op function taking no arguments and returning no value, to sanity - * test basic calling. - */ - fun noop(callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop$separatedMessageChannelSuffix" + /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ + fun noop(callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(null) { if (it is List<*>) { @@ -2201,14 +2707,15 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, pr } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Responds with an error from an async function returning a value. */ - fun throwError(callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError$separatedMessageChannelSuffix" + fun throwError(callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(null) { if (it is List<*>) { @@ -2220,14 +2727,15 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, pr } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Responds with an error from an async void function. */ - fun throwErrorFromVoid(callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid$separatedMessageChannelSuffix" + fun throwErrorFromVoid(callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(null) { if (it is List<*>) { @@ -2238,35 +2746,45 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, pr } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed object, to test serialization and deserialization. */ - fun echoAllTypes(everythingArg: AllTypes, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes$separatedMessageChannelSuffix" + fun echoAllTypes(everythingArg: AllTypes, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(everythingArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as AllTypes callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed object, to test serialization and deserialization. */ - fun echoAllNullableTypes(everythingArg: AllNullableTypes?, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes$separatedMessageChannelSuffix" + fun echoAllNullableTypes( + everythingArg: AllNullableTypes?, + callback: (Result) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(everythingArg)) { if (it is List<*>) { @@ -2278,7 +2796,7 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, pr } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** @@ -2286,31 +2804,46 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, pr * * Tests multiple-arity FlutterApi handling. */ - fun sendMultipleNullableTypes(aNullableBoolArg: Boolean?, aNullableIntArg: Long?, aNullableStringArg: String?, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes$separatedMessageChannelSuffix" + fun sendMultipleNullableTypes( + aNullableBoolArg: Boolean?, + aNullableIntArg: Long?, + aNullableStringArg: String?, + callback: (Result) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aNullableBoolArg, aNullableIntArg, aNullableStringArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as AllNullableTypes callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed object, to test serialization and deserialization. */ - fun echoAllNullableTypesWithoutRecursion(everythingArg: AllNullableTypesWithoutRecursion?, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix" + fun echoAllNullableTypesWithoutRecursion( + everythingArg: AllNullableTypesWithoutRecursion?, + callback: (Result) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(everythingArg)) { if (it is List<*>) { @@ -2322,7 +2855,7 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, pr } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** @@ -2330,199 +2863,259 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, pr * * Tests multiple-arity FlutterApi handling. */ - fun sendMultipleNullableTypesWithoutRecursion(aNullableBoolArg: Boolean?, aNullableIntArg: Long?, aNullableStringArg: String?, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix" + fun sendMultipleNullableTypesWithoutRecursion( + aNullableBoolArg: Boolean?, + aNullableIntArg: Long?, + aNullableStringArg: String?, + callback: (Result) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aNullableBoolArg, aNullableIntArg, aNullableStringArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as AllNullableTypesWithoutRecursion callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed boolean, to test serialization and deserialization. */ - fun echoBool(aBoolArg: Boolean, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool$separatedMessageChannelSuffix" + fun echoBool(aBoolArg: Boolean, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aBoolArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as Boolean callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed int, to test serialization and deserialization. */ - fun echoInt(anIntArg: Long, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt$separatedMessageChannelSuffix" + fun echoInt(anIntArg: Long, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(anIntArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0].let { num -> if (num is Int) num.toLong() else num as Long } callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed double, to test serialization and deserialization. */ - fun echoDouble(aDoubleArg: Double, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble$separatedMessageChannelSuffix" + fun echoDouble(aDoubleArg: Double, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aDoubleArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as Double callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed string, to test serialization and deserialization. */ - fun echoString(aStringArg: String, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString$separatedMessageChannelSuffix" + fun echoString(aStringArg: String, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aStringArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as String callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed byte list, to test serialization and deserialization. */ - fun echoUint8List(listArg: ByteArray, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List$separatedMessageChannelSuffix" + fun echoUint8List(listArg: ByteArray, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(listArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as ByteArray callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed list, to test serialization and deserialization. */ - fun echoList(listArg: List, callback: (Result>) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList$separatedMessageChannelSuffix" + fun echoList(listArg: List, callback: (Result>) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(listArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as List callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed map, to test serialization and deserialization. */ - fun echoMap(aMapArg: Map, callback: (Result>) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap$separatedMessageChannelSuffix" + fun echoMap(aMapArg: Map, callback: (Result>) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aMapArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as Map callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed enum to test serialization and deserialization. */ - fun echoEnum(anEnumArg: AnEnum, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum$separatedMessageChannelSuffix" + fun echoEnum(anEnumArg: AnEnum, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(anEnumArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as AnEnum callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed boolean, to test serialization and deserialization. */ - fun echoNullableBool(aBoolArg: Boolean?, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool$separatedMessageChannelSuffix" + fun echoNullableBool(aBoolArg: Boolean?, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aBoolArg)) { if (it is List<*>) { @@ -2534,14 +3127,15 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, pr } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed int, to test serialization and deserialization. */ - fun echoNullableInt(anIntArg: Long?, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt$separatedMessageChannelSuffix" + fun echoNullableInt(anIntArg: Long?, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(anIntArg)) { if (it is List<*>) { @@ -2553,14 +3147,15 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, pr } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed double, to test serialization and deserialization. */ - fun echoNullableDouble(aDoubleArg: Double?, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble$separatedMessageChannelSuffix" + fun echoNullableDouble(aDoubleArg: Double?, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aDoubleArg)) { if (it is List<*>) { @@ -2572,14 +3167,15 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, pr } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed string, to test serialization and deserialization. */ - fun echoNullableString(aStringArg: String?, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString$separatedMessageChannelSuffix" + fun echoNullableString(aStringArg: String?, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aStringArg)) { if (it is List<*>) { @@ -2591,14 +3187,15 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, pr } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed byte list, to test serialization and deserialization. */ - fun echoNullableUint8List(listArg: ByteArray?, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List$separatedMessageChannelSuffix" + fun echoNullableUint8List(listArg: ByteArray?, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(listArg)) { if (it is List<*>) { @@ -2610,14 +3207,15 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, pr } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed list, to test serialization and deserialization. */ - fun echoNullableList(listArg: List?, callback: (Result?>) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList$separatedMessageChannelSuffix" + fun echoNullableList(listArg: List?, callback: (Result?>) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(listArg)) { if (it is List<*>) { @@ -2629,14 +3227,18 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, pr } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed map, to test serialization and deserialization. */ - fun echoNullableMap(aMapArg: Map?, callback: (Result?>) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap$separatedMessageChannelSuffix" + fun echoNullableMap( + aMapArg: Map?, + callback: (Result?>) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aMapArg)) { if (it is List<*>) { @@ -2648,14 +3250,15 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, pr } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed enum to test serialization and deserialization. */ - fun echoNullableEnum(anEnumArg: AnEnum?, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum$separatedMessageChannelSuffix" + fun echoNullableEnum(anEnumArg: AnEnum?, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(anEnumArg)) { if (it is List<*>) { @@ -2667,17 +3270,18 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, pr } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * A no-op function taking no arguments and returning no value, to sanity - * test basic asynchronous calling. + * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous + * calling. */ - fun noopAsync(callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync$separatedMessageChannelSuffix" + fun noopAsync(callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(null) { if (it is List<*>) { @@ -2688,28 +3292,34 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger, pr } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed in generic Object asynchronously. */ - fun echoAsyncString(aStringArg: String, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString$separatedMessageChannelSuffix" + fun echoAsyncString(aStringArg: String, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aStringArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as String callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } } @@ -2723,23 +3333,31 @@ interface HostTrivialApi { companion object { /** The codec used by HostTrivialApi. */ - val codec: MessageCodec by lazy { - CoreTestsPigeonCodec() - } + val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } /** Sets up an instance of `HostTrivialApi` to handle messages through the `binaryMessenger`. */ @JvmOverloads - fun setUp(binaryMessenger: BinaryMessenger, api: HostTrivialApi?, messageChannelSuffix: String = "") { - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop$separatedMessageChannelSuffix", codec) + fun setUp( + binaryMessenger: BinaryMessenger, + api: HostTrivialApi?, + messageChannelSuffix: String = "" + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = try { - api.noop() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.noop() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2756,19 +3374,27 @@ interface HostTrivialApi { */ interface HostSmallApi { fun echo(aString: String, callback: (Result) -> Unit) + fun voidVoid(callback: (Result) -> Unit) companion object { /** The codec used by HostSmallApi. */ - val codec: MessageCodec by lazy { - CoreTestsPigeonCodec() - } + val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } /** Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. */ @JvmOverloads - fun setUp(binaryMessenger: BinaryMessenger, api: HostSmallApi?, messageChannelSuffix: String = "") { - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + fun setUp( + binaryMessenger: BinaryMessenger, + api: HostSmallApi?, + messageChannelSuffix: String = "" + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2788,10 +3414,14 @@ interface HostSmallApi { } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid$separatedMessageChannelSuffix", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid$separatedMessageChannelSuffix", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.voidVoid{ result: Result -> + api.voidVoid { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2812,51 +3442,66 @@ interface HostSmallApi { * * Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. */ -class FlutterSmallApi(private val binaryMessenger: BinaryMessenger, private val messageChannelSuffix: String = "") { +class FlutterSmallApi( + private val binaryMessenger: BinaryMessenger, + private val messageChannelSuffix: String = "" +) { companion object { /** The codec used by FlutterSmallApi. */ - val codec: MessageCodec by lazy { - CoreTestsPigeonCodec() - } + val codec: MessageCodec by lazy { CoreTestsPigeonCodec() } } - fun echoWrappedList(msgArg: TestMessage, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList$separatedMessageChannelSuffix" + + fun echoWrappedList(msgArg: TestMessage, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(msgArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as TestMessage callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun echoString(aStringArg: String, callback: (Result) -> Unit) -{ - val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString$separatedMessageChannelSuffix" + + fun echoString(aStringArg: String, callback: (Result) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(aStringArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as String callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } } diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index aec0f93af621..d460c004861d 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -22,52 +22,52 @@ private fun wrapResult(result: Any?): List { private fun wrapError(exception: Throwable): List { return if (exception is ProxyApiTestsError) { - listOf( - exception.code, - exception.message, - exception.details - ) + listOf(exception.code, exception.message, exception.details) } else { listOf( - exception.javaClass.simpleName, - exception.toString(), - "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) - ) + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)) } } private fun createConnectionError(channelName: String): ProxyApiTestsError { - return ProxyApiTestsError("channel-error", "Unable to establish connection on channel: '$channelName'.", "")} + return ProxyApiTestsError( + "channel-error", "Unable to establish connection on channel: '$channelName'.", "") +} /** * Error class for passing custom error details to Flutter via a thrown PlatformException. + * * @property code The error code. * @property message The error message. * @property details The error details. Must be a datatype supported by the api codec. */ -class ProxyApiTestsError ( - val code: String, - override val message: String? = null, - val details: Any? = null +class ProxyApiTestsError( + val code: String, + override val message: String? = null, + val details: Any? = null ) : Throwable() /** * Maintains instances used to communicate with the corresponding objects in Dart. * - * Objects stored in this container are represented by an object in Dart that is also stored in - * an InstanceManager with the same identifier. + * Objects stored in this container are represented by an object in Dart that is also stored in an + * InstanceManager with the same identifier. * * When an instance is added with an identifier, either can be used to retrieve the other. * - * Added instances are added as a weak reference and a strong reference. When the strong - * reference is removed with [remove] and the weak reference is deallocated, the - * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the strong - * reference is removed and then the identifier is retrieved with the intention to pass the identifier - * to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the instance - * is recreated. The strong reference will then need to be removed manually again. + * Added instances are added as a weak reference and a strong reference. When the strong reference + * is removed with [remove] and the weak reference is deallocated, the + * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the + * strong reference is removed and then the identifier is retrieved with the intention to pass the + * identifier to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the + * instance is recreated. The strong reference will then need to be removed manually again. */ @Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") -class ProxyApiTestsPigeonInstanceManager(private val finalizationListener: PigeonFinalizationListener) { - /** Interface for listening when a weak reference of an instance is removed from the manager. */ +class ProxyApiTestsPigeonInstanceManager( + private val finalizationListener: PigeonFinalizationListener +) { + /** Interface for listening when a weak reference of an instance is removed from the manager. */ interface PigeonFinalizationListener { fun onFinalize(identifier: Long) } @@ -93,10 +93,7 @@ class ProxyApiTestsPigeonInstanceManager(private val finalizationListener: Pigeo } init { - handler.postDelayed( - { releaseAllFinalizedInstances() }, - clearFinalizedWeakReferencesInterval - ) + handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) } companion object { @@ -108,19 +105,20 @@ class ProxyApiTestsPigeonInstanceManager(private val finalizationListener: Pigeo private const val tag = "PigeonInstanceManager" /** - * Instantiate a new manager with a listener for garbage collected weak - * references. + * Instantiate a new manager with a listener for garbage collected weak references. * * When the manager is no longer needed, [stopFinalizationListener] must be called. */ - fun create(finalizationListener: PigeonFinalizationListener): ProxyApiTestsPigeonInstanceManager { + fun create( + finalizationListener: PigeonFinalizationListener + ): ProxyApiTestsPigeonInstanceManager { return ProxyApiTestsPigeonInstanceManager(finalizationListener) } } /** - * Removes `identifier` and return its associated strongly referenced instance, if present, - * from the manager. + * Removes `identifier` and return its associated strongly referenced instance, if present, from + * the manager. */ fun remove(identifier: Long): T? { logWarningIfFinalizationListenerHasStopped() @@ -130,15 +128,13 @@ class ProxyApiTestsPigeonInstanceManager(private val finalizationListener: Pigeo /** * Retrieves the identifier paired with an instance, if present, otherwise `null`. * - * * If the manager contains a strong reference to `instance`, it will return the identifier * associated with `instance`. If the manager contains only a weak reference to `instance`, a new * strong reference to `instance` will be added and will need to be removed again with [remove]. * - * * If this method returns a nonnull identifier, this method also expects the Dart - * `ProxyApiTestsPigeonInstanceManager` to have, or recreate, a weak reference to the Dart instance the - * identifier is associated with. + * `ProxyApiTestsPigeonInstanceManager` to have, or recreate, a weak reference to the Dart + * instance the identifier is associated with. */ fun getIdentifierForStrongReference(instance: Any?): Long? { logWarningIfFinalizationListenerHasStopped() @@ -152,9 +148,9 @@ class ProxyApiTestsPigeonInstanceManager(private val finalizationListener: Pigeo /** * Adds a new instance that was instantiated from Dart. * - * The same instance can be added multiple times, but each identifier must be unique. This - * allows two objects that are equivalent (e.g. the `equals` method returns true and their - * hashcodes are equal) to both be added. + * The same instance can be added multiple times, but each identifier must be unique. This allows + * two objects that are equivalent (e.g. the `equals` method returns true and their hashcodes are + * equal) to both be added. * * [identifier] must be >= 0 and unique. */ @@ -170,7 +166,9 @@ class ProxyApiTestsPigeonInstanceManager(private val finalizationListener: Pigeo */ fun addHostCreatedInstance(instance: Any): Long { logWarningIfFinalizationListenerHasStopped() - require(!containsInstance(instance)) { "Instance of ${instance.javaClass} has already been added." } + require(!containsInstance(instance)) { + "Instance of ${instance.javaClass} has already been added." + } val identifier = nextIdentifier++ addInstance(instance, identifier) return identifier @@ -228,7 +226,8 @@ class ProxyApiTestsPigeonInstanceManager(private val finalizationListener: Pigeo return } var reference: java.lang.ref.WeakReference? - while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != null) { + while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != + null) { val identifier = weakReferencesToIdentifiers.remove(reference) if (identifier != null) { weakInstances.remove(identifier) @@ -236,10 +235,7 @@ class ProxyApiTestsPigeonInstanceManager(private val finalizationListener: Pigeo finalizationListener.onFinalize(identifier) } } - handler.postDelayed( - { releaseAllFinalizedInstances() }, - clearFinalizedWeakReferencesInterval - ) + handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) } private fun addInstance(instance: Any, identifier: Long) { @@ -257,39 +253,43 @@ class ProxyApiTestsPigeonInstanceManager(private val finalizationListener: Pigeo private fun logWarningIfFinalizationListenerHasStopped() { if (hasFinalizationListenerStopped()) { Log.w( - tag, - "The manager was used after calls to the PigeonFinalizationListener has been stopped." - ) + tag, + "The manager was used after calls to the PigeonFinalizationListener has been stopped.") } } } - -/**Generated API for managing the Dart and native `PigeonInstanceManager`s. */ +/** Generated API for managing the Dart and native `PigeonInstanceManager`s. */ private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { companion object { - /**The codec used by ProxyApiTestsPigeonInstanceManagerApi. */ - val codec: MessageCodec by lazy { - StandardMessageCodec() - } + /** The codec used by ProxyApiTestsPigeonInstanceManagerApi. */ + val codec: MessageCodec by lazy { StandardMessageCodec() } /** * Sets up an instance of `ProxyApiTestsPigeonInstanceManagerApi` to handle messages from the * `binaryMessenger`. */ - fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, instanceManager: ProxyApiTestsPigeonInstanceManager?) { + fun setUpMessageHandlers( + binaryMessenger: BinaryMessenger, + instanceManager: ProxyApiTestsPigeonInstanceManager? + ) { run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.removeStrongReference", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.removeStrongReference", + codec) if (instanceManager != null) { channel.setMessageHandler { message, reply -> val args = message as List val identifierArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = try { - instanceManager.remove(identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + instanceManager.remove(identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -297,15 +297,20 @@ private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryM } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.clear", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.clear", + codec) if (instanceManager != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = try { - instanceManager.clear() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + instanceManager.clear() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -315,26 +320,28 @@ private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryM } } - fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) -{ - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.removeStrongReference" + fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) { + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInstanceManagerApi.removeStrongReference" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } } /** - * Provides implementations for each ProxyApi implementation and provides access to resources - * needed by any implementation. + * Provides implementations for each ProxyApi implementation and provides access to resources needed + * by any implementation. */ abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { val instanceManager: ProxyApiTestsPigeonInstanceManager @@ -349,20 +356,19 @@ abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryM init { val api = ProxyApiTestsPigeonInstanceManagerApi(binaryMessenger) - instanceManager = ProxyApiTestsPigeonInstanceManager.create( - object : ProxyApiTestsPigeonInstanceManager.PigeonFinalizationListener { - override fun onFinalize(identifier: Long) { - api.removeStrongReference(identifier) { - if (it.isFailure) { - Log.e( - "PigeonProxyApiRegistrar", - "Failed to remove Dart strong reference with identifier: $identifier" - ) - } - } - } - } - ) + instanceManager = + ProxyApiTestsPigeonInstanceManager.create( + object : ProxyApiTestsPigeonInstanceManager.PigeonFinalizationListener { + override fun onFinalize(identifier: Long) { + api.removeStrongReference(identifier) { + if (it.isFailure) { + Log.e( + "PigeonProxyApiRegistrar", + "Failed to remove Dart strong reference with identifier: $identifier") + } + } + } + }) } /** * An implementation of [PigeonApiProxyApiTestClass] used to add a new Dart instance of @@ -380,8 +386,7 @@ abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryM * An implementation of [PigeonApiProxyApiInterface] used to add a new Dart instance of * `ProxyApiInterface` to the Dart `InstanceManager`. */ - open fun getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface - { + open fun getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { return PigeonApiProxyApiInterface(this) } @@ -393,10 +398,14 @@ abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryM fun setUp() { ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager) - PigeonApiProxyApiTestClass.setUpMessageHandlers(binaryMessenger, getPigeonApiProxyApiTestClass()) - PigeonApiProxyApiSuperClass.setUpMessageHandlers(binaryMessenger, getPigeonApiProxyApiSuperClass()) - PigeonApiClassWithApiRequirement.setUpMessageHandlers(binaryMessenger, getPigeonApiClassWithApiRequirement()) + PigeonApiProxyApiTestClass.setUpMessageHandlers( + binaryMessenger, getPigeonApiProxyApiTestClass()) + PigeonApiProxyApiSuperClass.setUpMessageHandlers( + binaryMessenger, getPigeonApiProxyApiSuperClass()) + PigeonApiClassWithApiRequirement.setUpMessageHandlers( + binaryMessenger, getPigeonApiClassWithApiRequirement()) } + fun tearDown() { ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null) PigeonApiProxyApiTestClass.setUpMessageHandlers(binaryMessenger, null) @@ -404,7 +413,10 @@ abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryM PigeonApiClassWithApiRequirement.setUpMessageHandlers(binaryMessenger, null) } } -private class ProxyApiTestsPigeonProxyApiBaseCodec(val registrar: ProxyApiTestsPigeonProxyApiRegistrar) : ProxyApiTestsPigeonCodec() { + +private class ProxyApiTestsPigeonProxyApiBaseCodec( + val registrar: ProxyApiTestsPigeonProxyApiRegistrar +) : ProxyApiTestsPigeonCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { @@ -417,16 +429,13 @@ private class ProxyApiTestsPigeonProxyApiBaseCodec(val registrar: ProxyApiTestsP override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { if (value is ProxyApiTestClass) { - registrar.getPigeonApiProxyApiTestClass().pigeon_newInstance(value) { } - } - else if (value is com.example.test_plugin.ProxyApiSuperClass) { - registrar.getPigeonApiProxyApiSuperClass().pigeon_newInstance(value) { } - } - else if (value is ProxyApiInterface) { - registrar.getPigeonApiProxyApiInterface().pigeon_newInstance(value) { } - } - else if (android.os.Build.VERSION.SDK_INT >= 25 && value is ClassWithApiRequirement) { - registrar.getPigeonApiClassWithApiRequirement().pigeon_newInstance(value) { } + registrar.getPigeonApiProxyApiTestClass().pigeon_newInstance(value) {} + } else if (value is com.example.test_plugin.ProxyApiSuperClass) { + registrar.getPigeonApiProxyApiSuperClass().pigeon_newInstance(value) {} + } else if (value is ProxyApiInterface) { + registrar.getPigeonApiProxyApiInterface().pigeon_newInstance(value) {} + } else if (android.os.Build.VERSION.SDK_INT >= 25 && value is ClassWithApiRequirement) { + registrar.getPigeonApiClassWithApiRequirement().pigeon_newInstance(value) {} } when { @@ -450,18 +459,18 @@ enum class ProxyApiTestEnum(val raw: Int) { } } } + private open class ProxyApiTestsPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as Int?)?.let { - ProxyApiTestEnum.ofRaw(it) - } + return (readValue(buffer) as Int?)?.let { ProxyApiTestEnum.ofRaw(it) } } else -> super.readValueOfType(type, buffer) } } - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { when (value) { is ProxyApiTestEnum -> { stream.write(129) @@ -473,14 +482,55 @@ private open class ProxyApiTestsPigeonCodec : StandardMessageCodec() { } /** - * The core ProxyApi test class that each supported host language must - * implement in platform_tests integration tests. + * The core ProxyApi test class that each supported host language must implement in platform_tests + * integration tests. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { - abstract fun pigeon_defaultConstructor(aBool: Boolean, anInt: Long, aDouble: Double, aString: String, aUint8List: ByteArray, aList: List, aMap: Map, anEnum: ProxyApiTestEnum, aProxyApi: com.example.test_plugin.ProxyApiSuperClass, aNullableBool: Boolean?, aNullableInt: Long?, aNullableDouble: Double?, aNullableString: String?, aNullableUint8List: ByteArray?, aNullableList: List?, aNullableMap: Map?, aNullableEnum: ProxyApiTestEnum?, aNullableProxyApi: com.example.test_plugin.ProxyApiSuperClass?, boolParam: Boolean, intParam: Long, doubleParam: Double, stringParam: String, aUint8ListParam: ByteArray, listParam: List, mapParam: Map, enumParam: ProxyApiTestEnum, proxyApiParam: com.example.test_plugin.ProxyApiSuperClass, nullableBoolParam: Boolean?, nullableIntParam: Long?, nullableDoubleParam: Double?, nullableStringParam: String?, nullableUint8ListParam: ByteArray?, nullableListParam: List?, nullableMapParam: Map?, nullableEnumParam: ProxyApiTestEnum?, nullableProxyApiParam: com.example.test_plugin.ProxyApiSuperClass?): ProxyApiTestClass - - abstract fun attachedField(pigeon_instance: ProxyApiTestClass): com.example.test_plugin.ProxyApiSuperClass +abstract class PigeonApiProxyApiTestClass( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar +) { + abstract fun pigeon_defaultConstructor( + aBool: Boolean, + anInt: Long, + aDouble: Double, + aString: String, + aUint8List: ByteArray, + aList: List, + aMap: Map, + anEnum: ProxyApiTestEnum, + aProxyApi: com.example.test_plugin.ProxyApiSuperClass, + aNullableBool: Boolean?, + aNullableInt: Long?, + aNullableDouble: Double?, + aNullableString: String?, + aNullableUint8List: ByteArray?, + aNullableList: List?, + aNullableMap: Map?, + aNullableEnum: ProxyApiTestEnum?, + aNullableProxyApi: com.example.test_plugin.ProxyApiSuperClass?, + boolParam: Boolean, + intParam: Long, + doubleParam: Double, + stringParam: String, + aUint8ListParam: ByteArray, + listParam: List, + mapParam: Map, + enumParam: ProxyApiTestEnum, + proxyApiParam: com.example.test_plugin.ProxyApiSuperClass, + nullableBoolParam: Boolean?, + nullableIntParam: Long?, + nullableDoubleParam: Double?, + nullableStringParam: String?, + nullableUint8ListParam: ByteArray?, + nullableListParam: List?, + nullableMapParam: Map?, + nullableEnumParam: ProxyApiTestEnum?, + nullableProxyApiParam: com.example.test_plugin.ProxyApiSuperClass? + ): ProxyApiTestClass + + abstract fun attachedField( + pigeon_instance: ProxyApiTestClass + ): com.example.test_plugin.ProxyApiSuperClass abstract fun staticAttachedField(): com.example.test_plugin.ProxyApiSuperClass @@ -500,7 +550,9 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest abstract fun anEnum(pigeon_instance: ProxyApiTestClass): ProxyApiTestEnum - abstract fun aProxyApi(pigeon_instance: ProxyApiTestClass): com.example.test_plugin.ProxyApiSuperClass + abstract fun aProxyApi( + pigeon_instance: ProxyApiTestClass + ): com.example.test_plugin.ProxyApiSuperClass abstract fun aNullableBool(pigeon_instance: ProxyApiTestClass): Boolean? @@ -518,12 +570,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest abstract fun aNullableEnum(pigeon_instance: ProxyApiTestClass): ProxyApiTestEnum? - abstract fun aNullableProxyApi(pigeon_instance: ProxyApiTestClass): com.example.test_plugin.ProxyApiSuperClass? + abstract fun aNullableProxyApi( + pigeon_instance: ProxyApiTestClass + ): com.example.test_plugin.ProxyApiSuperClass? - /** - * A no-op function taking no arguments and returning no value, to sanity - * test basic calling. - */ + /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ abstract fun noop(pigeon_instance: ProxyApiTestClass) /** Returns an error, to test error handling. */ @@ -556,124 +607,235 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest /** Returns the passed list, to test serialization and deserialization. */ abstract fun echoList(pigeon_instance: ProxyApiTestClass, aList: List): List - /** - * Returns the passed list with ProxyApis, to test serialization and - * deserialization. - */ - abstract fun echoProxyApiList(pigeon_instance: ProxyApiTestClass, aList: List): List + /** Returns the passed list with ProxyApis, to test serialization and deserialization. */ + abstract fun echoProxyApiList( + pigeon_instance: ProxyApiTestClass, + aList: List + ): List /** Returns the passed map, to test serialization and deserialization. */ - abstract fun echoMap(pigeon_instance: ProxyApiTestClass, aMap: Map): Map + abstract fun echoMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map + ): Map - /** - * Returns the passed map with ProxyApis, to test serialization and - * deserialization. - */ - abstract fun echoProxyApiMap(pigeon_instance: ProxyApiTestClass, aMap: Map): Map + /** Returns the passed map with ProxyApis, to test serialization and deserialization. */ + abstract fun echoProxyApiMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map + ): Map /** Returns the passed enum to test serialization and deserialization. */ - abstract fun echoEnum(pigeon_instance: ProxyApiTestClass, anEnum: ProxyApiTestEnum): ProxyApiTestEnum + abstract fun echoEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum + ): ProxyApiTestEnum /** Returns the passed ProxyApi to test serialization and deserialization. */ - abstract fun echoProxyApi(pigeon_instance: ProxyApiTestClass, aProxyApi: com.example.test_plugin.ProxyApiSuperClass): com.example.test_plugin.ProxyApiSuperClass + abstract fun echoProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: com.example.test_plugin.ProxyApiSuperClass + ): com.example.test_plugin.ProxyApiSuperClass /** Returns passed in int. */ abstract fun echoNullableInt(pigeon_instance: ProxyApiTestClass, aNullableInt: Long?): Long? /** Returns passed in double. */ - abstract fun echoNullableDouble(pigeon_instance: ProxyApiTestClass, aNullableDouble: Double?): Double? + abstract fun echoNullableDouble( + pigeon_instance: ProxyApiTestClass, + aNullableDouble: Double? + ): Double? /** Returns the passed in boolean. */ - abstract fun echoNullableBool(pigeon_instance: ProxyApiTestClass, aNullableBool: Boolean?): Boolean? + abstract fun echoNullableBool( + pigeon_instance: ProxyApiTestClass, + aNullableBool: Boolean? + ): Boolean? /** Returns the passed in string. */ - abstract fun echoNullableString(pigeon_instance: ProxyApiTestClass, aNullableString: String?): String? + abstract fun echoNullableString( + pigeon_instance: ProxyApiTestClass, + aNullableString: String? + ): String? /** Returns the passed in Uint8List. */ - abstract fun echoNullableUint8List(pigeon_instance: ProxyApiTestClass, aNullableUint8List: ByteArray?): ByteArray? + abstract fun echoNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aNullableUint8List: ByteArray? + ): ByteArray? /** Returns the passed in generic Object. */ abstract fun echoNullableObject(pigeon_instance: ProxyApiTestClass, aNullableObject: Any?): Any? /** Returns the passed list, to test serialization and deserialization. */ - abstract fun echoNullableList(pigeon_instance: ProxyApiTestClass, aNullableList: List?): List? + abstract fun echoNullableList( + pigeon_instance: ProxyApiTestClass, + aNullableList: List? + ): List? /** Returns the passed map, to test serialization and deserialization. */ - abstract fun echoNullableMap(pigeon_instance: ProxyApiTestClass, aNullableMap: Map?): Map? + abstract fun echoNullableMap( + pigeon_instance: ProxyApiTestClass, + aNullableMap: Map? + ): Map? - abstract fun echoNullableEnum(pigeon_instance: ProxyApiTestClass, aNullableEnum: ProxyApiTestEnum?): ProxyApiTestEnum? + abstract fun echoNullableEnum( + pigeon_instance: ProxyApiTestClass, + aNullableEnum: ProxyApiTestEnum? + ): ProxyApiTestEnum? /** Returns the passed ProxyApi to test serialization and deserialization. */ - abstract fun echoNullableProxyApi(pigeon_instance: ProxyApiTestClass, aNullableProxyApi: com.example.test_plugin.ProxyApiSuperClass?): com.example.test_plugin.ProxyApiSuperClass? + abstract fun echoNullableProxyApi( + pigeon_instance: ProxyApiTestClass, + aNullableProxyApi: com.example.test_plugin.ProxyApiSuperClass? + ): com.example.test_plugin.ProxyApiSuperClass? /** - * A no-op function taking no arguments and returning no value, to sanity - * test basic asynchronous calling. + * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous + * calling. */ abstract fun noopAsync(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) /** Returns passed in int asynchronously. */ - abstract fun echoAsyncInt(pigeon_instance: ProxyApiTestClass, anInt: Long, callback: (Result) -> Unit) + abstract fun echoAsyncInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long, + callback: (Result) -> Unit + ) /** Returns passed in double asynchronously. */ - abstract fun echoAsyncDouble(pigeon_instance: ProxyApiTestClass, aDouble: Double, callback: (Result) -> Unit) + abstract fun echoAsyncDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double, + callback: (Result) -> Unit + ) /** Returns the passed in boolean asynchronously. */ - abstract fun echoAsyncBool(pigeon_instance: ProxyApiTestClass, aBool: Boolean, callback: (Result) -> Unit) + abstract fun echoAsyncBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean, + callback: (Result) -> Unit + ) /** Returns the passed string asynchronously. */ - abstract fun echoAsyncString(pigeon_instance: ProxyApiTestClass, aString: String, callback: (Result) -> Unit) + abstract fun echoAsyncString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) /** Returns the passed in Uint8List asynchronously. */ - abstract fun echoAsyncUint8List(pigeon_instance: ProxyApiTestClass, aUint8List: ByteArray, callback: (Result) -> Unit) + abstract fun echoAsyncUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray, + callback: (Result) -> Unit + ) /** Returns the passed in generic Object asynchronously. */ - abstract fun echoAsyncObject(pigeon_instance: ProxyApiTestClass, anObject: Any, callback: (Result) -> Unit) + abstract fun echoAsyncObject( + pigeon_instance: ProxyApiTestClass, + anObject: Any, + callback: (Result) -> Unit + ) /** Returns the passed list, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncList(pigeon_instance: ProxyApiTestClass, aList: List, callback: (Result>) -> Unit) + abstract fun echoAsyncList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) /** Returns the passed map, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncMap(pigeon_instance: ProxyApiTestClass, aMap: Map, callback: (Result>) -> Unit) + abstract fun echoAsyncMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) /** Returns the passed enum, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncEnum(pigeon_instance: ProxyApiTestClass, anEnum: ProxyApiTestEnum, callback: (Result) -> Unit) + abstract fun echoAsyncEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, + callback: (Result) -> Unit + ) /** Responds with an error from an async function returning a value. */ abstract fun throwAsyncError(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) /** Responds with an error from an async void function. */ - abstract fun throwAsyncErrorFromVoid(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) + abstract fun throwAsyncErrorFromVoid( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) /** Responds with a Flutter error from an async function returning a value. */ - abstract fun throwAsyncFlutterError(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) + abstract fun throwAsyncFlutterError( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) /** Returns passed in int asynchronously. */ - abstract fun echoAsyncNullableInt(pigeon_instance: ProxyApiTestClass, anInt: Long?, callback: (Result) -> Unit) + abstract fun echoAsyncNullableInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long?, + callback: (Result) -> Unit + ) /** Returns passed in double asynchronously. */ - abstract fun echoAsyncNullableDouble(pigeon_instance: ProxyApiTestClass, aDouble: Double?, callback: (Result) -> Unit) + abstract fun echoAsyncNullableDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double?, + callback: (Result) -> Unit + ) /** Returns the passed in boolean asynchronously. */ - abstract fun echoAsyncNullableBool(pigeon_instance: ProxyApiTestClass, aBool: Boolean?, callback: (Result) -> Unit) + abstract fun echoAsyncNullableBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean?, + callback: (Result) -> Unit + ) /** Returns the passed string asynchronously. */ - abstract fun echoAsyncNullableString(pigeon_instance: ProxyApiTestClass, aString: String?, callback: (Result) -> Unit) + abstract fun echoAsyncNullableString( + pigeon_instance: ProxyApiTestClass, + aString: String?, + callback: (Result) -> Unit + ) /** Returns the passed in Uint8List asynchronously. */ - abstract fun echoAsyncNullableUint8List(pigeon_instance: ProxyApiTestClass, aUint8List: ByteArray?, callback: (Result) -> Unit) + abstract fun echoAsyncNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray?, + callback: (Result) -> Unit + ) /** Returns the passed in generic Object asynchronously. */ - abstract fun echoAsyncNullableObject(pigeon_instance: ProxyApiTestClass, anObject: Any?, callback: (Result) -> Unit) + abstract fun echoAsyncNullableObject( + pigeon_instance: ProxyApiTestClass, + anObject: Any?, + callback: (Result) -> Unit + ) /** Returns the passed list, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncNullableList(pigeon_instance: ProxyApiTestClass, aList: List?, callback: (Result?>) -> Unit) + abstract fun echoAsyncNullableList( + pigeon_instance: ProxyApiTestClass, + aList: List?, + callback: (Result?>) -> Unit + ) /** Returns the passed map, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncNullableMap(pigeon_instance: ProxyApiTestClass, aMap: Map?, callback: (Result?>) -> Unit) + abstract fun echoAsyncNullableMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map?, + callback: (Result?>) -> Unit + ) /** Returns the passed enum, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncNullableEnum(pigeon_instance: ProxyApiTestClass, anEnum: ProxyApiTestEnum?, callback: (Result) -> Unit) + abstract fun echoAsyncNullableEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, + callback: (Result) -> Unit + ) abstract fun staticNoop() @@ -683,64 +845,162 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest abstract fun callFlutterNoop(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) - abstract fun callFlutterThrowError(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) - - abstract fun callFlutterThrowErrorFromVoid(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) - - abstract fun callFlutterEchoBool(pigeon_instance: ProxyApiTestClass, aBool: Boolean, callback: (Result) -> Unit) - - abstract fun callFlutterEchoInt(pigeon_instance: ProxyApiTestClass, anInt: Long, callback: (Result) -> Unit) - - abstract fun callFlutterEchoDouble(pigeon_instance: ProxyApiTestClass, aDouble: Double, callback: (Result) -> Unit) - - abstract fun callFlutterEchoString(pigeon_instance: ProxyApiTestClass, aString: String, callback: (Result) -> Unit) - - abstract fun callFlutterEchoUint8List(pigeon_instance: ProxyApiTestClass, aUint8List: ByteArray, callback: (Result) -> Unit) - - abstract fun callFlutterEchoList(pigeon_instance: ProxyApiTestClass, aList: List, callback: (Result>) -> Unit) - - abstract fun callFlutterEchoProxyApiList(pigeon_instance: ProxyApiTestClass, aList: List, callback: (Result>) -> Unit) - - abstract fun callFlutterEchoMap(pigeon_instance: ProxyApiTestClass, aMap: Map, callback: (Result>) -> Unit) - - abstract fun callFlutterEchoProxyApiMap(pigeon_instance: ProxyApiTestClass, aMap: Map, callback: (Result>) -> Unit) - - abstract fun callFlutterEchoEnum(pigeon_instance: ProxyApiTestClass, anEnum: ProxyApiTestEnum, callback: (Result) -> Unit) - - abstract fun callFlutterEchoProxyApi(pigeon_instance: ProxyApiTestClass, aProxyApi: com.example.test_plugin.ProxyApiSuperClass, callback: (Result) -> Unit) - - abstract fun callFlutterEchoNullableBool(pigeon_instance: ProxyApiTestClass, aBool: Boolean?, callback: (Result) -> Unit) - - abstract fun callFlutterEchoNullableInt(pigeon_instance: ProxyApiTestClass, anInt: Long?, callback: (Result) -> Unit) - - abstract fun callFlutterEchoNullableDouble(pigeon_instance: ProxyApiTestClass, aDouble: Double?, callback: (Result) -> Unit) - - abstract fun callFlutterEchoNullableString(pigeon_instance: ProxyApiTestClass, aString: String?, callback: (Result) -> Unit) - - abstract fun callFlutterEchoNullableUint8List(pigeon_instance: ProxyApiTestClass, aUint8List: ByteArray?, callback: (Result) -> Unit) - - abstract fun callFlutterEchoNullableList(pigeon_instance: ProxyApiTestClass, aList: List?, callback: (Result?>) -> Unit) - - abstract fun callFlutterEchoNullableMap(pigeon_instance: ProxyApiTestClass, aMap: Map?, callback: (Result?>) -> Unit) - - abstract fun callFlutterEchoNullableEnum(pigeon_instance: ProxyApiTestClass, anEnum: ProxyApiTestEnum?, callback: (Result) -> Unit) - - abstract fun callFlutterEchoNullableProxyApi(pigeon_instance: ProxyApiTestClass, aProxyApi: com.example.test_plugin.ProxyApiSuperClass?, callback: (Result) -> Unit) - - abstract fun callFlutterNoopAsync(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) - - abstract fun callFlutterEchoAsyncString(pigeon_instance: ProxyApiTestClass, aString: String, callback: (Result) -> Unit) + abstract fun callFlutterThrowError( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + abstract fun callFlutterThrowErrorFromVoid( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) + + abstract fun callFlutterEchoProxyApiList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) + + abstract fun callFlutterEchoMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) + + abstract fun callFlutterEchoProxyApiMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) + + abstract fun callFlutterEchoEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: com.example.test_plugin.ProxyApiSuperClass, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableString( + pigeon_instance: ProxyApiTestClass, + aString: String?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableList( + pigeon_instance: ProxyApiTestClass, + aList: List?, + callback: (Result?>) -> Unit + ) + + abstract fun callFlutterEchoNullableMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map?, + callback: (Result?>) -> Unit + ) + + abstract fun callFlutterEchoNullableEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: com.example.test_plugin.ProxyApiSuperClass?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterNoopAsync( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoAsyncString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) companion object { @Suppress("LocalVariableName") fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiTestClass?) { val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val pigeon_identifierArg = + args[0].let { num -> if (num is Int) num.toLong() else num as Long } val aBoolArg = args[1] as Boolean val anIntArg = args[2].let { num -> if (num is Int) num.toLong() else num as Long } val aDoubleArg = args[3] as Double @@ -751,7 +1011,8 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest val anEnumArg = args[8] as ProxyApiTestEnum val aProxyApiArg = args[9] as com.example.test_plugin.ProxyApiSuperClass val aNullableBoolArg = args[10] as Boolean? - val aNullableIntArg = args[11].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = + args[11].let { num -> if (num is Int) num.toLong() else num as Long? } val aNullableDoubleArg = args[12] as Double? val aNullableStringArg = args[13] as String? val aNullableUint8ListArg = args[14] as ByteArray? @@ -769,7 +1030,8 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest val enumParamArg = args[26] as ProxyApiTestEnum val proxyApiParamArg = args[27] as com.example.test_plugin.ProxyApiSuperClass val nullableBoolParamArg = args[28] as Boolean? - val nullableIntParamArg = args[29].let { num -> if (num is Int) num.toLong() else num as Long? } + val nullableIntParamArg = + args[29].let { num -> if (num is Int) num.toLong() else num as Long? } val nullableDoubleParamArg = args[30] as Double? val nullableStringParamArg = args[31] as String? val nullableUint8ListParamArg = args[32] as ByteArray? @@ -777,12 +1039,51 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest val nullableMapParamArg = args[34] as Map? val nullableEnumParamArg = args[35] as ProxyApiTestEnum? val nullableProxyApiParamArg = args[36] as com.example.test_plugin.ProxyApiSuperClass? - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(aBoolArg,anIntArg,aDoubleArg,aStringArg,aUint8ListArg,aListArg,aMapArg,anEnumArg,aProxyApiArg,aNullableBoolArg,aNullableIntArg,aNullableDoubleArg,aNullableStringArg,aNullableUint8ListArg,aNullableListArg,aNullableMapArg,aNullableEnumArg,aNullableProxyApiArg,boolParamArg,intParamArg,doubleParamArg,stringParamArg,aUint8ListParamArg,listParamArg,mapParamArg,enumParamArg,proxyApiParamArg,nullableBoolParamArg,nullableIntParamArg,nullableDoubleParamArg,nullableStringParamArg,nullableUint8ListParamArg,nullableListParamArg,nullableMapParamArg,nullableEnumParamArg,nullableProxyApiParamArg), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor( + aBoolArg, + anIntArg, + aDoubleArg, + aStringArg, + aUint8ListArg, + aListArg, + aMapArg, + anEnumArg, + aProxyApiArg, + aNullableBoolArg, + aNullableIntArg, + aNullableDoubleArg, + aNullableStringArg, + aNullableUint8ListArg, + aNullableListArg, + aNullableMapArg, + aNullableEnumArg, + aNullableProxyApiArg, + boolParamArg, + intParamArg, + doubleParamArg, + stringParamArg, + aUint8ListParamArg, + listParamArg, + mapParamArg, + enumParamArg, + proxyApiParamArg, + nullableBoolParamArg, + nullableIntParamArg, + nullableDoubleParamArg, + nullableStringParamArg, + nullableUint8ListParamArg, + nullableListParamArg, + nullableMapParamArg, + nullableEnumParamArg, + nullableProxyApiParamArg), + pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -790,18 +1091,25 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.attachedField", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.attachedField", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val pigeon_identifierArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.attachedField(pigeon_instanceArg), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val pigeon_identifierArg = + args[1].let { num -> if (num is Int) num.toLong() else num as Long } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.attachedField(pigeon_instanceArg), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -809,17 +1117,24 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAttachedField", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAttachedField", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.staticAttachedField(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val pigeon_identifierArg = + args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.staticAttachedField(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -827,17 +1142,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noop", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noop", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val wrapped: List = try { - api.noop(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.noop(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -845,16 +1165,21 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwError", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwError", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val wrapped: List = try { - listOf(api.throwError(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.throwError(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -862,17 +1187,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwErrorFromVoid", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwErrorFromVoid", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val wrapped: List = try { - api.throwErrorFromVoid(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.throwErrorFromVoid(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -880,16 +1210,21 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwFlutterError", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwFlutterError", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val wrapped: List = try { - listOf(api.throwFlutterError(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.throwFlutterError(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -897,17 +1232,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoInt", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoInt", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val anIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = try { - listOf(api.echoInt(pigeon_instanceArg, anIntArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoInt(pigeon_instanceArg, anIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -915,17 +1255,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoDouble", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoDouble", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aDoubleArg = args[1] as Double - val wrapped: List = try { - listOf(api.echoDouble(pigeon_instanceArg, aDoubleArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoDouble(pigeon_instanceArg, aDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -933,17 +1278,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoBool", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoBool", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aBoolArg = args[1] as Boolean - val wrapped: List = try { - listOf(api.echoBool(pigeon_instanceArg, aBoolArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoBool(pigeon_instanceArg, aBoolArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -951,17 +1301,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoString", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoString", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aStringArg = args[1] as String - val wrapped: List = try { - listOf(api.echoString(pigeon_instanceArg, aStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoString(pigeon_instanceArg, aStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -969,17 +1324,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoUint8List", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoUint8List", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aUint8ListArg = args[1] as ByteArray - val wrapped: List = try { - listOf(api.echoUint8List(pigeon_instanceArg, aUint8ListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoUint8List(pigeon_instanceArg, aUint8ListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -987,17 +1347,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoObject", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoObject", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val anObjectArg = args[1] as Any - val wrapped: List = try { - listOf(api.echoObject(pigeon_instanceArg, anObjectArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoObject(pigeon_instanceArg, anObjectArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1005,17 +1370,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoList", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoList", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aListArg = args[1] as List - val wrapped: List = try { - listOf(api.echoList(pigeon_instanceArg, aListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoList(pigeon_instanceArg, aListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1023,17 +1393,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiList", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiList", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aListArg = args[1] as List - val wrapped: List = try { - listOf(api.echoProxyApiList(pigeon_instanceArg, aListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoProxyApiList(pigeon_instanceArg, aListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1041,17 +1416,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoMap", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoMap", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aMapArg = args[1] as Map - val wrapped: List = try { - listOf(api.echoMap(pigeon_instanceArg, aMapArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoMap(pigeon_instanceArg, aMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1059,17 +1439,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiMap", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiMap", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aMapArg = args[1] as Map - val wrapped: List = try { - listOf(api.echoProxyApiMap(pigeon_instanceArg, aMapArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoProxyApiMap(pigeon_instanceArg, aMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1077,17 +1462,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoEnum", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoEnum", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val anEnumArg = args[1] as ProxyApiTestEnum - val wrapped: List = try { - listOf(api.echoEnum(pigeon_instanceArg, anEnumArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoEnum(pigeon_instanceArg, anEnumArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1095,17 +1485,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApi", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApi", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass - val wrapped: List = try { - listOf(api.echoProxyApi(pigeon_instanceArg, aProxyApiArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoProxyApi(pigeon_instanceArg, aProxyApiArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1113,17 +1508,23 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableInt", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableInt", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aNullableIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long? } - val wrapped: List = try { - listOf(api.echoNullableInt(pigeon_instanceArg, aNullableIntArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val aNullableIntArg = + args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val wrapped: List = + try { + listOf(api.echoNullableInt(pigeon_instanceArg, aNullableIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1131,17 +1532,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableDouble", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableDouble", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableDoubleArg = args[1] as Double? - val wrapped: List = try { - listOf(api.echoNullableDouble(pigeon_instanceArg, aNullableDoubleArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableDouble(pigeon_instanceArg, aNullableDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1149,17 +1555,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableBool", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableBool", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableBoolArg = args[1] as Boolean? - val wrapped: List = try { - listOf(api.echoNullableBool(pigeon_instanceArg, aNullableBoolArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableBool(pigeon_instanceArg, aNullableBoolArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1167,17 +1578,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableString", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableString", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableStringArg = args[1] as String? - val wrapped: List = try { - listOf(api.echoNullableString(pigeon_instanceArg, aNullableStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableString(pigeon_instanceArg, aNullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1185,17 +1601,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableUint8List", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableUint8List", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableUint8ListArg = args[1] as ByteArray? - val wrapped: List = try { - listOf(api.echoNullableUint8List(pigeon_instanceArg, aNullableUint8ListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableUint8List(pigeon_instanceArg, aNullableUint8ListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1203,17 +1624,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableObject", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableObject", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableObjectArg = args[1] - val wrapped: List = try { - listOf(api.echoNullableObject(pigeon_instanceArg, aNullableObjectArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableObject(pigeon_instanceArg, aNullableObjectArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1221,17 +1647,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableList", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableList", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableListArg = args[1] as List? - val wrapped: List = try { - listOf(api.echoNullableList(pigeon_instanceArg, aNullableListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableList(pigeon_instanceArg, aNullableListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1239,17 +1670,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableMap", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableMap", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableMapArg = args[1] as Map? - val wrapped: List = try { - listOf(api.echoNullableMap(pigeon_instanceArg, aNullableMapArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableMap(pigeon_instanceArg, aNullableMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1257,17 +1693,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableEnum", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableEnum", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableEnumArg = args[1] as ProxyApiTestEnum? - val wrapped: List = try { - listOf(api.echoNullableEnum(pigeon_instanceArg, aNullableEnumArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableEnum(pigeon_instanceArg, aNullableEnumArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1275,17 +1716,22 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableProxyApi", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableProxyApi", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aNullableProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass? - val wrapped: List = try { - listOf(api.echoNullableProxyApi(pigeon_instanceArg, aNullableProxyApiArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoNullableProxyApi(pigeon_instanceArg, aNullableProxyApiArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1293,7 +1739,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noopAsync", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noopAsync", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1312,7 +1762,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncInt", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncInt", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1333,7 +1787,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncDouble", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncDouble", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1354,7 +1812,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncBool", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncBool", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1375,7 +1837,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncString", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncString", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1396,7 +1862,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncUint8List", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncUint8List", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1417,7 +1887,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncObject", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncObject", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1438,7 +1912,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncList", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncList", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1459,7 +1937,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncMap", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncMap", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1480,7 +1962,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncEnum", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncEnum", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1501,7 +1987,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncError", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncError", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1521,7 +2011,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncErrorFromVoid", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncErrorFromVoid", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1540,7 +2034,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncFlutterError", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncFlutterError", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1560,7 +2058,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableInt", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableInt", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1581,7 +2083,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableDouble", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableDouble", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1602,7 +2108,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableBool", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableBool", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1623,7 +2133,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableString", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableString", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1644,13 +2158,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableUint8List", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableUint8List", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aUint8ListArg = args[1] as ByteArray? - api.echoAsyncNullableUint8List(pigeon_instanceArg, aUint8ListArg) { result: Result -> + api.echoAsyncNullableUint8List(pigeon_instanceArg, aUint8ListArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1665,7 +2184,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableObject", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableObject", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1686,7 +2209,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableList", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableList", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1707,13 +2234,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableMap", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableMap", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aMapArg = args[1] as Map? - api.echoAsyncNullableMap(pigeon_instanceArg, aMapArg) { result: Result?> -> + api.echoAsyncNullableMap(pigeon_instanceArg, aMapArg) { + result: Result?> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1728,13 +2260,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableEnum", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableEnum", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val anEnumArg = args[1] as ProxyApiTestEnum? - api.echoAsyncNullableEnum(pigeon_instanceArg, anEnumArg) { result: Result -> + api.echoAsyncNullableEnum(pigeon_instanceArg, anEnumArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1749,15 +2286,20 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticNoop", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticNoop", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - val wrapped: List = try { - api.staticNoop() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.staticNoop() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1765,16 +2307,21 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoStaticString", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoStaticString", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val aStringArg = args[0] as String - val wrapped: List = try { - listOf(api.echoStaticString(aStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + listOf(api.echoStaticString(aStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -1782,10 +2329,14 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAsyncNoop", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAsyncNoop", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - api.staticAsyncNoop{ result: Result -> + api.staticAsyncNoop { result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1799,7 +2350,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoop", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoop", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1818,7 +2373,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowError", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowError", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1838,7 +2397,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowErrorFromVoid", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowErrorFromVoid", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1857,7 +2420,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoBool", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoBool", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1878,7 +2445,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoInt", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoInt", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1899,7 +2470,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoDouble", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoDouble", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1920,7 +2495,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoString", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoString", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1941,13 +2520,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoUint8List", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoUint8List", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aUint8ListArg = args[1] as ByteArray - api.callFlutterEchoUint8List(pigeon_instanceArg, aUint8ListArg) { result: Result -> + api.callFlutterEchoUint8List(pigeon_instanceArg, aUint8ListArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1962,7 +2546,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoList", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoList", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -1983,13 +2571,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiList", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiList", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aListArg = args[1] as List - api.callFlutterEchoProxyApiList(pigeon_instanceArg, aListArg) { result: Result> -> + api.callFlutterEchoProxyApiList(pigeon_instanceArg, aListArg) { + result: Result> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2004,13 +2597,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoMap", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoMap", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aMapArg = args[1] as Map - api.callFlutterEchoMap(pigeon_instanceArg, aMapArg) { result: Result> -> + api.callFlutterEchoMap(pigeon_instanceArg, aMapArg) { result: Result> + -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2025,13 +2623,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiMap", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiMap", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aMapArg = args[1] as Map - api.callFlutterEchoProxyApiMap(pigeon_instanceArg, aMapArg) { result: Result> -> + api.callFlutterEchoProxyApiMap(pigeon_instanceArg, aMapArg) { + result: Result> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2046,13 +2649,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoEnum", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoEnum", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val anEnumArg = args[1] as ProxyApiTestEnum - api.callFlutterEchoEnum(pigeon_instanceArg, anEnumArg) { result: Result -> + api.callFlutterEchoEnum(pigeon_instanceArg, anEnumArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2067,13 +2675,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApi", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApi", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass - api.callFlutterEchoProxyApi(pigeon_instanceArg, aProxyApiArg) { result: Result -> + api.callFlutterEchoProxyApi(pigeon_instanceArg, aProxyApiArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2088,13 +2701,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableBool", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableBool", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aBoolArg = args[1] as Boolean? - api.callFlutterEchoNullableBool(pigeon_instanceArg, aBoolArg) { result: Result -> + api.callFlutterEchoNullableBool(pigeon_instanceArg, aBoolArg) { result: Result + -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2109,7 +2727,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableInt", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableInt", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2130,13 +2752,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableDouble", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableDouble", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aDoubleArg = args[1] as Double? - api.callFlutterEchoNullableDouble(pigeon_instanceArg, aDoubleArg) { result: Result -> + api.callFlutterEchoNullableDouble(pigeon_instanceArg, aDoubleArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2151,13 +2778,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableString", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableString", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aStringArg = args[1] as String? - api.callFlutterEchoNullableString(pigeon_instanceArg, aStringArg) { result: Result -> + api.callFlutterEchoNullableString(pigeon_instanceArg, aStringArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2172,13 +2804,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableUint8List", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableUint8List", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aUint8ListArg = args[1] as ByteArray? - api.callFlutterEchoNullableUint8List(pigeon_instanceArg, aUint8ListArg) { result: Result -> + api.callFlutterEchoNullableUint8List(pigeon_instanceArg, aUint8ListArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2193,13 +2830,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableList", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableList", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aListArg = args[1] as List? - api.callFlutterEchoNullableList(pigeon_instanceArg, aListArg) { result: Result?> -> + api.callFlutterEchoNullableList(pigeon_instanceArg, aListArg) { + result: Result?> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2214,13 +2856,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableMap", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableMap", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aMapArg = args[1] as Map? - api.callFlutterEchoNullableMap(pigeon_instanceArg, aMapArg) { result: Result?> -> + api.callFlutterEchoNullableMap(pigeon_instanceArg, aMapArg) { + result: Result?> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2235,13 +2882,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableEnum", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableEnum", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val anEnumArg = args[1] as ProxyApiTestEnum? - api.callFlutterEchoNullableEnum(pigeon_instanceArg, anEnumArg) { result: Result -> + api.callFlutterEchoNullableEnum(pigeon_instanceArg, anEnumArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2256,13 +2908,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableProxyApi", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableProxyApi", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass? - api.callFlutterEchoNullableProxyApi(pigeon_instanceArg, aProxyApiArg) { result: Result -> + api.callFlutterEchoNullableProxyApi(pigeon_instanceArg, aProxyApiArg) { + result: Result -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2277,7 +2934,11 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoopAsync", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoopAsync", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List @@ -2296,13 +2957,18 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoAsyncString", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoAsyncString", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass val aStringArg = args[1] as String - api.callFlutterEchoAsyncString(pigeon_instanceArg, aStringArg) { result: Result -> + api.callFlutterEchoAsyncString(pigeon_instanceArg, aStringArg) { result: Result + -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2320,14 +2986,14 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest } @Suppress("LocalVariableName", "FunctionName") - /**Creates a Dart instance of ProxyApiTestClass and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) -{ + /** Creates a Dart instance of ProxyApiTestClass and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val aBoolArg = aBool(pigeon_instanceArg) val anIntArg = anInt(pigeon_instanceArg) val aDoubleArg = aDouble(pigeon_instanceArg) @@ -2348,27 +3014,46 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest val aNullableProxyApiArg = aNullableProxyApi(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg, aBoolArg, anIntArg, aDoubleArg, aStringArg, aUint8ListArg, aListArg, aMapArg, anEnumArg, aProxyApiArg, aNullableBoolArg, aNullableIntArg, aNullableDoubleArg, aNullableStringArg, aNullableUint8ListArg, aNullableListArg, aNullableMapArg, aNullableEnumArg, aNullableProxyApiArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) + channel.send( + listOf( + pigeon_identifierArg, + aBoolArg, + anIntArg, + aDoubleArg, + aStringArg, + aUint8ListArg, + aListArg, + aMapArg, + anEnumArg, + aProxyApiArg, + aNullableBoolArg, + aNullableIntArg, + aNullableDoubleArg, + aNullableStringArg, + aNullableUint8ListArg, + aNullableListArg, + aNullableMapArg, + aNullableEnumArg, + aNullableProxyApiArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(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))) - } - } } - /** - * A no-op function taking no arguments and returning no value, to sanity - * test basic calling. - */ - fun flutterNoop(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) -{ + /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ + fun flutterNoop(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoop" @@ -2376,83 +3061,106 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Responds with an error from an async function returning a value. */ - fun flutterThrowError(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) -{ + fun flutterThrowError(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowError" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowError" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Responds with an error from an async void function. */ - fun flutterThrowErrorFromVoid(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) -{ + fun flutterThrowErrorFromVoid( + pigeon_instanceArg: ProxyApiTestClass, + callback: (Result) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowErrorFromVoid" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowErrorFromVoid" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed boolean, to test serialization and deserialization. */ - fun flutterEchoBool(pigeon_instanceArg: ProxyApiTestClass, aBoolArg: Boolean, callback: (Result) -> Unit) -{ + fun flutterEchoBool( + pigeon_instanceArg: ProxyApiTestClass, + aBoolArg: Boolean, + callback: (Result) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoBool" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoBool" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aBoolArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as Boolean callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed int, to test serialization and deserialization. */ - fun flutterEchoInt(pigeon_instanceArg: ProxyApiTestClass, anIntArg: Long, callback: (Result) -> Unit) -{ + fun flutterEchoInt( + pigeon_instanceArg: ProxyApiTestClass, + anIntArg: Long, + callback: (Result) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoInt" @@ -2460,140 +3168,202 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest channel.send(listOf(pigeon_instanceArg, anIntArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0].let { num -> if (num is Int) num.toLong() else num as Long } callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed double, to test serialization and deserialization. */ - fun flutterEchoDouble(pigeon_instanceArg: ProxyApiTestClass, aDoubleArg: Double, callback: (Result) -> Unit) -{ + fun flutterEchoDouble( + pigeon_instanceArg: ProxyApiTestClass, + aDoubleArg: Double, + callback: (Result) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoDouble" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoDouble" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aDoubleArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as Double callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed string, to test serialization and deserialization. */ - fun flutterEchoString(pigeon_instanceArg: ProxyApiTestClass, aStringArg: String, callback: (Result) -> Unit) -{ + fun flutterEchoString( + pigeon_instanceArg: ProxyApiTestClass, + aStringArg: String, + callback: (Result) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoString" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoString" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aStringArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as String callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed byte list, to test serialization and deserialization. */ - fun flutterEchoUint8List(pigeon_instanceArg: ProxyApiTestClass, aListArg: ByteArray, callback: (Result) -> Unit) -{ + fun flutterEchoUint8List( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: ByteArray, + callback: (Result) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoUint8List" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoUint8List" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aListArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as ByteArray callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed list, to test serialization and deserialization. */ - fun flutterEchoList(pigeon_instanceArg: ProxyApiTestClass, aListArg: List, callback: (Result>) -> Unit) -{ + fun flutterEchoList( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: List, + callback: (Result>) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoList" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoList" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aListArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as List callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - /** - * Returns the passed list with ProxyApis, to test serialization and - * deserialization. - */ - fun flutterEchoProxyApiList(pigeon_instanceArg: ProxyApiTestClass, aListArg: List, callback: (Result>) -> Unit) -{ + /** Returns the passed list with ProxyApis, to test serialization and deserialization. */ + fun flutterEchoProxyApiList( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: List, + callback: (Result>) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiList" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiList" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aListArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as List callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed map, to test serialization and deserialization. */ - fun flutterEchoMap(pigeon_instanceArg: ProxyApiTestClass, aMapArg: Map, callback: (Result>) -> Unit) -{ + fun flutterEchoMap( + pigeon_instanceArg: ProxyApiTestClass, + aMapArg: Map, + callback: (Result>) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoMap" @@ -2601,344 +3371,447 @@ abstract class PigeonApiProxyApiTestClass(open val pigeonRegistrar: ProxyApiTest channel.send(listOf(pigeon_instanceArg, aMapArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as Map callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - /** - * Returns the passed map with ProxyApis, to test serialization and - * deserialization. - */ - fun flutterEchoProxyApiMap(pigeon_instanceArg: ProxyApiTestClass, aMapArg: Map, callback: (Result>) -> Unit) -{ + /** Returns the passed map with ProxyApis, to test serialization and deserialization. */ + fun flutterEchoProxyApiMap( + pigeon_instanceArg: ProxyApiTestClass, + aMapArg: Map, + callback: (Result>) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiMap" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiMap" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aMapArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as Map callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed enum to test serialization and deserialization. */ - fun flutterEchoEnum(pigeon_instanceArg: ProxyApiTestClass, anEnumArg: ProxyApiTestEnum, callback: (Result) -> Unit) -{ + fun flutterEchoEnum( + pigeon_instanceArg: ProxyApiTestClass, + anEnumArg: ProxyApiTestEnum, + callback: (Result) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoEnum" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoEnum" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, anEnumArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as ProxyApiTestEnum callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed ProxyApi to test serialization and deserialization. */ - fun flutterEchoProxyApi(pigeon_instanceArg: ProxyApiTestClass, aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass, callback: (Result) -> Unit) -{ + fun flutterEchoProxyApi( + pigeon_instanceArg: ProxyApiTestClass, + aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass, + callback: (Result) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApi" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApi" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aProxyApiArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as com.example.test_plugin.ProxyApiSuperClass callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed boolean, to test serialization and deserialization. */ - fun flutterEchoNullableBool(pigeon_instanceArg: ProxyApiTestClass, aBoolArg: Boolean?, callback: (Result) -> Unit) -{ + fun flutterEchoNullableBool( + pigeon_instanceArg: ProxyApiTestClass, + aBoolArg: Boolean?, + callback: (Result) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableBool" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableBool" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aBoolArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as Boolean? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed int, to test serialization and deserialization. */ - fun flutterEchoNullableInt(pigeon_instanceArg: ProxyApiTestClass, anIntArg: Long?, callback: (Result) -> Unit) -{ + fun flutterEchoNullableInt( + pigeon_instanceArg: ProxyApiTestClass, + anIntArg: Long?, + callback: (Result) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableInt" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableInt" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, anIntArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0].let { num -> if (num is Int) num.toLong() else num as Long? } callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed double, to test serialization and deserialization. */ - fun flutterEchoNullableDouble(pigeon_instanceArg: ProxyApiTestClass, aDoubleArg: Double?, callback: (Result) -> Unit) -{ + fun flutterEchoNullableDouble( + pigeon_instanceArg: ProxyApiTestClass, + aDoubleArg: Double?, + callback: (Result) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableDouble" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableDouble" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aDoubleArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as Double? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed string, to test serialization and deserialization. */ - fun flutterEchoNullableString(pigeon_instanceArg: ProxyApiTestClass, aStringArg: String?, callback: (Result) -> Unit) -{ + fun flutterEchoNullableString( + pigeon_instanceArg: ProxyApiTestClass, + aStringArg: String?, + callback: (Result) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableString" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableString" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aStringArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as String? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed byte list, to test serialization and deserialization. */ - fun flutterEchoNullableUint8List(pigeon_instanceArg: ProxyApiTestClass, aListArg: ByteArray?, callback: (Result) -> Unit) -{ + fun flutterEchoNullableUint8List( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: ByteArray?, + callback: (Result) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableUint8List" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableUint8List" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aListArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as ByteArray? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed list, to test serialization and deserialization. */ - fun flutterEchoNullableList(pigeon_instanceArg: ProxyApiTestClass, aListArg: List?, callback: (Result?>) -> Unit) -{ + fun flutterEchoNullableList( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: List?, + callback: (Result?>) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableList" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableList" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aListArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as List? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed map, to test serialization and deserialization. */ - fun flutterEchoNullableMap(pigeon_instanceArg: ProxyApiTestClass, aMapArg: Map?, callback: (Result?>) -> Unit) -{ + fun flutterEchoNullableMap( + pigeon_instanceArg: ProxyApiTestClass, + aMapArg: Map?, + callback: (Result?>) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableMap" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableMap" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aMapArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as Map? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed enum to test serialization and deserialization. */ - fun flutterEchoNullableEnum(pigeon_instanceArg: ProxyApiTestClass, anEnumArg: ProxyApiTestEnum?, callback: (Result) -> Unit) -{ + fun flutterEchoNullableEnum( + pigeon_instanceArg: ProxyApiTestClass, + anEnumArg: ProxyApiTestEnum?, + callback: (Result) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableEnum" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableEnum" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, anEnumArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as ProxyApiTestEnum? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed ProxyApi to test serialization and deserialization. */ - fun flutterEchoNullableProxyApi(pigeon_instanceArg: ProxyApiTestClass, aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass?, callback: (Result) -> Unit) -{ + fun flutterEchoNullableProxyApi( + pigeon_instanceArg: ProxyApiTestClass, + aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass?, + callback: (Result) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableProxyApi" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableProxyApi" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aProxyApiArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as com.example.test_plugin.ProxyApiSuperClass? callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** - * A no-op function taking no arguments and returning no value, to sanity - * test basic asynchronous calling. + * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous + * calling. */ - fun flutterNoopAsync(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) -{ + fun flutterNoopAsync(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoopAsync" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoopAsync" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } /** Returns the passed in generic Object asynchronously. */ - fun flutterEchoAsyncString(pigeon_instanceArg: ProxyApiTestClass, aStringArg: String, callback: (Result) -> Unit) -{ + fun flutterEchoAsyncString( + pigeon_instanceArg: ProxyApiTestClass, + aStringArg: String, + callback: (Result) -> Unit + ) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoAsyncString" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoAsyncString" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg, aStringArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { - callback(Result.failure(ProxyApiTestsError("null-error", "Flutter api returned null value for non-null return value.", ""))) + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) } else { val output = it[0] as String callback(Result.success(output)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } @Suppress("FunctionName") - /**An implementation of [PigeonApiProxyApiSuperClass] used to access callback methods */ - fun pigeon_getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass - { + /** An implementation of [PigeonApiProxyApiSuperClass] used to access callback methods */ + fun pigeon_getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass { return pigeonRegistrar.getPigeonApiProxyApiSuperClass() } @Suppress("FunctionName") - /**An implementation of [PigeonApiProxyApiInterface] used to access callback methods */ - fun pigeon_getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface - { + /** An implementation of [PigeonApiProxyApiInterface] used to access callback methods */ + fun pigeon_getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { return pigeonRegistrar.getPigeonApiProxyApiInterface() } - } /** ProxyApi to serve as a super class to the core ProxyApi class. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiSuperClass(open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { +abstract class PigeonApiProxyApiSuperClass( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar +) { abstract fun pigeon_defaultConstructor(): com.example.test_plugin.ProxyApiSuperClass abstract fun aSuperMethod(pigeon_instance: com.example.test_plugin.ProxyApiSuperClass) @@ -2948,17 +3821,24 @@ abstract class PigeonApiProxyApiSuperClass(open val pigeonRegistrar: ProxyApiTes fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiSuperClass?) { val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val pigeon_identifierArg = + args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2966,17 +3846,22 @@ abstract class PigeonApiProxyApiSuperClass(open val pigeonRegistrar: ProxyApiTes } } run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.aSuperMethod", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.aSuperMethod", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as com.example.test_plugin.ProxyApiSuperClass - val wrapped: List = try { - api.aSuperMethod(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.aSuperMethod(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { @@ -2987,83 +3872,97 @@ abstract class PigeonApiProxyApiSuperClass(open val pigeonRegistrar: ProxyApiTes } @Suppress("LocalVariableName", "FunctionName") - /**Creates a Dart instance of ProxyApiSuperClass and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: com.example.test_plugin.ProxyApiSuperClass, callback: (Result) -> Unit) -{ + /** Creates a Dart instance of ProxyApiSuperClass and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: com.example.test_plugin.ProxyApiSuperClass, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } /** ProxyApi to serve as an interface to the core ProxyApi class. */ @Suppress("UNCHECKED_CAST") -open class PigeonApiProxyApiInterface(open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { +open class PigeonApiProxyApiInterface( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar +) { @Suppress("LocalVariableName", "FunctionName") - /**Creates a Dart instance of ProxyApiInterface and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) -{ + /** Creates a Dart instance of ProxyApiInterface and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - fun anInterfaceMethod(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) -{ + fun anInterfaceMethod(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.anInterfaceMethod" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.anInterfaceMethod" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_instanceArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } + @Suppress("UNCHECKED_CAST") -abstract class PigeonApiClassWithApiRequirement(open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar) { +abstract class PigeonApiClassWithApiRequirement( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar +) { @androidx.annotation.RequiresApi(api = 25) abstract fun pigeon_defaultConstructor(): ClassWithApiRequirement @@ -3072,38 +3971,49 @@ abstract class PigeonApiClassWithApiRequirement(open val pigeonRegistrar: ProxyA companion object { @Suppress("LocalVariableName") - fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiClassWithApiRequirement?) { + fun setUpMessageHandlers( + binaryMessenger: BinaryMessenger, + api: PigeonApiClassWithApiRequirement? + ) { val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() if (android.os.Build.VERSION.SDK_INT >= 25) { run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } - val wrapped: List = try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance(api.pigeon_defaultConstructor(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val pigeon_identifierArg = + args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { channel.setMessageHandler(null) } } - } else { - val channel = BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", - codec - ) + } else { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - reply.reply(wrapError(UnsupportedOperationException( - "Call references class `ClassWithApiRequirement`, which requires api version 25." - ))) + reply.reply( + wrapError( + UnsupportedOperationException( + "Call references class `ClassWithApiRequirement`, which requires api version 25."))) } } else { channel.setMessageHandler(null) @@ -3111,34 +4021,40 @@ abstract class PigeonApiClassWithApiRequirement(open val pigeonRegistrar: ProxyA } if (android.os.Build.VERSION.SDK_INT >= 25) { run { - val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", codec) + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", + codec) if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ClassWithApiRequirement - val wrapped: List = try { - api.aMethod(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } + val wrapped: List = + try { + api.aMethod(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } reply.reply(wrapped) } } else { channel.setMessageHandler(null) } } - } else { - val channel = BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", - codec - ) + } else { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", + codec) if (api != null) { channel.setMessageHandler { _, reply -> - reply.reply(wrapError(UnsupportedOperationException( - "Call references class `ClassWithApiRequirement`, which requires api version 25." - ))) + reply.reply( + wrapError( + UnsupportedOperationException( + "Call references class `ClassWithApiRequirement`, which requires api version 25."))) } } else { channel.setMessageHandler(null) @@ -3148,30 +4064,35 @@ abstract class PigeonApiClassWithApiRequirement(open val pigeonRegistrar: ProxyA } @Suppress("LocalVariableName", "FunctionName") - /**Creates a Dart instance of ClassWithApiRequirement and attaches it to [pigeon_instanceArg]. */ + /** Creates a Dart instance of ClassWithApiRequirement and attaches it to [pigeon_instanceArg]. */ @androidx.annotation.RequiresApi(api = 25) - fun pigeon_newInstance(pigeon_instanceArg: ClassWithApiRequirement, callback: (Result) -> Unit) -{ + fun pigeon_newInstance( + pigeon_instanceArg: ClassWithApiRequirement, + callback: (Result) -> Unit + ) { if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { Result.success(Unit) return } - val pigeon_identifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) + val pigeon_identifierArg = + pigeonRegistrar.instanceManager.addHostCreatedInstance(pigeon_instanceArg) val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(pigeon_identifierArg)) { if (it is List<*>) { if (it.size > 1) { - callback(Result.failure(ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } } else { callback(Result.failure(createConnectionError(channelName))) - } + } } } - } diff --git a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp index 592260c8e0f5..c97dc064a96b 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp +++ b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp @@ -26,85 +26,58 @@ using flutter::EncodableMap; using flutter::EncodableValue; FlutterError CreateConnectionError(const std::string channel_name) { - return FlutterError( - "channel-error", - "Unable to establish connection on channel: '" + channel_name + "'.", - EncodableValue("")); + return FlutterError( + "channel-error", + "Unable to establish connection on channel: '" + channel_name + "'.", + EncodableValue("")); } // AllTypes -AllTypes::AllTypes( - bool a_bool, - int64_t an_int, - int64_t an_int64, - double a_double, - const std::vector& a_byte_array, - const std::vector& a4_byte_array, - const std::vector& a8_byte_array, - const std::vector& a_float_array, - const AnEnum& an_enum, - const std::string& a_string, - const EncodableValue& an_object, - const EncodableList& list, - const EncodableList& string_list, - const EncodableList& int_list, - const EncodableList& double_list, - const EncodableList& bool_list, - const EncodableMap& map) - : a_bool_(a_bool), - an_int_(an_int), - an_int64_(an_int64), - a_double_(a_double), - a_byte_array_(a_byte_array), - a4_byte_array_(a4_byte_array), - a8_byte_array_(a8_byte_array), - a_float_array_(a_float_array), - an_enum_(an_enum), - a_string_(a_string), - an_object_(an_object), - list_(list), - string_list_(string_list), - int_list_(int_list), - double_list_(double_list), - bool_list_(bool_list), - map_(map) {} - -bool AllTypes::a_bool() const { - return a_bool_; -} - -void AllTypes::set_a_bool(bool value_arg) { - a_bool_ = value_arg; -} - - -int64_t AllTypes::an_int() const { - return an_int_; -} - -void AllTypes::set_an_int(int64_t value_arg) { - an_int_ = value_arg; -} - - -int64_t AllTypes::an_int64() const { - return an_int64_; -} - -void AllTypes::set_an_int64(int64_t value_arg) { - an_int64_ = value_arg; -} - - -double AllTypes::a_double() const { - return a_double_; -} - -void AllTypes::set_a_double(double value_arg) { - a_double_ = value_arg; -} - +AllTypes::AllTypes(bool a_bool, int64_t an_int, int64_t an_int64, + double a_double, const std::vector& a_byte_array, + const std::vector& a4_byte_array, + const std::vector& a8_byte_array, + const std::vector& a_float_array, + const AnEnum& an_enum, const std::string& a_string, + const EncodableValue& an_object, const EncodableList& list, + const EncodableList& string_list, + const EncodableList& int_list, + const EncodableList& double_list, + const EncodableList& bool_list, const EncodableMap& map) + : a_bool_(a_bool), + an_int_(an_int), + an_int64_(an_int64), + a_double_(a_double), + a_byte_array_(a_byte_array), + a4_byte_array_(a4_byte_array), + a8_byte_array_(a8_byte_array), + a_float_array_(a_float_array), + an_enum_(an_enum), + a_string_(a_string), + an_object_(an_object), + list_(list), + string_list_(string_list), + int_list_(int_list), + double_list_(double_list), + bool_list_(bool_list), + map_(map) {} + +bool AllTypes::a_bool() const { return a_bool_; } + +void AllTypes::set_a_bool(bool value_arg) { a_bool_ = value_arg; } + +int64_t AllTypes::an_int() const { return an_int_; } + +void AllTypes::set_an_int(int64_t value_arg) { an_int_ = value_arg; } + +int64_t AllTypes::an_int64() const { return an_int64_; } + +void AllTypes::set_an_int64(int64_t value_arg) { an_int64_ = value_arg; } + +double AllTypes::a_double() const { return a_double_; } + +void AllTypes::set_a_double(double value_arg) { a_double_ = value_arg; } const std::vector& AllTypes::a_byte_array() const { return a_byte_array_; @@ -114,7 +87,6 @@ void AllTypes::set_a_byte_array(const std::vector& value_arg) { a_byte_array_ = value_arg; } - const std::vector& AllTypes::a4_byte_array() const { return a4_byte_array_; } @@ -123,7 +95,6 @@ void AllTypes::set_a4_byte_array(const std::vector& value_arg) { a4_byte_array_ = value_arg; } - const std::vector& AllTypes::a8_byte_array() const { return a8_byte_array_; } @@ -132,7 +103,6 @@ void AllTypes::set_a8_byte_array(const std::vector& value_arg) { a8_byte_array_ = value_arg; } - const std::vector& AllTypes::a_float_array() const { return a_float_array_; } @@ -141,87 +111,53 @@ void AllTypes::set_a_float_array(const std::vector& value_arg) { a_float_array_ = value_arg; } +const AnEnum& AllTypes::an_enum() const { return an_enum_; } -const AnEnum& AllTypes::an_enum() const { - return an_enum_; -} - -void AllTypes::set_an_enum(const AnEnum& value_arg) { - an_enum_ = value_arg; -} - +void AllTypes::set_an_enum(const AnEnum& value_arg) { an_enum_ = value_arg; } -const std::string& AllTypes::a_string() const { - return a_string_; -} +const std::string& AllTypes::a_string() const { return a_string_; } void AllTypes::set_a_string(std::string_view value_arg) { a_string_ = value_arg; } - -const EncodableValue& AllTypes::an_object() const { - return an_object_; -} +const EncodableValue& AllTypes::an_object() const { return an_object_; } void AllTypes::set_an_object(const EncodableValue& value_arg) { an_object_ = value_arg; } +const EncodableList& AllTypes::list() const { return list_; } -const EncodableList& AllTypes::list() const { - return list_; -} - -void AllTypes::set_list(const EncodableList& value_arg) { - list_ = value_arg; -} - +void AllTypes::set_list(const EncodableList& value_arg) { list_ = value_arg; } -const EncodableList& AllTypes::string_list() const { - return string_list_; -} +const EncodableList& AllTypes::string_list() const { return string_list_; } void AllTypes::set_string_list(const EncodableList& value_arg) { string_list_ = value_arg; } - -const EncodableList& AllTypes::int_list() const { - return int_list_; -} +const EncodableList& AllTypes::int_list() const { return int_list_; } void AllTypes::set_int_list(const EncodableList& value_arg) { int_list_ = value_arg; } - -const EncodableList& AllTypes::double_list() const { - return double_list_; -} +const EncodableList& AllTypes::double_list() const { return double_list_; } void AllTypes::set_double_list(const EncodableList& value_arg) { double_list_ = value_arg; } - -const EncodableList& AllTypes::bool_list() const { - return bool_list_; -} +const EncodableList& AllTypes::bool_list() const { return bool_list_; } void AllTypes::set_bool_list(const EncodableList& value_arg) { bool_list_ = value_arg; } +const EncodableMap& AllTypes::map() const { return map_; } -const EncodableMap& AllTypes::map() const { - return map_; -} - -void AllTypes::set_map(const EncodableMap& value_arg) { - map_ = value_arg; -} - +void AllTypes::set_map(const EncodableMap& value_arg) { map_ = value_arg; } EncodableList AllTypes::ToEncodableList() const { EncodableList list; @@ -248,23 +184,16 @@ EncodableList AllTypes::ToEncodableList() const { AllTypes AllTypes::FromEncodableList(const EncodableList& list) { AllTypes decoded( - std::get(list[0]), - list[1].LongValue(), - list[2].LongValue(), - std::get(list[3]), - std::get>(list[4]), - std::get>(list[5]), - std::get>(list[6]), - std::get>(list[7]), - std::any_cast(std::get(list[8])), - std::get(list[9]), - list[10], - std::get(list[11]), - std::get(list[12]), - std::get(list[13]), - std::get(list[14]), - std::get(list[15]), - std::get(list[16])); + std::get(list[0]), list[1].LongValue(), list[2].LongValue(), + std::get(list[3]), std::get>(list[4]), + std::get>(list[5]), + std::get>(list[6]), + std::get>(list[7]), + std::any_cast(std::get(list[8])), + std::get(list[9]), list[10], + std::get(list[11]), std::get(list[12]), + std::get(list[13]), std::get(list[14]), + std::get(list[15]), std::get(list[16])); return decoded; } @@ -273,74 +202,160 @@ AllTypes AllTypes::FromEncodableList(const EncodableList& list) { AllNullableTypes::AllNullableTypes() {} AllNullableTypes::AllNullableTypes( - const bool* a_nullable_bool, - const int64_t* a_nullable_int, - const int64_t* a_nullable_int64, - const double* a_nullable_double, - const std::vector* a_nullable_byte_array, - const std::vector* a_nullable4_byte_array, - const std::vector* a_nullable8_byte_array, - const std::vector* a_nullable_float_array, - const EncodableList* nullable_nested_list, - const EncodableMap* nullable_map_with_annotations, - const EncodableMap* nullable_map_with_object, - const AnEnum* a_nullable_enum, - const std::string* a_nullable_string, - const EncodableValue* a_nullable_object, - const AllNullableTypes* all_nullable_types, - const EncodableList* list, - const EncodableList* string_list, - const EncodableList* int_list, - const EncodableList* double_list, - const EncodableList* bool_list, - const EncodableList* nested_class_list, - const EncodableMap* map) - : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) : std::nullopt), - a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) : std::nullopt), - a_nullable_int64_(a_nullable_int64 ? std::optional(*a_nullable_int64) : std::nullopt), - a_nullable_double_(a_nullable_double ? std::optional(*a_nullable_double) : std::nullopt), - a_nullable_byte_array_(a_nullable_byte_array ? std::optional>(*a_nullable_byte_array) : std::nullopt), - a_nullable4_byte_array_(a_nullable4_byte_array ? std::optional>(*a_nullable4_byte_array) : std::nullopt), - a_nullable8_byte_array_(a_nullable8_byte_array ? std::optional>(*a_nullable8_byte_array) : std::nullopt), - a_nullable_float_array_(a_nullable_float_array ? std::optional>(*a_nullable_float_array) : std::nullopt), - nullable_nested_list_(nullable_nested_list ? std::optional(*nullable_nested_list) : std::nullopt), - nullable_map_with_annotations_(nullable_map_with_annotations ? std::optional(*nullable_map_with_annotations) : std::nullopt), - nullable_map_with_object_(nullable_map_with_object ? std::optional(*nullable_map_with_object) : std::nullopt), - a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) : std::nullopt), - a_nullable_string_(a_nullable_string ? std::optional(*a_nullable_string) : std::nullopt), - a_nullable_object_(a_nullable_object ? std::optional(*a_nullable_object) : std::nullopt), - all_nullable_types_(all_nullable_types ? std::make_unique(*all_nullable_types) : nullptr), - list_(list ? std::optional(*list) : std::nullopt), - string_list_(string_list ? std::optional(*string_list) : std::nullopt), - int_list_(int_list ? std::optional(*int_list) : std::nullopt), - double_list_(double_list ? std::optional(*double_list) : std::nullopt), - bool_list_(bool_list ? std::optional(*bool_list) : std::nullopt), - nested_class_list_(nested_class_list ? std::optional(*nested_class_list) : std::nullopt), - map_(map ? std::optional(*map) : std::nullopt) {} + const bool* a_nullable_bool, const int64_t* a_nullable_int, + const int64_t* a_nullable_int64, const double* a_nullable_double, + const std::vector* a_nullable_byte_array, + const std::vector* a_nullable4_byte_array, + const std::vector* a_nullable8_byte_array, + const std::vector* a_nullable_float_array, + const EncodableList* nullable_nested_list, + const EncodableMap* nullable_map_with_annotations, + const EncodableMap* nullable_map_with_object, const AnEnum* a_nullable_enum, + const std::string* a_nullable_string, + const EncodableValue* a_nullable_object, + const AllNullableTypes* all_nullable_types, const EncodableList* list, + const EncodableList* string_list, const EncodableList* int_list, + const EncodableList* double_list, const EncodableList* bool_list, + const EncodableList* nested_class_list, const EncodableMap* map) + : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) + : std::nullopt), + a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) + : std::nullopt), + a_nullable_int64_(a_nullable_int64 + ? std::optional(*a_nullable_int64) + : std::nullopt), + a_nullable_double_(a_nullable_double + ? std::optional(*a_nullable_double) + : std::nullopt), + a_nullable_byte_array_( + a_nullable_byte_array + ? std::optional>(*a_nullable_byte_array) + : std::nullopt), + a_nullable4_byte_array_( + a_nullable4_byte_array + ? std::optional>(*a_nullable4_byte_array) + : std::nullopt), + a_nullable8_byte_array_( + a_nullable8_byte_array + ? std::optional>(*a_nullable8_byte_array) + : std::nullopt), + a_nullable_float_array_( + a_nullable_float_array + ? std::optional>(*a_nullable_float_array) + : std::nullopt), + nullable_nested_list_(nullable_nested_list ? std::optional( + *nullable_nested_list) + : std::nullopt), + nullable_map_with_annotations_( + nullable_map_with_annotations + ? std::optional(*nullable_map_with_annotations) + : std::nullopt), + nullable_map_with_object_( + nullable_map_with_object + ? std::optional(*nullable_map_with_object) + : std::nullopt), + a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) + : std::nullopt), + a_nullable_string_(a_nullable_string + ? std::optional(*a_nullable_string) + : std::nullopt), + a_nullable_object_(a_nullable_object + ? std::optional(*a_nullable_object) + : std::nullopt), + all_nullable_types_( + all_nullable_types + ? std::make_unique(*all_nullable_types) + : nullptr), + list_(list ? std::optional(*list) : std::nullopt), + string_list_(string_list ? std::optional(*string_list) + : std::nullopt), + int_list_(int_list ? std::optional(*int_list) + : std::nullopt), + double_list_(double_list ? std::optional(*double_list) + : std::nullopt), + bool_list_(bool_list ? std::optional(*bool_list) + : std::nullopt), + nested_class_list_(nested_class_list + ? std::optional(*nested_class_list) + : std::nullopt), + map_(map ? std::optional(*map) : std::nullopt) {} AllNullableTypes::AllNullableTypes(const AllNullableTypes& other) - : a_nullable_bool_(other.a_nullable_bool_ ? std::optional(*other.a_nullable_bool_) : std::nullopt), - a_nullable_int_(other.a_nullable_int_ ? std::optional(*other.a_nullable_int_) : std::nullopt), - a_nullable_int64_(other.a_nullable_int64_ ? std::optional(*other.a_nullable_int64_) : std::nullopt), - a_nullable_double_(other.a_nullable_double_ ? std::optional(*other.a_nullable_double_) : std::nullopt), - a_nullable_byte_array_(other.a_nullable_byte_array_ ? std::optional>(*other.a_nullable_byte_array_) : std::nullopt), - a_nullable4_byte_array_(other.a_nullable4_byte_array_ ? std::optional>(*other.a_nullable4_byte_array_) : std::nullopt), - a_nullable8_byte_array_(other.a_nullable8_byte_array_ ? std::optional>(*other.a_nullable8_byte_array_) : std::nullopt), - a_nullable_float_array_(other.a_nullable_float_array_ ? std::optional>(*other.a_nullable_float_array_) : std::nullopt), - nullable_nested_list_(other.nullable_nested_list_ ? std::optional(*other.nullable_nested_list_) : std::nullopt), - nullable_map_with_annotations_(other.nullable_map_with_annotations_ ? std::optional(*other.nullable_map_with_annotations_) : std::nullopt), - nullable_map_with_object_(other.nullable_map_with_object_ ? std::optional(*other.nullable_map_with_object_) : std::nullopt), - a_nullable_enum_(other.a_nullable_enum_ ? std::optional(*other.a_nullable_enum_) : std::nullopt), - a_nullable_string_(other.a_nullable_string_ ? std::optional(*other.a_nullable_string_) : std::nullopt), - a_nullable_object_(other.a_nullable_object_ ? std::optional(*other.a_nullable_object_) : std::nullopt), - all_nullable_types_(other.all_nullable_types_ ? std::make_unique(*other.all_nullable_types_) : nullptr), - list_(other.list_ ? std::optional(*other.list_) : std::nullopt), - string_list_(other.string_list_ ? std::optional(*other.string_list_) : std::nullopt), - int_list_(other.int_list_ ? std::optional(*other.int_list_) : std::nullopt), - double_list_(other.double_list_ ? std::optional(*other.double_list_) : std::nullopt), - bool_list_(other.bool_list_ ? std::optional(*other.bool_list_) : std::nullopt), - nested_class_list_(other.nested_class_list_ ? std::optional(*other.nested_class_list_) : std::nullopt), - map_(other.map_ ? std::optional(*other.map_) : std::nullopt) {} + : a_nullable_bool_(other.a_nullable_bool_ + ? std::optional(*other.a_nullable_bool_) + : std::nullopt), + a_nullable_int_(other.a_nullable_int_ + ? std::optional(*other.a_nullable_int_) + : std::nullopt), + a_nullable_int64_(other.a_nullable_int64_ + ? std::optional(*other.a_nullable_int64_) + : std::nullopt), + a_nullable_double_(other.a_nullable_double_ + ? std::optional(*other.a_nullable_double_) + : std::nullopt), + a_nullable_byte_array_(other.a_nullable_byte_array_ + ? std::optional>( + *other.a_nullable_byte_array_) + : std::nullopt), + a_nullable4_byte_array_(other.a_nullable4_byte_array_ + ? std::optional>( + *other.a_nullable4_byte_array_) + : std::nullopt), + a_nullable8_byte_array_(other.a_nullable8_byte_array_ + ? std::optional>( + *other.a_nullable8_byte_array_) + : std::nullopt), + a_nullable_float_array_(other.a_nullable_float_array_ + ? std::optional>( + *other.a_nullable_float_array_) + : std::nullopt), + nullable_nested_list_( + other.nullable_nested_list_ + ? std::optional(*other.nullable_nested_list_) + : std::nullopt), + nullable_map_with_annotations_( + other.nullable_map_with_annotations_ + ? std::optional( + *other.nullable_map_with_annotations_) + : std::nullopt), + nullable_map_with_object_( + other.nullable_map_with_object_ + ? std::optional(*other.nullable_map_with_object_) + : std::nullopt), + a_nullable_enum_(other.a_nullable_enum_ + ? std::optional(*other.a_nullable_enum_) + : std::nullopt), + a_nullable_string_( + other.a_nullable_string_ + ? std::optional(*other.a_nullable_string_) + : std::nullopt), + a_nullable_object_( + other.a_nullable_object_ + ? std::optional(*other.a_nullable_object_) + : std::nullopt), + all_nullable_types_( + other.all_nullable_types_ + ? std::make_unique(*other.all_nullable_types_) + : nullptr), + list_(other.list_ ? std::optional(*other.list_) + : std::nullopt), + string_list_(other.string_list_ + ? std::optional(*other.string_list_) + : std::nullopt), + int_list_(other.int_list_ ? std::optional(*other.int_list_) + : std::nullopt), + double_list_(other.double_list_ + ? std::optional(*other.double_list_) + : std::nullopt), + bool_list_(other.bool_list_ + ? std::optional(*other.bool_list_) + : std::nullopt), + nested_class_list_( + other.nested_class_list_ + ? std::optional(*other.nested_class_list_) + : std::nullopt), + map_(other.map_ ? std::optional(*other.map_) + : std::nullopt) {} AllNullableTypes& AllNullableTypes::operator=(const AllNullableTypes& other) { a_nullable_bool_ = other.a_nullable_bool_; @@ -357,7 +372,10 @@ AllNullableTypes& AllNullableTypes::operator=(const AllNullableTypes& other) { a_nullable_enum_ = other.a_nullable_enum_; a_nullable_string_ = other.a_nullable_string_; a_nullable_object_ = other.a_nullable_object_; - all_nullable_types_ = other.all_nullable_types_ ? std::make_unique(*other.all_nullable_types_) : nullptr; + all_nullable_types_ = + other.all_nullable_types_ + ? std::make_unique(*other.all_nullable_types_) + : nullptr; list_ = other.list_; string_list_ = other.string_list_; int_list_ = other.int_list_; @@ -380,189 +398,209 @@ void AllNullableTypes::set_a_nullable_bool(bool value_arg) { a_nullable_bool_ = value_arg; } - const int64_t* AllNullableTypes::a_nullable_int() const { return a_nullable_int_ ? &(*a_nullable_int_) : nullptr; } void AllNullableTypes::set_a_nullable_int(const int64_t* value_arg) { - a_nullable_int_ = value_arg ? std::optional(*value_arg) : std::nullopt; + a_nullable_int_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_int(int64_t value_arg) { a_nullable_int_ = value_arg; } - const int64_t* AllNullableTypes::a_nullable_int64() const { return a_nullable_int64_ ? &(*a_nullable_int64_) : nullptr; } void AllNullableTypes::set_a_nullable_int64(const int64_t* value_arg) { - a_nullable_int64_ = value_arg ? std::optional(*value_arg) : std::nullopt; + a_nullable_int64_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_int64(int64_t value_arg) { a_nullable_int64_ = value_arg; } - const double* AllNullableTypes::a_nullable_double() const { return a_nullable_double_ ? &(*a_nullable_double_) : nullptr; } void AllNullableTypes::set_a_nullable_double(const double* value_arg) { - a_nullable_double_ = value_arg ? std::optional(*value_arg) : std::nullopt; + a_nullable_double_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_double(double value_arg) { a_nullable_double_ = value_arg; } - const std::vector* AllNullableTypes::a_nullable_byte_array() const { return a_nullable_byte_array_ ? &(*a_nullable_byte_array_) : nullptr; } -void AllNullableTypes::set_a_nullable_byte_array(const std::vector* value_arg) { - a_nullable_byte_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; +void AllNullableTypes::set_a_nullable_byte_array( + const std::vector* value_arg) { + a_nullable_byte_array_ = value_arg + ? std::optional>(*value_arg) + : std::nullopt; } -void AllNullableTypes::set_a_nullable_byte_array(const std::vector& value_arg) { +void AllNullableTypes::set_a_nullable_byte_array( + const std::vector& value_arg) { a_nullable_byte_array_ = value_arg; } - const std::vector* AllNullableTypes::a_nullable4_byte_array() const { return a_nullable4_byte_array_ ? &(*a_nullable4_byte_array_) : nullptr; } -void AllNullableTypes::set_a_nullable4_byte_array(const std::vector* value_arg) { - a_nullable4_byte_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; +void AllNullableTypes::set_a_nullable4_byte_array( + const std::vector* value_arg) { + a_nullable4_byte_array_ = + value_arg ? std::optional>(*value_arg) + : std::nullopt; } -void AllNullableTypes::set_a_nullable4_byte_array(const std::vector& value_arg) { +void AllNullableTypes::set_a_nullable4_byte_array( + const std::vector& value_arg) { a_nullable4_byte_array_ = value_arg; } - const std::vector* AllNullableTypes::a_nullable8_byte_array() const { return a_nullable8_byte_array_ ? &(*a_nullable8_byte_array_) : nullptr; } -void AllNullableTypes::set_a_nullable8_byte_array(const std::vector* value_arg) { - a_nullable8_byte_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; +void AllNullableTypes::set_a_nullable8_byte_array( + const std::vector* value_arg) { + a_nullable8_byte_array_ = + value_arg ? std::optional>(*value_arg) + : std::nullopt; } -void AllNullableTypes::set_a_nullable8_byte_array(const std::vector& value_arg) { +void AllNullableTypes::set_a_nullable8_byte_array( + const std::vector& value_arg) { a_nullable8_byte_array_ = value_arg; } - const std::vector* AllNullableTypes::a_nullable_float_array() const { return a_nullable_float_array_ ? &(*a_nullable_float_array_) : nullptr; } -void AllNullableTypes::set_a_nullable_float_array(const std::vector* value_arg) { - a_nullable_float_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; +void AllNullableTypes::set_a_nullable_float_array( + const std::vector* value_arg) { + a_nullable_float_array_ = + value_arg ? std::optional>(*value_arg) : std::nullopt; } -void AllNullableTypes::set_a_nullable_float_array(const std::vector& value_arg) { +void AllNullableTypes::set_a_nullable_float_array( + const std::vector& value_arg) { a_nullable_float_array_ = value_arg; } - const EncodableList* AllNullableTypes::nullable_nested_list() const { return nullable_nested_list_ ? &(*nullable_nested_list_) : nullptr; } -void AllNullableTypes::set_nullable_nested_list(const EncodableList* value_arg) { - nullable_nested_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypes::set_nullable_nested_list( + const EncodableList* value_arg) { + nullable_nested_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypes::set_nullable_nested_list(const EncodableList& value_arg) { +void AllNullableTypes::set_nullable_nested_list( + const EncodableList& value_arg) { nullable_nested_list_ = value_arg; } - const EncodableMap* AllNullableTypes::nullable_map_with_annotations() const { - return nullable_map_with_annotations_ ? &(*nullable_map_with_annotations_) : nullptr; + return nullable_map_with_annotations_ ? &(*nullable_map_with_annotations_) + : nullptr; } -void AllNullableTypes::set_nullable_map_with_annotations(const EncodableMap* value_arg) { - nullable_map_with_annotations_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypes::set_nullable_map_with_annotations( + const EncodableMap* value_arg) { + nullable_map_with_annotations_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypes::set_nullable_map_with_annotations(const EncodableMap& value_arg) { +void AllNullableTypes::set_nullable_map_with_annotations( + const EncodableMap& value_arg) { nullable_map_with_annotations_ = value_arg; } - const EncodableMap* AllNullableTypes::nullable_map_with_object() const { return nullable_map_with_object_ ? &(*nullable_map_with_object_) : nullptr; } -void AllNullableTypes::set_nullable_map_with_object(const EncodableMap* value_arg) { - nullable_map_with_object_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypes::set_nullable_map_with_object( + const EncodableMap* value_arg) { + nullable_map_with_object_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypes::set_nullable_map_with_object(const EncodableMap& value_arg) { +void AllNullableTypes::set_nullable_map_with_object( + const EncodableMap& value_arg) { nullable_map_with_object_ = value_arg; } - const AnEnum* AllNullableTypes::a_nullable_enum() const { return a_nullable_enum_ ? &(*a_nullable_enum_) : nullptr; } void AllNullableTypes::set_a_nullable_enum(const AnEnum* value_arg) { - a_nullable_enum_ = value_arg ? std::optional(*value_arg) : std::nullopt; + a_nullable_enum_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_enum(const AnEnum& value_arg) { a_nullable_enum_ = value_arg; } - const std::string* AllNullableTypes::a_nullable_string() const { return a_nullable_string_ ? &(*a_nullable_string_) : nullptr; } -void AllNullableTypes::set_a_nullable_string(const std::string_view* value_arg) { - a_nullable_string_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypes::set_a_nullable_string( + const std::string_view* value_arg) { + a_nullable_string_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_string(std::string_view value_arg) { a_nullable_string_ = value_arg; } - const EncodableValue* AllNullableTypes::a_nullable_object() const { return a_nullable_object_ ? &(*a_nullable_object_) : nullptr; } void AllNullableTypes::set_a_nullable_object(const EncodableValue* value_arg) { - a_nullable_object_ = value_arg ? std::optional(*value_arg) : std::nullopt; + a_nullable_object_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_a_nullable_object(const EncodableValue& value_arg) { a_nullable_object_ = value_arg; } - const AllNullableTypes* AllNullableTypes::all_nullable_types() const { return all_nullable_types_.get(); } -void AllNullableTypes::set_all_nullable_types(const AllNullableTypes* value_arg) { - all_nullable_types_ = value_arg ? std::make_unique(*value_arg) : nullptr; +void AllNullableTypes::set_all_nullable_types( + const AllNullableTypes* value_arg) { + all_nullable_types_ = + value_arg ? std::make_unique(*value_arg) : nullptr; } -void AllNullableTypes::set_all_nullable_types(const AllNullableTypes& value_arg) { +void AllNullableTypes::set_all_nullable_types( + const AllNullableTypes& value_arg) { all_nullable_types_ = std::make_unique(value_arg); } - const EncodableList* AllNullableTypes::list() const { return list_ ? &(*list_) : nullptr; } @@ -575,72 +613,71 @@ void AllNullableTypes::set_list(const EncodableList& value_arg) { list_ = value_arg; } - const EncodableList* AllNullableTypes::string_list() const { return string_list_ ? &(*string_list_) : nullptr; } void AllNullableTypes::set_string_list(const EncodableList* value_arg) { - string_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; + string_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_string_list(const EncodableList& value_arg) { string_list_ = value_arg; } - const EncodableList* AllNullableTypes::int_list() const { return int_list_ ? &(*int_list_) : nullptr; } void AllNullableTypes::set_int_list(const EncodableList* value_arg) { - int_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; + int_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_int_list(const EncodableList& value_arg) { int_list_ = value_arg; } - const EncodableList* AllNullableTypes::double_list() const { return double_list_ ? &(*double_list_) : nullptr; } void AllNullableTypes::set_double_list(const EncodableList* value_arg) { - double_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; + double_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_double_list(const EncodableList& value_arg) { double_list_ = value_arg; } - const EncodableList* AllNullableTypes::bool_list() const { return bool_list_ ? &(*bool_list_) : nullptr; } void AllNullableTypes::set_bool_list(const EncodableList* value_arg) { - bool_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; + bool_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_bool_list(const EncodableList& value_arg) { bool_list_ = value_arg; } - const EncodableList* AllNullableTypes::nested_class_list() const { return nested_class_list_ ? &(*nested_class_list_) : nullptr; } void AllNullableTypes::set_nested_class_list(const EncodableList* value_arg) { - nested_class_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; + nested_class_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypes::set_nested_class_list(const EncodableList& value_arg) { nested_class_list_ = value_arg; } - const EncodableMap* AllNullableTypes::map() const { return map_ ? &(*map_) : nullptr; } @@ -653,36 +690,60 @@ void AllNullableTypes::set_map(const EncodableMap& value_arg) { map_ = value_arg; } - EncodableList AllNullableTypes::ToEncodableList() const { EncodableList list; list.reserve(22); - list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) : EncodableValue()); - list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) : EncodableValue()); - list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) : EncodableValue()); - list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) : EncodableValue()); - list.push_back(a_nullable_byte_array_ ? EncodableValue(*a_nullable_byte_array_) : EncodableValue()); - list.push_back(a_nullable4_byte_array_ ? EncodableValue(*a_nullable4_byte_array_) : EncodableValue()); - list.push_back(a_nullable8_byte_array_ ? EncodableValue(*a_nullable8_byte_array_) : EncodableValue()); - list.push_back(a_nullable_float_array_ ? EncodableValue(*a_nullable_float_array_) : EncodableValue()); - list.push_back(nullable_nested_list_ ? EncodableValue(*nullable_nested_list_) : EncodableValue()); - list.push_back(nullable_map_with_annotations_ ? EncodableValue(*nullable_map_with_annotations_) : EncodableValue()); - list.push_back(nullable_map_with_object_ ? EncodableValue(*nullable_map_with_object_) : EncodableValue()); - list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) : EncodableValue()); - list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_) : EncodableValue()); + list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) + : EncodableValue()); + list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) + : EncodableValue()); + list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) + : EncodableValue()); + list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) + : EncodableValue()); + list.push_back(a_nullable_byte_array_ + ? EncodableValue(*a_nullable_byte_array_) + : EncodableValue()); + list.push_back(a_nullable4_byte_array_ + ? EncodableValue(*a_nullable4_byte_array_) + : EncodableValue()); + list.push_back(a_nullable8_byte_array_ + ? EncodableValue(*a_nullable8_byte_array_) + : EncodableValue()); + list.push_back(a_nullable_float_array_ + ? EncodableValue(*a_nullable_float_array_) + : EncodableValue()); + list.push_back(nullable_nested_list_ ? EncodableValue(*nullable_nested_list_) + : EncodableValue()); + list.push_back(nullable_map_with_annotations_ + ? EncodableValue(*nullable_map_with_annotations_) + : EncodableValue()); + list.push_back(nullable_map_with_object_ + ? EncodableValue(*nullable_map_with_object_) + : EncodableValue()); + list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) + : EncodableValue()); + list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_) + : EncodableValue()); list.push_back(a_nullable_object_ ? *a_nullable_object_ : EncodableValue()); - list.push_back(all_nullable_types_ ? CustomEncodableValue(*all_nullable_types_) : EncodableValue()); + list.push_back(all_nullable_types_ + ? CustomEncodableValue(*all_nullable_types_) + : EncodableValue()); list.push_back(list_ ? EncodableValue(*list_) : EncodableValue()); - list.push_back(string_list_ ? EncodableValue(*string_list_) : EncodableValue()); + list.push_back(string_list_ ? EncodableValue(*string_list_) + : EncodableValue()); list.push_back(int_list_ ? EncodableValue(*int_list_) : EncodableValue()); - list.push_back(double_list_ ? EncodableValue(*double_list_) : EncodableValue()); + list.push_back(double_list_ ? EncodableValue(*double_list_) + : EncodableValue()); list.push_back(bool_list_ ? EncodableValue(*bool_list_) : EncodableValue()); - list.push_back(nested_class_list_ ? EncodableValue(*nested_class_list_) : EncodableValue()); + list.push_back(nested_class_list_ ? EncodableValue(*nested_class_list_) + : EncodableValue()); list.push_back(map_ ? EncodableValue(*map_) : EncodableValue()); return list; } -AllNullableTypes AllNullableTypes::FromEncodableList(const EncodableList& list) { +AllNullableTypes AllNullableTypes::FromEncodableList( + const EncodableList& list) { AllNullableTypes decoded; auto& encodable_a_nullable_bool = list[0]; if (!encodable_a_nullable_bool.IsNull()) { @@ -698,43 +759,53 @@ AllNullableTypes AllNullableTypes::FromEncodableList(const EncodableList& list) } auto& encodable_a_nullable_double = list[3]; if (!encodable_a_nullable_double.IsNull()) { - decoded.set_a_nullable_double(std::get(encodable_a_nullable_double)); + decoded.set_a_nullable_double( + std::get(encodable_a_nullable_double)); } auto& encodable_a_nullable_byte_array = list[4]; if (!encodable_a_nullable_byte_array.IsNull()) { - decoded.set_a_nullable_byte_array(std::get>(encodable_a_nullable_byte_array)); + decoded.set_a_nullable_byte_array( + std::get>(encodable_a_nullable_byte_array)); } auto& encodable_a_nullable4_byte_array = list[5]; if (!encodable_a_nullable4_byte_array.IsNull()) { - decoded.set_a_nullable4_byte_array(std::get>(encodable_a_nullable4_byte_array)); + decoded.set_a_nullable4_byte_array( + std::get>(encodable_a_nullable4_byte_array)); } auto& encodable_a_nullable8_byte_array = list[6]; if (!encodable_a_nullable8_byte_array.IsNull()) { - decoded.set_a_nullable8_byte_array(std::get>(encodable_a_nullable8_byte_array)); + decoded.set_a_nullable8_byte_array( + std::get>(encodable_a_nullable8_byte_array)); } auto& encodable_a_nullable_float_array = list[7]; if (!encodable_a_nullable_float_array.IsNull()) { - decoded.set_a_nullable_float_array(std::get>(encodable_a_nullable_float_array)); + decoded.set_a_nullable_float_array( + std::get>(encodable_a_nullable_float_array)); } auto& encodable_nullable_nested_list = list[8]; if (!encodable_nullable_nested_list.IsNull()) { - decoded.set_nullable_nested_list(std::get(encodable_nullable_nested_list)); + decoded.set_nullable_nested_list( + std::get(encodable_nullable_nested_list)); } auto& encodable_nullable_map_with_annotations = list[9]; if (!encodable_nullable_map_with_annotations.IsNull()) { - decoded.set_nullable_map_with_annotations(std::get(encodable_nullable_map_with_annotations)); + decoded.set_nullable_map_with_annotations( + std::get(encodable_nullable_map_with_annotations)); } auto& encodable_nullable_map_with_object = list[10]; if (!encodable_nullable_map_with_object.IsNull()) { - decoded.set_nullable_map_with_object(std::get(encodable_nullable_map_with_object)); + decoded.set_nullable_map_with_object( + std::get(encodable_nullable_map_with_object)); } auto& encodable_a_nullable_enum = list[11]; if (!encodable_a_nullable_enum.IsNull()) { - decoded.set_a_nullable_enum(std::any_cast(std::get(encodable_a_nullable_enum))); + decoded.set_a_nullable_enum(std::any_cast( + std::get(encodable_a_nullable_enum))); } auto& encodable_a_nullable_string = list[12]; if (!encodable_a_nullable_string.IsNull()) { - decoded.set_a_nullable_string(std::get(encodable_a_nullable_string)); + decoded.set_a_nullable_string( + std::get(encodable_a_nullable_string)); } auto& encodable_a_nullable_object = list[13]; if (!encodable_a_nullable_object.IsNull()) { @@ -742,7 +813,8 @@ AllNullableTypes AllNullableTypes::FromEncodableList(const EncodableList& list) } auto& encodable_all_nullable_types = list[14]; if (!encodable_all_nullable_types.IsNull()) { - decoded.set_all_nullable_types(std::any_cast(std::get(encodable_all_nullable_types))); + decoded.set_all_nullable_types(std::any_cast( + std::get(encodable_all_nullable_types))); } auto& encodable_list = list[15]; if (!encodable_list.IsNull()) { @@ -766,7 +838,8 @@ AllNullableTypes AllNullableTypes::FromEncodableList(const EncodableList& list) } auto& encodable_nested_class_list = list[20]; if (!encodable_nested_class_list.IsNull()) { - decoded.set_nested_class_list(std::get(encodable_nested_class_list)); + decoded.set_nested_class_list( + std::get(encodable_nested_class_list)); } auto& encodable_map = list[21]; if (!encodable_map.IsNull()) { @@ -780,52 +853,82 @@ AllNullableTypes AllNullableTypes::FromEncodableList(const EncodableList& list) AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion() {} AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion( - const bool* a_nullable_bool, - const int64_t* a_nullable_int, - const int64_t* a_nullable_int64, - const double* a_nullable_double, - const std::vector* a_nullable_byte_array, - const std::vector* a_nullable4_byte_array, - const std::vector* a_nullable8_byte_array, - const std::vector* a_nullable_float_array, - const EncodableList* nullable_nested_list, - const EncodableMap* nullable_map_with_annotations, - const EncodableMap* nullable_map_with_object, - const AnEnum* a_nullable_enum, - const std::string* a_nullable_string, - const EncodableValue* a_nullable_object, - const EncodableList* list, - const EncodableList* string_list, - const EncodableList* int_list, - const EncodableList* double_list, - const EncodableList* bool_list, - const EncodableMap* map) - : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) : std::nullopt), - a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) : std::nullopt), - a_nullable_int64_(a_nullable_int64 ? std::optional(*a_nullable_int64) : std::nullopt), - a_nullable_double_(a_nullable_double ? std::optional(*a_nullable_double) : std::nullopt), - a_nullable_byte_array_(a_nullable_byte_array ? std::optional>(*a_nullable_byte_array) : std::nullopt), - a_nullable4_byte_array_(a_nullable4_byte_array ? std::optional>(*a_nullable4_byte_array) : std::nullopt), - a_nullable8_byte_array_(a_nullable8_byte_array ? std::optional>(*a_nullable8_byte_array) : std::nullopt), - a_nullable_float_array_(a_nullable_float_array ? std::optional>(*a_nullable_float_array) : std::nullopt), - nullable_nested_list_(nullable_nested_list ? std::optional(*nullable_nested_list) : std::nullopt), - nullable_map_with_annotations_(nullable_map_with_annotations ? std::optional(*nullable_map_with_annotations) : std::nullopt), - nullable_map_with_object_(nullable_map_with_object ? std::optional(*nullable_map_with_object) : std::nullopt), - a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) : std::nullopt), - a_nullable_string_(a_nullable_string ? std::optional(*a_nullable_string) : std::nullopt), - a_nullable_object_(a_nullable_object ? std::optional(*a_nullable_object) : std::nullopt), - list_(list ? std::optional(*list) : std::nullopt), - string_list_(string_list ? std::optional(*string_list) : std::nullopt), - int_list_(int_list ? std::optional(*int_list) : std::nullopt), - double_list_(double_list ? std::optional(*double_list) : std::nullopt), - bool_list_(bool_list ? std::optional(*bool_list) : std::nullopt), - map_(map ? std::optional(*map) : std::nullopt) {} + const bool* a_nullable_bool, const int64_t* a_nullable_int, + const int64_t* a_nullable_int64, const double* a_nullable_double, + const std::vector* a_nullable_byte_array, + const std::vector* a_nullable4_byte_array, + const std::vector* a_nullable8_byte_array, + const std::vector* a_nullable_float_array, + const EncodableList* nullable_nested_list, + const EncodableMap* nullable_map_with_annotations, + const EncodableMap* nullable_map_with_object, const AnEnum* a_nullable_enum, + const std::string* a_nullable_string, + const EncodableValue* a_nullable_object, const EncodableList* list, + const EncodableList* string_list, const EncodableList* int_list, + const EncodableList* double_list, const EncodableList* bool_list, + const EncodableMap* map) + : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) + : std::nullopt), + a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) + : std::nullopt), + a_nullable_int64_(a_nullable_int64 + ? std::optional(*a_nullable_int64) + : std::nullopt), + a_nullable_double_(a_nullable_double + ? std::optional(*a_nullable_double) + : std::nullopt), + a_nullable_byte_array_( + a_nullable_byte_array + ? std::optional>(*a_nullable_byte_array) + : std::nullopt), + a_nullable4_byte_array_( + a_nullable4_byte_array + ? std::optional>(*a_nullable4_byte_array) + : std::nullopt), + a_nullable8_byte_array_( + a_nullable8_byte_array + ? std::optional>(*a_nullable8_byte_array) + : std::nullopt), + a_nullable_float_array_( + a_nullable_float_array + ? std::optional>(*a_nullable_float_array) + : std::nullopt), + nullable_nested_list_(nullable_nested_list ? std::optional( + *nullable_nested_list) + : std::nullopt), + nullable_map_with_annotations_( + nullable_map_with_annotations + ? std::optional(*nullable_map_with_annotations) + : std::nullopt), + nullable_map_with_object_( + nullable_map_with_object + ? std::optional(*nullable_map_with_object) + : std::nullopt), + a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) + : std::nullopt), + a_nullable_string_(a_nullable_string + ? std::optional(*a_nullable_string) + : std::nullopt), + a_nullable_object_(a_nullable_object + ? std::optional(*a_nullable_object) + : std::nullopt), + list_(list ? std::optional(*list) : std::nullopt), + string_list_(string_list ? std::optional(*string_list) + : std::nullopt), + int_list_(int_list ? std::optional(*int_list) + : std::nullopt), + double_list_(double_list ? std::optional(*double_list) + : std::nullopt), + bool_list_(bool_list ? std::optional(*bool_list) + : std::nullopt), + map_(map ? std::optional(*map) : std::nullopt) {} const bool* AllNullableTypesWithoutRecursion::a_nullable_bool() const { return a_nullable_bool_ ? &(*a_nullable_bool_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_bool(const bool* value_arg) { +void AllNullableTypesWithoutRecursion::set_a_nullable_bool( + const bool* value_arg) { a_nullable_bool_ = value_arg ? std::optional(*value_arg) : std::nullopt; } @@ -833,241 +936,284 @@ void AllNullableTypesWithoutRecursion::set_a_nullable_bool(bool value_arg) { a_nullable_bool_ = value_arg; } - const int64_t* AllNullableTypesWithoutRecursion::a_nullable_int() const { return a_nullable_int_ ? &(*a_nullable_int_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_int(const int64_t* value_arg) { - a_nullable_int_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable_int( + const int64_t* value_arg) { + a_nullable_int_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypesWithoutRecursion::set_a_nullable_int(int64_t value_arg) { a_nullable_int_ = value_arg; } - const int64_t* AllNullableTypesWithoutRecursion::a_nullable_int64() const { return a_nullable_int64_ ? &(*a_nullable_int64_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_int64(const int64_t* value_arg) { - a_nullable_int64_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable_int64( + const int64_t* value_arg) { + a_nullable_int64_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypesWithoutRecursion::set_a_nullable_int64(int64_t value_arg) { a_nullable_int64_ = value_arg; } - const double* AllNullableTypesWithoutRecursion::a_nullable_double() const { return a_nullable_double_ ? &(*a_nullable_double_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_double(const double* value_arg) { - a_nullable_double_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable_double( + const double* value_arg) { + a_nullable_double_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } void AllNullableTypesWithoutRecursion::set_a_nullable_double(double value_arg) { a_nullable_double_ = value_arg; } - -const std::vector* AllNullableTypesWithoutRecursion::a_nullable_byte_array() const { +const std::vector* +AllNullableTypesWithoutRecursion::a_nullable_byte_array() const { return a_nullable_byte_array_ ? &(*a_nullable_byte_array_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_byte_array(const std::vector* value_arg) { - a_nullable_byte_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable_byte_array( + const std::vector* value_arg) { + a_nullable_byte_array_ = value_arg + ? std::optional>(*value_arg) + : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_a_nullable_byte_array(const std::vector& value_arg) { +void AllNullableTypesWithoutRecursion::set_a_nullable_byte_array( + const std::vector& value_arg) { a_nullable_byte_array_ = value_arg; } - -const std::vector* AllNullableTypesWithoutRecursion::a_nullable4_byte_array() const { +const std::vector* +AllNullableTypesWithoutRecursion::a_nullable4_byte_array() const { return a_nullable4_byte_array_ ? &(*a_nullable4_byte_array_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable4_byte_array(const std::vector* value_arg) { - a_nullable4_byte_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable4_byte_array( + const std::vector* value_arg) { + a_nullable4_byte_array_ = + value_arg ? std::optional>(*value_arg) + : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_a_nullable4_byte_array(const std::vector& value_arg) { +void AllNullableTypesWithoutRecursion::set_a_nullable4_byte_array( + const std::vector& value_arg) { a_nullable4_byte_array_ = value_arg; } - -const std::vector* AllNullableTypesWithoutRecursion::a_nullable8_byte_array() const { +const std::vector* +AllNullableTypesWithoutRecursion::a_nullable8_byte_array() const { return a_nullable8_byte_array_ ? &(*a_nullable8_byte_array_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable8_byte_array(const std::vector* value_arg) { - a_nullable8_byte_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable8_byte_array( + const std::vector* value_arg) { + a_nullable8_byte_array_ = + value_arg ? std::optional>(*value_arg) + : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_a_nullable8_byte_array(const std::vector& value_arg) { +void AllNullableTypesWithoutRecursion::set_a_nullable8_byte_array( + const std::vector& value_arg) { a_nullable8_byte_array_ = value_arg; } - -const std::vector* AllNullableTypesWithoutRecursion::a_nullable_float_array() const { +const std::vector* +AllNullableTypesWithoutRecursion::a_nullable_float_array() const { return a_nullable_float_array_ ? &(*a_nullable_float_array_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_float_array(const std::vector* value_arg) { - a_nullable_float_array_ = value_arg ? std::optional>(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable_float_array( + const std::vector* value_arg) { + a_nullable_float_array_ = + value_arg ? std::optional>(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_a_nullable_float_array(const std::vector& value_arg) { +void AllNullableTypesWithoutRecursion::set_a_nullable_float_array( + const std::vector& value_arg) { a_nullable_float_array_ = value_arg; } - -const EncodableList* AllNullableTypesWithoutRecursion::nullable_nested_list() const { +const EncodableList* AllNullableTypesWithoutRecursion::nullable_nested_list() + const { return nullable_nested_list_ ? &(*nullable_nested_list_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_nullable_nested_list(const EncodableList* value_arg) { - nullable_nested_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_nullable_nested_list( + const EncodableList* value_arg) { + nullable_nested_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_nullable_nested_list(const EncodableList& value_arg) { +void AllNullableTypesWithoutRecursion::set_nullable_nested_list( + const EncodableList& value_arg) { nullable_nested_list_ = value_arg; } - -const EncodableMap* AllNullableTypesWithoutRecursion::nullable_map_with_annotations() const { - return nullable_map_with_annotations_ ? &(*nullable_map_with_annotations_) : nullptr; +const EncodableMap* +AllNullableTypesWithoutRecursion::nullable_map_with_annotations() const { + return nullable_map_with_annotations_ ? &(*nullable_map_with_annotations_) + : nullptr; } -void AllNullableTypesWithoutRecursion::set_nullable_map_with_annotations(const EncodableMap* value_arg) { - nullable_map_with_annotations_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_nullable_map_with_annotations( + const EncodableMap* value_arg) { + nullable_map_with_annotations_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_nullable_map_with_annotations(const EncodableMap& value_arg) { +void AllNullableTypesWithoutRecursion::set_nullable_map_with_annotations( + const EncodableMap& value_arg) { nullable_map_with_annotations_ = value_arg; } - -const EncodableMap* AllNullableTypesWithoutRecursion::nullable_map_with_object() const { +const EncodableMap* AllNullableTypesWithoutRecursion::nullable_map_with_object() + const { return nullable_map_with_object_ ? &(*nullable_map_with_object_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_nullable_map_with_object(const EncodableMap* value_arg) { - nullable_map_with_object_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_nullable_map_with_object( + const EncodableMap* value_arg) { + nullable_map_with_object_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_nullable_map_with_object(const EncodableMap& value_arg) { +void AllNullableTypesWithoutRecursion::set_nullable_map_with_object( + const EncodableMap& value_arg) { nullable_map_with_object_ = value_arg; } - const AnEnum* AllNullableTypesWithoutRecursion::a_nullable_enum() const { return a_nullable_enum_ ? &(*a_nullable_enum_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_enum(const AnEnum* value_arg) { - a_nullable_enum_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable_enum( + const AnEnum* value_arg) { + a_nullable_enum_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_a_nullable_enum(const AnEnum& value_arg) { +void AllNullableTypesWithoutRecursion::set_a_nullable_enum( + const AnEnum& value_arg) { a_nullable_enum_ = value_arg; } - const std::string* AllNullableTypesWithoutRecursion::a_nullable_string() const { return a_nullable_string_ ? &(*a_nullable_string_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_string(const std::string_view* value_arg) { - a_nullable_string_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable_string( + const std::string_view* value_arg) { + a_nullable_string_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_a_nullable_string(std::string_view value_arg) { +void AllNullableTypesWithoutRecursion::set_a_nullable_string( + std::string_view value_arg) { a_nullable_string_ = value_arg; } - -const EncodableValue* AllNullableTypesWithoutRecursion::a_nullable_object() const { +const EncodableValue* AllNullableTypesWithoutRecursion::a_nullable_object() + const { return a_nullable_object_ ? &(*a_nullable_object_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_a_nullable_object(const EncodableValue* value_arg) { - a_nullable_object_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_a_nullable_object( + const EncodableValue* value_arg) { + a_nullable_object_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_a_nullable_object(const EncodableValue& value_arg) { +void AllNullableTypesWithoutRecursion::set_a_nullable_object( + const EncodableValue& value_arg) { a_nullable_object_ = value_arg; } - const EncodableList* AllNullableTypesWithoutRecursion::list() const { return list_ ? &(*list_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_list(const EncodableList* value_arg) { +void AllNullableTypesWithoutRecursion::set_list( + const EncodableList* value_arg) { list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_list(const EncodableList& value_arg) { +void AllNullableTypesWithoutRecursion::set_list( + const EncodableList& value_arg) { list_ = value_arg; } - const EncodableList* AllNullableTypesWithoutRecursion::string_list() const { return string_list_ ? &(*string_list_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_string_list(const EncodableList* value_arg) { - string_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_string_list( + const EncodableList* value_arg) { + string_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_string_list(const EncodableList& value_arg) { +void AllNullableTypesWithoutRecursion::set_string_list( + const EncodableList& value_arg) { string_list_ = value_arg; } - const EncodableList* AllNullableTypesWithoutRecursion::int_list() const { return int_list_ ? &(*int_list_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_int_list(const EncodableList* value_arg) { - int_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_int_list( + const EncodableList* value_arg) { + int_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_int_list(const EncodableList& value_arg) { +void AllNullableTypesWithoutRecursion::set_int_list( + const EncodableList& value_arg) { int_list_ = value_arg; } - const EncodableList* AllNullableTypesWithoutRecursion::double_list() const { return double_list_ ? &(*double_list_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_double_list(const EncodableList* value_arg) { - double_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_double_list( + const EncodableList* value_arg) { + double_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_double_list(const EncodableList& value_arg) { +void AllNullableTypesWithoutRecursion::set_double_list( + const EncodableList& value_arg) { double_list_ = value_arg; } - const EncodableList* AllNullableTypesWithoutRecursion::bool_list() const { return bool_list_ ? &(*bool_list_) : nullptr; } -void AllNullableTypesWithoutRecursion::set_bool_list(const EncodableList* value_arg) { - bool_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; +void AllNullableTypesWithoutRecursion::set_bool_list( + const EncodableList* value_arg) { + bool_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypesWithoutRecursion::set_bool_list(const EncodableList& value_arg) { +void AllNullableTypesWithoutRecursion::set_bool_list( + const EncodableList& value_arg) { bool_list_ = value_arg; } - const EncodableMap* AllNullableTypesWithoutRecursion::map() const { return map_ ? &(*map_) : nullptr; } @@ -1080,34 +1226,55 @@ void AllNullableTypesWithoutRecursion::set_map(const EncodableMap& value_arg) { map_ = value_arg; } - EncodableList AllNullableTypesWithoutRecursion::ToEncodableList() const { EncodableList list; list.reserve(20); - list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) : EncodableValue()); - list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) : EncodableValue()); - list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) : EncodableValue()); - list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) : EncodableValue()); - list.push_back(a_nullable_byte_array_ ? EncodableValue(*a_nullable_byte_array_) : EncodableValue()); - list.push_back(a_nullable4_byte_array_ ? EncodableValue(*a_nullable4_byte_array_) : EncodableValue()); - list.push_back(a_nullable8_byte_array_ ? EncodableValue(*a_nullable8_byte_array_) : EncodableValue()); - list.push_back(a_nullable_float_array_ ? EncodableValue(*a_nullable_float_array_) : EncodableValue()); - list.push_back(nullable_nested_list_ ? EncodableValue(*nullable_nested_list_) : EncodableValue()); - list.push_back(nullable_map_with_annotations_ ? EncodableValue(*nullable_map_with_annotations_) : EncodableValue()); - list.push_back(nullable_map_with_object_ ? EncodableValue(*nullable_map_with_object_) : EncodableValue()); - list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) : EncodableValue()); - list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_) : EncodableValue()); + list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) + : EncodableValue()); + list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) + : EncodableValue()); + list.push_back(a_nullable_int64_ ? EncodableValue(*a_nullable_int64_) + : EncodableValue()); + list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_) + : EncodableValue()); + list.push_back(a_nullable_byte_array_ + ? EncodableValue(*a_nullable_byte_array_) + : EncodableValue()); + list.push_back(a_nullable4_byte_array_ + ? EncodableValue(*a_nullable4_byte_array_) + : EncodableValue()); + list.push_back(a_nullable8_byte_array_ + ? EncodableValue(*a_nullable8_byte_array_) + : EncodableValue()); + list.push_back(a_nullable_float_array_ + ? EncodableValue(*a_nullable_float_array_) + : EncodableValue()); + list.push_back(nullable_nested_list_ ? EncodableValue(*nullable_nested_list_) + : EncodableValue()); + list.push_back(nullable_map_with_annotations_ + ? EncodableValue(*nullable_map_with_annotations_) + : EncodableValue()); + list.push_back(nullable_map_with_object_ + ? EncodableValue(*nullable_map_with_object_) + : EncodableValue()); + list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) + : EncodableValue()); + list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_) + : EncodableValue()); list.push_back(a_nullable_object_ ? *a_nullable_object_ : EncodableValue()); list.push_back(list_ ? EncodableValue(*list_) : EncodableValue()); - list.push_back(string_list_ ? EncodableValue(*string_list_) : EncodableValue()); + list.push_back(string_list_ ? EncodableValue(*string_list_) + : EncodableValue()); list.push_back(int_list_ ? EncodableValue(*int_list_) : EncodableValue()); - list.push_back(double_list_ ? EncodableValue(*double_list_) : EncodableValue()); + list.push_back(double_list_ ? EncodableValue(*double_list_) + : EncodableValue()); list.push_back(bool_list_ ? EncodableValue(*bool_list_) : EncodableValue()); list.push_back(map_ ? EncodableValue(*map_) : EncodableValue()); return list; } -AllNullableTypesWithoutRecursion AllNullableTypesWithoutRecursion::FromEncodableList(const EncodableList& list) { +AllNullableTypesWithoutRecursion +AllNullableTypesWithoutRecursion::FromEncodableList(const EncodableList& list) { AllNullableTypesWithoutRecursion decoded; auto& encodable_a_nullable_bool = list[0]; if (!encodable_a_nullable_bool.IsNull()) { @@ -1123,43 +1290,53 @@ AllNullableTypesWithoutRecursion AllNullableTypesWithoutRecursion::FromEncodable } auto& encodable_a_nullable_double = list[3]; if (!encodable_a_nullable_double.IsNull()) { - decoded.set_a_nullable_double(std::get(encodable_a_nullable_double)); + decoded.set_a_nullable_double( + std::get(encodable_a_nullable_double)); } auto& encodable_a_nullable_byte_array = list[4]; if (!encodable_a_nullable_byte_array.IsNull()) { - decoded.set_a_nullable_byte_array(std::get>(encodable_a_nullable_byte_array)); + decoded.set_a_nullable_byte_array( + std::get>(encodable_a_nullable_byte_array)); } auto& encodable_a_nullable4_byte_array = list[5]; if (!encodable_a_nullable4_byte_array.IsNull()) { - decoded.set_a_nullable4_byte_array(std::get>(encodable_a_nullable4_byte_array)); + decoded.set_a_nullable4_byte_array( + std::get>(encodable_a_nullable4_byte_array)); } auto& encodable_a_nullable8_byte_array = list[6]; if (!encodable_a_nullable8_byte_array.IsNull()) { - decoded.set_a_nullable8_byte_array(std::get>(encodable_a_nullable8_byte_array)); + decoded.set_a_nullable8_byte_array( + std::get>(encodable_a_nullable8_byte_array)); } auto& encodable_a_nullable_float_array = list[7]; if (!encodable_a_nullable_float_array.IsNull()) { - decoded.set_a_nullable_float_array(std::get>(encodable_a_nullable_float_array)); + decoded.set_a_nullable_float_array( + std::get>(encodable_a_nullable_float_array)); } auto& encodable_nullable_nested_list = list[8]; if (!encodable_nullable_nested_list.IsNull()) { - decoded.set_nullable_nested_list(std::get(encodable_nullable_nested_list)); + decoded.set_nullable_nested_list( + std::get(encodable_nullable_nested_list)); } auto& encodable_nullable_map_with_annotations = list[9]; if (!encodable_nullable_map_with_annotations.IsNull()) { - decoded.set_nullable_map_with_annotations(std::get(encodable_nullable_map_with_annotations)); + decoded.set_nullable_map_with_annotations( + std::get(encodable_nullable_map_with_annotations)); } auto& encodable_nullable_map_with_object = list[10]; if (!encodable_nullable_map_with_object.IsNull()) { - decoded.set_nullable_map_with_object(std::get(encodable_nullable_map_with_object)); + decoded.set_nullable_map_with_object( + std::get(encodable_nullable_map_with_object)); } auto& encodable_a_nullable_enum = list[11]; if (!encodable_a_nullable_enum.IsNull()) { - decoded.set_a_nullable_enum(std::any_cast(std::get(encodable_a_nullable_enum))); + decoded.set_a_nullable_enum(std::any_cast( + std::get(encodable_a_nullable_enum))); } auto& encodable_a_nullable_string = list[12]; if (!encodable_a_nullable_string.IsNull()) { - decoded.set_a_nullable_string(std::get(encodable_a_nullable_string)); + decoded.set_a_nullable_string( + std::get(encodable_a_nullable_string)); } auto& encodable_a_nullable_object = list[13]; if (!encodable_a_nullable_object.IsNull()) { @@ -1195,25 +1372,46 @@ AllNullableTypesWithoutRecursion AllNullableTypesWithoutRecursion::FromEncodable // AllClassesWrapper AllClassesWrapper::AllClassesWrapper(const AllNullableTypes& all_nullable_types) - : all_nullable_types_(std::make_unique(all_nullable_types)) {} - -AllClassesWrapper::AllClassesWrapper( - const AllNullableTypes& all_nullable_types, - const AllNullableTypesWithoutRecursion* all_nullable_types_without_recursion, - const AllTypes* all_types) - : all_nullable_types_(std::make_unique(all_nullable_types)), - all_nullable_types_without_recursion_(all_nullable_types_without_recursion ? std::make_unique(*all_nullable_types_without_recursion) : nullptr), - all_types_(all_types ? std::make_unique(*all_types) : nullptr) {} + : all_nullable_types_( + std::make_unique(all_nullable_types)) {} + +AllClassesWrapper::AllClassesWrapper(const AllNullableTypes& all_nullable_types, + const AllNullableTypesWithoutRecursion* + all_nullable_types_without_recursion, + const AllTypes* all_types) + : all_nullable_types_( + std::make_unique(all_nullable_types)), + all_nullable_types_without_recursion_( + all_nullable_types_without_recursion + ? std::make_unique( + *all_nullable_types_without_recursion) + : nullptr), + all_types_(all_types ? std::make_unique(*all_types) : nullptr) { +} AllClassesWrapper::AllClassesWrapper(const AllClassesWrapper& other) - : all_nullable_types_(std::make_unique(*other.all_nullable_types_)), - all_nullable_types_without_recursion_(other.all_nullable_types_without_recursion_ ? std::make_unique(*other.all_nullable_types_without_recursion_) : nullptr), - all_types_(other.all_types_ ? std::make_unique(*other.all_types_) : nullptr) {} - -AllClassesWrapper& AllClassesWrapper::operator=(const AllClassesWrapper& other) { - all_nullable_types_ = std::make_unique(*other.all_nullable_types_); - all_nullable_types_without_recursion_ = other.all_nullable_types_without_recursion_ ? std::make_unique(*other.all_nullable_types_without_recursion_) : nullptr; - all_types_ = other.all_types_ ? std::make_unique(*other.all_types_) : nullptr; + : all_nullable_types_( + std::make_unique(*other.all_nullable_types_)), + all_nullable_types_without_recursion_( + other.all_nullable_types_without_recursion_ + ? std::make_unique( + *other.all_nullable_types_without_recursion_) + : nullptr), + all_types_(other.all_types_ + ? std::make_unique(*other.all_types_) + : nullptr) {} + +AllClassesWrapper& AllClassesWrapper::operator=( + const AllClassesWrapper& other) { + all_nullable_types_ = + std::make_unique(*other.all_nullable_types_); + all_nullable_types_without_recursion_ = + other.all_nullable_types_without_recursion_ + ? std::make_unique( + *other.all_nullable_types_without_recursion_) + : nullptr; + all_types_ = other.all_types_ ? std::make_unique(*other.all_types_) + : nullptr; return *this; } @@ -1221,24 +1419,29 @@ const AllNullableTypes& AllClassesWrapper::all_nullable_types() const { return *all_nullable_types_; } -void AllClassesWrapper::set_all_nullable_types(const AllNullableTypes& value_arg) { +void AllClassesWrapper::set_all_nullable_types( + const AllNullableTypes& value_arg) { all_nullable_types_ = std::make_unique(value_arg); } - -const AllNullableTypesWithoutRecursion* AllClassesWrapper::all_nullable_types_without_recursion() const { +const AllNullableTypesWithoutRecursion* +AllClassesWrapper::all_nullable_types_without_recursion() const { return all_nullable_types_without_recursion_.get(); } -void AllClassesWrapper::set_all_nullable_types_without_recursion(const AllNullableTypesWithoutRecursion* value_arg) { - all_nullable_types_without_recursion_ = value_arg ? std::make_unique(*value_arg) : nullptr; +void AllClassesWrapper::set_all_nullable_types_without_recursion( + const AllNullableTypesWithoutRecursion* value_arg) { + all_nullable_types_without_recursion_ = + value_arg ? std::make_unique(*value_arg) + : nullptr; } -void AllClassesWrapper::set_all_nullable_types_without_recursion(const AllNullableTypesWithoutRecursion& value_arg) { - all_nullable_types_without_recursion_ = std::make_unique(value_arg); +void AllClassesWrapper::set_all_nullable_types_without_recursion( + const AllNullableTypesWithoutRecursion& value_arg) { + all_nullable_types_without_recursion_ = + std::make_unique(value_arg); } - const AllTypes* AllClassesWrapper::all_types() const { return all_types_.get(); } @@ -1251,26 +1454,34 @@ void AllClassesWrapper::set_all_types(const AllTypes& value_arg) { all_types_ = std::make_unique(value_arg); } - EncodableList AllClassesWrapper::ToEncodableList() const { EncodableList list; list.reserve(3); list.push_back(CustomEncodableValue(*all_nullable_types_)); - list.push_back(all_nullable_types_without_recursion_ ? CustomEncodableValue(*all_nullable_types_without_recursion_) : EncodableValue()); - list.push_back(all_types_ ? CustomEncodableValue(*all_types_) : EncodableValue()); + list.push_back( + all_nullable_types_without_recursion_ + ? CustomEncodableValue(*all_nullable_types_without_recursion_) + : EncodableValue()); + list.push_back(all_types_ ? CustomEncodableValue(*all_types_) + : EncodableValue()); return list; } -AllClassesWrapper AllClassesWrapper::FromEncodableList(const EncodableList& list) { - AllClassesWrapper decoded( - std::any_cast(std::get(list[0]))); +AllClassesWrapper AllClassesWrapper::FromEncodableList( + const EncodableList& list) { + AllClassesWrapper decoded(std::any_cast( + std::get(list[0]))); auto& encodable_all_nullable_types_without_recursion = list[1]; if (!encodable_all_nullable_types_without_recursion.IsNull()) { - decoded.set_all_nullable_types_without_recursion(std::any_cast(std::get(encodable_all_nullable_types_without_recursion))); + decoded.set_all_nullable_types_without_recursion( + std::any_cast( + std::get( + encodable_all_nullable_types_without_recursion))); } auto& encodable_all_types = list[2]; if (!encodable_all_types.IsNull()) { - decoded.set_all_types(std::any_cast(std::get(encodable_all_types))); + decoded.set_all_types(std::any_cast( + std::get(encodable_all_types))); } return decoded; } @@ -1280,21 +1491,22 @@ AllClassesWrapper AllClassesWrapper::FromEncodableList(const EncodableList& list TestMessage::TestMessage() {} TestMessage::TestMessage(const EncodableList* test_list) - : test_list_(test_list ? std::optional(*test_list) : std::nullopt) {} + : test_list_(test_list ? std::optional(*test_list) + : std::nullopt) {} const EncodableList* TestMessage::test_list() const { return test_list_ ? &(*test_list_) : nullptr; } void TestMessage::set_test_list(const EncodableList* value_arg) { - test_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; + test_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; } void TestMessage::set_test_list(const EncodableList& value_arg) { test_list_ = value_arg; } - EncodableList TestMessage::ToEncodableList() const { EncodableList list; list.reserve(1); @@ -1311,66 +1523,87 @@ TestMessage TestMessage::FromEncodableList(const EncodableList& list) { return decoded; } - PigeonCodecSerializer::PigeonCodecSerializer() {} EncodableValue PigeonCodecSerializer::ReadValueOfType( - uint8_t type, - flutter::ByteStreamReader* stream) const { + uint8_t type, flutter::ByteStreamReader* stream) const { switch (type) { case 129: - return CustomEncodableValue(AllTypes::FromEncodableList(std::get(ReadValue(stream)))); + return CustomEncodableValue(AllTypes::FromEncodableList( + std::get(ReadValue(stream)))); case 130: - return CustomEncodableValue(AllNullableTypes::FromEncodableList(std::get(ReadValue(stream)))); + return CustomEncodableValue(AllNullableTypes::FromEncodableList( + std::get(ReadValue(stream)))); case 131: - return CustomEncodableValue(AllNullableTypesWithoutRecursion::FromEncodableList(std::get(ReadValue(stream)))); + return CustomEncodableValue( + AllNullableTypesWithoutRecursion::FromEncodableList( + std::get(ReadValue(stream)))); case 132: - return CustomEncodableValue(AllClassesWrapper::FromEncodableList(std::get(ReadValue(stream)))); + return CustomEncodableValue(AllClassesWrapper::FromEncodableList( + std::get(ReadValue(stream)))); case 133: - return CustomEncodableValue(TestMessage::FromEncodableList(std::get(ReadValue(stream)))); - case 134: - { - const auto& encodable_enum_arg = ReadValue(stream); - const int64_t enum_arg_value = encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); - return encodable_enum_arg.IsNull() ? EncodableValue() : CustomEncodableValue(static_cast(enum_arg_value)); - } + return CustomEncodableValue(TestMessage::FromEncodableList( + std::get(ReadValue(stream)))); + case 134: { + const auto& encodable_enum_arg = ReadValue(stream); + const int64_t enum_arg_value = + encodable_enum_arg.IsNull() ? 0 : encodable_enum_arg.LongValue(); + return encodable_enum_arg.IsNull() + ? EncodableValue() + : CustomEncodableValue(static_cast(enum_arg_value)); + } default: return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); - } + } } void PigeonCodecSerializer::WriteValue( - const EncodableValue& value, - flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = std::get_if(&value)) { + const EncodableValue& value, flutter::ByteStreamWriter* stream) const { + if (const CustomEncodableValue* custom_value = + std::get_if(&value)) { if (custom_value->type() == typeid(AllTypes)) { stream->WriteByte(129); - WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); + WriteValue(EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); return; } if (custom_value->type() == typeid(AllNullableTypes)) { stream->WriteByte(130); - WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); return; } if (custom_value->type() == typeid(AllNullableTypesWithoutRecursion)) { stream->WriteByte(131); - WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); + WriteValue(EncodableValue(std::any_cast( + *custom_value) + .ToEncodableList()), + stream); return; } if (custom_value->type() == typeid(AllClassesWrapper)) { stream->WriteByte(132); - WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); + WriteValue(EncodableValue(std::any_cast(*custom_value) + .ToEncodableList()), + stream); return; } if (custom_value->type() == typeid(TestMessage)) { stream->WriteByte(133); - WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); return; } if (custom_value->type() == typeid(AnEnum)) { stream->WriteByte(134); - WriteValue(EncodableValue(static_cast(std::any_cast(*custom_value))), stream); + WriteValue(EncodableValue( + static_cast(std::any_cast(*custom_value))), + stream); return; } } @@ -1379,578 +1612,706 @@ void PigeonCodecSerializer::WriteValue( /// The codec used by HostIntegrationCoreApi. const flutter::StandardMessageCodec& HostIntegrationCoreApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance(&PigeonCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance( + &PigeonCodecSerializer::GetInstance()); } -// Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binary_messenger`. -void HostIntegrationCoreApi::SetUp( - flutter::BinaryMessenger* binary_messenger, - HostIntegrationCoreApi* api) { +// Sets up an instance of `HostIntegrationCoreApi` to handle messages through +// the `binary_messenger`. +void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, + HostIntegrationCoreApi* api) { HostIntegrationCoreApi::SetUp(binary_messenger, api, ""); } -void HostIntegrationCoreApi::SetUp( - flutter::BinaryMessenger* binary_messenger, - HostIntegrationCoreApi* api, - const std::string& message_channel_suffix) { - const std::string prepended_suffix = message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix : ""; +void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, + HostIntegrationCoreApi* api, + const std::string& message_channel_suffix) { + const std::string prepended_suffix = + message_channel_suffix.length() > 0 + ? std::string(".") + message_channel_suffix + : ""; { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.noop" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - std::optional output = api->Noop(); - if (output.has_value()) { - reply(WrapError(output.value())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + std::optional output = api->Noop(); + if (output.has_value()) { + reply(WrapError(output.value())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAllTypes" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - if (encodable_everything_arg.IsNull()) { - reply(WrapError("everything_arg unexpectedly null.")); - return; - } - const auto& everything_arg = std::any_cast(std::get(encodable_everything_arg)); - ErrorOr output = api->EchoAllTypes(everything_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + if (encodable_everything_arg.IsNull()) { + reply(WrapError("everything_arg unexpectedly null.")); + return; + } + const auto& everything_arg = std::any_cast( + std::get(encodable_everything_arg)); + ErrorOr output = api->EchoAllTypes(everything_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.throwError" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - ErrorOr> output = api->ThrowError(); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + ErrorOr> output = api->ThrowError(); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.throwErrorFromVoid" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - std::optional output = api->ThrowErrorFromVoid(); - if (output.has_value()) { - reply(WrapError(output.value())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + std::optional output = api->ThrowErrorFromVoid(); + if (output.has_value()) { + reply(WrapError(output.value())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.throwFlutterError" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - ErrorOr> output = api->ThrowFlutterError(); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + ErrorOr> output = + api->ThrowFlutterError(); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoInt" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - if (encodable_an_int_arg.IsNull()) { - reply(WrapError("an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = encodable_an_int_arg.LongValue(); - ErrorOr output = api->EchoInt(an_int_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_int_arg = args.at(0); + if (encodable_an_int_arg.IsNull()) { + reply(WrapError("an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = encodable_an_int_arg.LongValue(); + ErrorOr output = api->EchoInt(an_int_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoDouble" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - if (encodable_a_double_arg.IsNull()) { - reply(WrapError("a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = std::get(encodable_a_double_arg); - ErrorOr output = api->EchoDouble(a_double_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_double_arg = args.at(0); + if (encodable_a_double_arg.IsNull()) { + reply(WrapError("a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = + std::get(encodable_a_double_arg); + ErrorOr output = api->EchoDouble(a_double_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoBool" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_bool_arg = args.at(0); - if (encodable_a_bool_arg.IsNull()) { - reply(WrapError("a_bool_arg unexpectedly null.")); - return; - } - const auto& a_bool_arg = std::get(encodable_a_bool_arg); - ErrorOr output = api->EchoBool(a_bool_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_bool_arg = args.at(0); + if (encodable_a_bool_arg.IsNull()) { + reply(WrapError("a_bool_arg unexpectedly null.")); + return; + } + const auto& a_bool_arg = std::get(encodable_a_bool_arg); + ErrorOr output = api->EchoBool(a_bool_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoString" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = std::get(encodable_a_string_arg); - ErrorOr output = api->EchoString(a_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get(encodable_a_string_arg); + ErrorOr output = api->EchoString(a_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoUint8List" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_uint8_list_arg = args.at(0); - if (encodable_a_uint8_list_arg.IsNull()) { - reply(WrapError("a_uint8_list_arg unexpectedly null.")); - return; - } - const auto& a_uint8_list_arg = std::get>(encodable_a_uint8_list_arg); - ErrorOr> output = api->EchoUint8List(a_uint8_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); - } else { - channel.SetMessageHandler(nullptr); - } - } - { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject" + prepended_suffix, &GetCodec()); - if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_object_arg = args.at(0); - if (encodable_an_object_arg.IsNull()) { - reply(WrapError("an_object_arg unexpectedly null.")); - return; - } - const auto& an_object_arg = encodable_an_object_arg; - ErrorOr output = api->EchoObject(an_object_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_uint8_list_arg = args.at(0); + if (encodable_a_uint8_list_arg.IsNull()) { + reply(WrapError("a_uint8_list_arg unexpectedly null.")); + return; + } + const auto& a_uint8_list_arg = + std::get>(encodable_a_uint8_list_arg); + ErrorOr> output = + api->EchoUint8List(a_uint8_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoObject" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - if (encodable_list_arg.IsNull()) { - reply(WrapError("list_arg unexpectedly null.")); - return; - } - const auto& list_arg = std::get(encodable_list_arg); - ErrorOr output = api->EchoList(list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_object_arg = args.at(0); + if (encodable_an_object_arg.IsNull()) { + reply(WrapError("an_object_arg unexpectedly null.")); + return; + } + const auto& an_object_arg = encodable_an_object_arg; + ErrorOr output = api->EchoObject(an_object_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoList" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - if (encodable_a_map_arg.IsNull()) { - reply(WrapError("a_map_arg unexpectedly null.")); - return; - } - const auto& a_map_arg = std::get(encodable_a_map_arg); - ErrorOr output = api->EchoMap(a_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + if (encodable_list_arg.IsNull()) { + reply(WrapError("list_arg unexpectedly null.")); + return; + } + const auto& list_arg = + std::get(encodable_list_arg); + ErrorOr output = api->EchoList(list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_wrapper_arg = args.at(0); - if (encodable_wrapper_arg.IsNull()) { - reply(WrapError("wrapper_arg unexpectedly null.")); - return; - } - const auto& wrapper_arg = std::any_cast(std::get(encodable_wrapper_arg)); - ErrorOr output = api->EchoClassWrapper(wrapper_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_map_arg = args.at(0); + if (encodable_a_map_arg.IsNull()) { + reply(WrapError("a_map_arg unexpectedly null.")); + return; + } + const auto& a_map_arg = + std::get(encodable_a_map_arg); + ErrorOr output = api->EchoMap(a_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoClassWrapper" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - if (encodable_an_enum_arg.IsNull()) { - reply(WrapError("an_enum_arg unexpectedly null.")); - return; - } - const auto& an_enum_arg = std::any_cast(std::get(encodable_an_enum_arg)); - ErrorOr output = api->EchoEnum(an_enum_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_wrapper_arg = args.at(0); + if (encodable_wrapper_arg.IsNull()) { + reply(WrapError("wrapper_arg unexpectedly null.")); + return; + } + const auto& wrapper_arg = std::any_cast( + std::get(encodable_wrapper_arg)); + ErrorOr output = + api->EchoClassWrapper(wrapper_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoEnum" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = std::get(encodable_a_string_arg); - ErrorOr output = api->EchoNamedDefaultString(a_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + if (encodable_an_enum_arg.IsNull()) { + reply(WrapError("an_enum_arg unexpectedly null.")); + return; + } + const auto& an_enum_arg = std::any_cast( + std::get(encodable_an_enum_arg)); + ErrorOr output = api->EchoEnum(an_enum_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNamedDefaultString" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - if (encodable_a_double_arg.IsNull()) { - reply(WrapError("a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = std::get(encodable_a_double_arg); - ErrorOr output = api->EchoOptionalDefaultDouble(a_double_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get(encodable_a_string_arg); + ErrorOr output = + api->EchoNamedDefaultString(a_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoOptionalDefaultDouble" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - if (encodable_an_int_arg.IsNull()) { - reply(WrapError("an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = encodable_an_int_arg.LongValue(); - ErrorOr output = api->EchoRequiredInt(an_int_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_double_arg = args.at(0); + if (encodable_a_double_arg.IsNull()) { + reply(WrapError("a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = + std::get(encodable_a_double_arg); + ErrorOr output = + api->EchoOptionalDefaultDouble(a_double_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoRequiredInt" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = encodable_everything_arg.IsNull() ? nullptr : &(std::any_cast(std::get(encodable_everything_arg))); - ErrorOr> output = api->EchoAllNullableTypes(everything_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_int_arg = args.at(0); + if (encodable_an_int_arg.IsNull()) { + reply(WrapError("an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = encodable_an_int_arg.LongValue(); + ErrorOr output = api->EchoRequiredInt(an_int_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAllNullableTypes" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = encodable_everything_arg.IsNull() ? nullptr : &(std::any_cast(std::get(encodable_everything_arg))); - ErrorOr> output = api->EchoAllNullableTypesWithoutRecursion(everything_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + ErrorOr> output = + api->EchoAllNullableTypes(everything_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAllNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + channel.SetMessageHandler([api]( + const EncodableValue& message, + const flutter::MessageReply& + reply) { try { const auto& args = std::get(message); - const auto& encodable_wrapper_arg = args.at(0); - if (encodable_wrapper_arg.IsNull()) { - reply(WrapError("wrapper_arg unexpectedly null.")); - return; - } - const auto& wrapper_arg = std::any_cast(std::get(encodable_wrapper_arg)); - ErrorOr> output = api->ExtractNestedNullableString(wrapper_arg); + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + ErrorOr> output = + api->EchoAllNullableTypesWithoutRecursion(everything_arg); if (output.has_error()) { reply(WrapError(output.error())); return; @@ -1958,7 +2319,8 @@ void HostIntegrationCoreApi::SetUp( EncodableList wrapped; auto output_optional = std::move(output).TakeValue(); if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); } else { wrapped.push_back(EncodableValue()); } @@ -1972,853 +2334,1205 @@ void HostIntegrationCoreApi::SetUp( } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "extractNestedNullableString" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_nullable_string_arg = args.at(0); - const auto* nullable_string_arg = std::get_if(&encodable_nullable_string_arg); - ErrorOr output = api->CreateNestedNullableString(nullable_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_wrapper_arg = args.at(0); + if (encodable_wrapper_arg.IsNull()) { + reply(WrapError("wrapper_arg unexpectedly null.")); + return; + } + const auto& wrapper_arg = std::any_cast( + std::get(encodable_wrapper_arg)); + ErrorOr> output = + api->ExtractNestedNullableString(wrapper_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "createNestedNullableString" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = std::get_if(&encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = args.at(1); - const int64_t a_nullable_int_arg_value = encodable_a_nullable_int_arg.IsNull() ? 0 : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = encodable_a_nullable_int_arg.IsNull() ? nullptr : &a_nullable_int_arg_value; - const auto& encodable_a_nullable_string_arg = args.at(2); - const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); - ErrorOr output = api->SendMultipleNullableTypes(a_nullable_bool_arg, a_nullable_int_arg, a_nullable_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_nullable_string_arg = args.at(0); + const auto* nullable_string_arg = + std::get_if(&encodable_nullable_string_arg); + ErrorOr output = + api->CreateNestedNullableString(nullable_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "sendMultipleNullableTypes" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = std::get_if(&encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = args.at(1); - const int64_t a_nullable_int_arg_value = encodable_a_nullable_int_arg.IsNull() ? 0 : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = encodable_a_nullable_int_arg.IsNull() ? nullptr : &a_nullable_int_arg_value; - const auto& encodable_a_nullable_string_arg = args.at(2); - const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); - ErrorOr output = api->SendMultipleNullableTypesWithoutRecursion(a_nullable_bool_arg, a_nullable_int_arg, a_nullable_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = + std::get_if(&encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = args.at(1); + const int64_t a_nullable_int_arg_value = + encodable_a_nullable_int_arg.IsNull() + ? 0 + : encodable_a_nullable_int_arg.LongValue(); + const auto* a_nullable_int_arg = + encodable_a_nullable_int_arg.IsNull() + ? nullptr + : &a_nullable_int_arg_value; + const auto& encodable_a_nullable_string_arg = args.at(2); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + ErrorOr output = api->SendMultipleNullableTypes( + a_nullable_bool_arg, a_nullable_int_arg, + a_nullable_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "sendMultipleNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_int_arg = args.at(0); - const int64_t a_nullable_int_arg_value = encodable_a_nullable_int_arg.IsNull() ? 0 : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = encodable_a_nullable_int_arg.IsNull() ? nullptr : &a_nullable_int_arg_value; - ErrorOr> output = api->EchoNullableInt(a_nullable_int_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = + std::get_if(&encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = args.at(1); + const int64_t a_nullable_int_arg_value = + encodable_a_nullable_int_arg.IsNull() + ? 0 + : encodable_a_nullable_int_arg.LongValue(); + const auto* a_nullable_int_arg = + encodable_a_nullable_int_arg.IsNull() + ? nullptr + : &a_nullable_int_arg_value; + const auto& encodable_a_nullable_string_arg = args.at(2); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + ErrorOr output = + api->SendMultipleNullableTypesWithoutRecursion( + a_nullable_bool_arg, a_nullable_int_arg, + a_nullable_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableInt" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_double_arg = args.at(0); - const auto* a_nullable_double_arg = std::get_if(&encodable_a_nullable_double_arg); - ErrorOr> output = api->EchoNullableDouble(a_nullable_double_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_int_arg = args.at(0); + const int64_t a_nullable_int_arg_value = + encodable_a_nullable_int_arg.IsNull() + ? 0 + : encodable_a_nullable_int_arg.LongValue(); + const auto* a_nullable_int_arg = + encodable_a_nullable_int_arg.IsNull() + ? nullptr + : &a_nullable_int_arg_value; + ErrorOr> output = + api->EchoNullableInt(a_nullable_int_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableDouble" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = std::get_if(&encodable_a_nullable_bool_arg); - ErrorOr> output = api->EchoNullableBool(a_nullable_bool_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_double_arg = args.at(0); + const auto* a_nullable_double_arg = + std::get_if(&encodable_a_nullable_double_arg); + ErrorOr> output = + api->EchoNullableDouble(a_nullable_double_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableBool" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_string_arg = args.at(0); - const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); - ErrorOr> output = api->EchoNullableString(a_nullable_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = + std::get_if(&encodable_a_nullable_bool_arg); + ErrorOr> output = + api->EchoNullableBool(a_nullable_bool_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableString" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_uint8_list_arg = args.at(0); - const auto* a_nullable_uint8_list_arg = std::get_if>(&encodable_a_nullable_uint8_list_arg); - ErrorOr>> output = api->EchoNullableUint8List(a_nullable_uint8_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_string_arg = args.at(0); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + ErrorOr> output = + api->EchoNullableString(a_nullable_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableUint8List" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_object_arg = args.at(0); - const auto* a_nullable_object_arg = &encodable_a_nullable_object_arg; - ErrorOr> output = api->EchoNullableObject(a_nullable_object_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_uint8_list_arg = args.at(0); + const auto* a_nullable_uint8_list_arg = + std::get_if>( + &encodable_a_nullable_uint8_list_arg); + ErrorOr>> output = + api->EchoNullableUint8List(a_nullable_uint8_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableObject" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_list_arg = args.at(0); - const auto* a_nullable_list_arg = std::get_if(&encodable_a_nullable_list_arg); - ErrorOr> output = api->EchoNullableList(a_nullable_list_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_object_arg = args.at(0); + const auto* a_nullable_object_arg = + &encodable_a_nullable_object_arg; + ErrorOr> output = + api->EchoNullableObject(a_nullable_object_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableList" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_map_arg = args.at(0); - const auto* a_nullable_map_arg = std::get_if(&encodable_a_nullable_map_arg); - ErrorOr> output = api->EchoNullableMap(a_nullable_map_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_list_arg = args.at(0); + const auto* a_nullable_list_arg = + std::get_if(&encodable_a_nullable_list_arg); + ErrorOr> output = + api->EchoNullableList(a_nullable_list_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - AnEnum an_enum_arg_value; - const AnEnum* an_enum_arg = nullptr; - if (!encodable_an_enum_arg.IsNull()) { - an_enum_arg_value = std::any_cast(std::get(encodable_an_enum_arg)); - an_enum_arg = &an_enum_arg_value; - } - ErrorOr> output = api->EchoNullableEnum(an_enum_arg ? &(*an_enum_arg) : nullptr); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_map_arg = args.at(0); + const auto* a_nullable_map_arg = + std::get_if(&encodable_a_nullable_map_arg); + ErrorOr> output = + api->EchoNullableMap(a_nullable_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableEnum" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_int_arg = args.at(0); - const int64_t a_nullable_int_arg_value = encodable_a_nullable_int_arg.IsNull() ? 0 : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = encodable_a_nullable_int_arg.IsNull() ? nullptr : &a_nullable_int_arg_value; - ErrorOr> output = api->EchoOptionalNullableInt(a_nullable_int_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + AnEnum an_enum_arg_value; + const AnEnum* an_enum_arg = nullptr; + if (!encodable_an_enum_arg.IsNull()) { + an_enum_arg_value = std::any_cast( + std::get(encodable_an_enum_arg)); + an_enum_arg = &an_enum_arg_value; + } + ErrorOr> output = api->EchoNullableEnum( + an_enum_arg ? &(*an_enum_arg) : nullptr); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoOptionalNullableInt" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_string_arg = args.at(0); - const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); - ErrorOr> output = api->EchoNamedNullableString(a_nullable_string_arg); - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_int_arg = args.at(0); + const int64_t a_nullable_int_arg_value = + encodable_a_nullable_int_arg.IsNull() + ? 0 + : encodable_a_nullable_int_arg.LongValue(); + const auto* a_nullable_int_arg = + encodable_a_nullable_int_arg.IsNull() + ? nullptr + : &a_nullable_int_arg_value; + ErrorOr> output = + api->EchoOptionalNullableInt(a_nullable_int_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNamedNullableString" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - api->NoopAsync([reply](std::optional&& output) { - if (output.has_value()) { - reply(WrapError(output.value())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_string_arg = args.at(0); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + ErrorOr> output = + api->EchoNamedNullableString(a_nullable_string_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.noopAsync" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - if (encodable_an_int_arg.IsNull()) { - reply(WrapError("an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = encodable_an_int_arg.LongValue(); - api->EchoAsyncInt(an_int_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + api->NoopAsync([reply](std::optional&& output) { + if (output.has_value()) { + reply(WrapError(output.value())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncInt" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - if (encodable_a_double_arg.IsNull()) { - reply(WrapError("a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = std::get(encodable_a_double_arg); - api->EchoAsyncDouble(a_double_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_int_arg = args.at(0); + if (encodable_an_int_arg.IsNull()) { + reply(WrapError("an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = encodable_an_int_arg.LongValue(); + api->EchoAsyncInt(an_int_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncDouble" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_bool_arg = args.at(0); - if (encodable_a_bool_arg.IsNull()) { - reply(WrapError("a_bool_arg unexpectedly null.")); - return; - } - const auto& a_bool_arg = std::get(encodable_a_bool_arg); - api->EchoAsyncBool(a_bool_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_double_arg = args.at(0); + if (encodable_a_double_arg.IsNull()) { + reply(WrapError("a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = + std::get(encodable_a_double_arg); + api->EchoAsyncDouble( + a_double_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncBool" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = std::get(encodable_a_string_arg); - api->EchoAsyncString(a_string_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_bool_arg = args.at(0); + if (encodable_a_bool_arg.IsNull()) { + reply(WrapError("a_bool_arg unexpectedly null.")); + return; + } + const auto& a_bool_arg = std::get(encodable_a_bool_arg); + api->EchoAsyncBool(a_bool_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncString" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_uint8_list_arg = args.at(0); - if (encodable_a_uint8_list_arg.IsNull()) { - reply(WrapError("a_uint8_list_arg unexpectedly null.")); - return; - } - const auto& a_uint8_list_arg = std::get>(encodable_a_uint8_list_arg); - api->EchoAsyncUint8List(a_uint8_list_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get(encodable_a_string_arg); + api->EchoAsyncString( + a_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncUint8List" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_object_arg = args.at(0); - if (encodable_an_object_arg.IsNull()) { - reply(WrapError("an_object_arg unexpectedly null.")); - return; - } - const auto& an_object_arg = encodable_an_object_arg; - api->EchoAsyncObject(an_object_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_uint8_list_arg = args.at(0); + if (encodable_a_uint8_list_arg.IsNull()) { + reply(WrapError("a_uint8_list_arg unexpectedly null.")); + return; + } + const auto& a_uint8_list_arg = + std::get>(encodable_a_uint8_list_arg); + api->EchoAsyncUint8List( + a_uint8_list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncObject" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - if (encodable_list_arg.IsNull()) { - reply(WrapError("list_arg unexpectedly null.")); - return; - } - const auto& list_arg = std::get(encodable_list_arg); - api->EchoAsyncList(list_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_object_arg = args.at(0); + if (encodable_an_object_arg.IsNull()) { + reply(WrapError("an_object_arg unexpectedly null.")); + return; + } + const auto& an_object_arg = encodable_an_object_arg; + api->EchoAsyncObject( + an_object_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncList" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - if (encodable_a_map_arg.IsNull()) { - reply(WrapError("a_map_arg unexpectedly null.")); - return; - } - const auto& a_map_arg = std::get(encodable_a_map_arg); - api->EchoAsyncMap(a_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + if (encodable_list_arg.IsNull()) { + reply(WrapError("list_arg unexpectedly null.")); + return; + } + const auto& list_arg = + std::get(encodable_list_arg); + api->EchoAsyncList( + list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - if (encodable_an_enum_arg.IsNull()) { - reply(WrapError("an_enum_arg unexpectedly null.")); - return; - } - const auto& an_enum_arg = std::any_cast(std::get(encodable_an_enum_arg)); - api->EchoAsyncEnum(an_enum_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_map_arg = args.at(0); + if (encodable_a_map_arg.IsNull()) { + reply(WrapError("a_map_arg unexpectedly null.")); + return; + } + const auto& a_map_arg = + std::get(encodable_a_map_arg); + api->EchoAsyncMap( + a_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncEnum" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - api->ThrowAsyncError([reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + if (encodable_an_enum_arg.IsNull()) { + reply(WrapError("an_enum_arg unexpectedly null.")); + return; + } + const auto& an_enum_arg = std::any_cast( + std::get(encodable_an_enum_arg)); + api->EchoAsyncEnum( + an_enum_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.throwAsyncError" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - api->ThrowAsyncErrorFromVoid([reply](std::optional&& output) { - if (output.has_value()) { - reply(WrapError(output.value())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + api->ThrowAsyncError( + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "throwAsyncErrorFromVoid" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - api->ThrowAsyncFlutterError([reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + api->ThrowAsyncErrorFromVoid( + [reply](std::optional&& output) { + if (output.has_value()) { + reply(WrapError(output.value())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "throwAsyncFlutterError" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - if (encodable_everything_arg.IsNull()) { - reply(WrapError("everything_arg unexpectedly null.")); - return; - } - const auto& everything_arg = std::any_cast(std::get(encodable_everything_arg)); - api->EchoAsyncAllTypes(everything_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + api->ThrowAsyncFlutterError( + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncAllTypes" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = encodable_everything_arg.IsNull() ? nullptr : &(std::any_cast(std::get(encodable_everything_arg))); - api->EchoAsyncNullableAllNullableTypes(everything_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + if (encodable_everything_arg.IsNull()) { + reply(WrapError("everything_arg unexpectedly null.")); + return; + } + const auto& everything_arg = std::any_cast( + std::get(encodable_everything_arg)); + api->EchoAsyncAllTypes( + everything_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableAllNullableTypes" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + api->EchoAsyncNullableAllNullableTypes( + everything_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue( + std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableAllNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + channel.SetMessageHandler([api]( + const EncodableValue& message, + const flutter::MessageReply& + reply) { try { const auto& args = std::get(message); const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = encodable_everything_arg.IsNull() ? nullptr : &(std::any_cast(std::get(encodable_everything_arg))); - api->EchoAsyncNullableAllNullableTypesWithoutRecursion(everything_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + api->EchoAsyncNullableAllNullableTypesWithoutRecursion( + everything_arg, + [reply](ErrorOr>&& + output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -2828,463 +3542,648 @@ void HostIntegrationCoreApi::SetUp( } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableInt" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - const int64_t an_int_arg_value = encodable_an_int_arg.IsNull() ? 0 : encodable_an_int_arg.LongValue(); - const auto* an_int_arg = encodable_an_int_arg.IsNull() ? nullptr : &an_int_arg_value; - api->EchoAsyncNullableInt(an_int_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_int_arg = args.at(0); + const int64_t an_int_arg_value = + encodable_an_int_arg.IsNull() + ? 0 + : encodable_an_int_arg.LongValue(); + const auto* an_int_arg = + encodable_an_int_arg.IsNull() ? nullptr : &an_int_arg_value; + api->EchoAsyncNullableInt( + an_int_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableDouble" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - const auto* a_double_arg = std::get_if(&encodable_a_double_arg); - api->EchoAsyncNullableDouble(a_double_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_double_arg = args.at(0); + const auto* a_double_arg = + std::get_if(&encodable_a_double_arg); + api->EchoAsyncNullableDouble( + a_double_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableBool" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_bool_arg = args.at(0); - const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg); - api->EchoAsyncNullableBool(a_bool_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_bool_arg = args.at(0); + const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg); + api->EchoAsyncNullableBool( + a_bool_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableString" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - const auto* a_string_arg = std::get_if(&encodable_a_string_arg); - api->EchoAsyncNullableString(a_string_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + const auto* a_string_arg = + std::get_if(&encodable_a_string_arg); + api->EchoAsyncNullableString( + a_string_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableUint8List" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_uint8_list_arg = args.at(0); - const auto* a_uint8_list_arg = std::get_if>(&encodable_a_uint8_list_arg); - api->EchoAsyncNullableUint8List(a_uint8_list_arg, [reply](ErrorOr>>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_uint8_list_arg = args.at(0); + const auto* a_uint8_list_arg = std::get_if>( + &encodable_a_uint8_list_arg); + api->EchoAsyncNullableUint8List( + a_uint8_list_arg, + [reply]( + ErrorOr>>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableObject" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_object_arg = args.at(0); - const auto* an_object_arg = &encodable_an_object_arg; - api->EchoAsyncNullableObject(an_object_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_object_arg = args.at(0); + const auto* an_object_arg = &encodable_an_object_arg; + api->EchoAsyncNullableObject( + an_object_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableList" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - const auto* list_arg = std::get_if(&encodable_list_arg); - api->EchoAsyncNullableList(list_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + const auto* list_arg = + std::get_if(&encodable_list_arg); + api->EchoAsyncNullableList( + list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - const auto* a_map_arg = std::get_if(&encodable_a_map_arg); - api->EchoAsyncNullableMap(a_map_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_map_arg = args.at(0); + const auto* a_map_arg = + std::get_if(&encodable_a_map_arg); + api->EchoAsyncNullableMap( + a_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableEnum" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - AnEnum an_enum_arg_value; - const AnEnum* an_enum_arg = nullptr; - if (!encodable_an_enum_arg.IsNull()) { - an_enum_arg_value = std::any_cast(std::get(encodable_an_enum_arg)); - an_enum_arg = &an_enum_arg_value; - } - api->EchoAsyncNullableEnum(an_enum_arg ? &(*an_enum_arg) : nullptr, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + AnEnum an_enum_arg_value; + const AnEnum* an_enum_arg = nullptr; + if (!encodable_an_enum_arg.IsNull()) { + an_enum_arg_value = std::any_cast( + std::get(encodable_an_enum_arg)); + an_enum_arg = &an_enum_arg_value; + } + api->EchoAsyncNullableEnum( + an_enum_arg ? &(*an_enum_arg) : nullptr, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue( + std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterNoop" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - api->CallFlutterNoop([reply](std::optional&& output) { - if (output.has_value()) { - reply(WrapError(output.value())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + api->CallFlutterNoop( + [reply](std::optional&& output) { + if (output.has_value()) { + reply(WrapError(output.value())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterThrowError" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - api->CallFlutterThrowError([reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + api->CallFlutterThrowError( + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterThrowErrorFromVoid" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - api->CallFlutterThrowErrorFromVoid([reply](std::optional&& output) { - if (output.has_value()) { - reply(WrapError(output.value())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + api->CallFlutterThrowErrorFromVoid( + [reply](std::optional&& output) { + if (output.has_value()) { + reply(WrapError(output.value())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAllTypes" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - if (encodable_everything_arg.IsNull()) { - reply(WrapError("everything_arg unexpectedly null.")); - return; - } - const auto& everything_arg = std::any_cast(std::get(encodable_everything_arg)); - api->CallFlutterEchoAllTypes(everything_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + if (encodable_everything_arg.IsNull()) { + reply(WrapError("everything_arg unexpectedly null.")); + return; + } + const auto& everything_arg = std::any_cast( + std::get(encodable_everything_arg)); + api->CallFlutterEchoAllTypes( + everything_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAllNullableTypes" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = encodable_everything_arg.IsNull() ? nullptr : &(std::any_cast(std::get(encodable_everything_arg))); - api->CallFlutterEchoAllNullableTypes(everything_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_everything_arg = args.at(0); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + api->CallFlutterEchoAllNullableTypes( + everything_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue( + std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); - }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterSendMultipleNullableTypes" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = std::get_if(&encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = args.at(1); - const int64_t a_nullable_int_arg_value = encodable_a_nullable_int_arg.IsNull() ? 0 : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = encodable_a_nullable_int_arg.IsNull() ? nullptr : &a_nullable_int_arg_value; - const auto& encodable_a_nullable_string_arg = args.at(2); - const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); - api->CallFlutterSendMultipleNullableTypes(a_nullable_bool_arg, a_nullable_int_arg, a_nullable_string_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = + std::get_if(&encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = args.at(1); + const int64_t a_nullable_int_arg_value = + encodable_a_nullable_int_arg.IsNull() + ? 0 + : encodable_a_nullable_int_arg.LongValue(); + const auto* a_nullable_int_arg = + encodable_a_nullable_int_arg.IsNull() + ? nullptr + : &a_nullable_int_arg_value; + const auto& encodable_a_nullable_string_arg = args.at(2); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + api->CallFlutterSendMultipleNullableTypes( + a_nullable_bool_arg, a_nullable_int_arg, + a_nullable_string_arg, + [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAllNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { + channel.SetMessageHandler([api]( + const EncodableValue& message, + const flutter::MessageReply& + reply) { try { const auto& args = std::get(message); const auto& encodable_everything_arg = args.at(0); - const auto* everything_arg = encodable_everything_arg.IsNull() ? nullptr : &(std::any_cast(std::get(encodable_everything_arg))); - api->CallFlutterEchoAllNullableTypesWithoutRecursion(everything_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); - }); + const auto* everything_arg = + encodable_everything_arg.IsNull() + ? nullptr + : &(std::any_cast( + std::get( + encodable_everything_arg))); + api->CallFlutterEchoAllNullableTypesWithoutRecursion( + everything_arg, + [reply](ErrorOr>&& + output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); } catch (const std::exception& exception) { reply(WrapError(exception.what())); } @@ -3294,1284 +4193,1798 @@ void HostIntegrationCoreApi::SetUp( } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterSendMultipleNullableTypesWithoutRecursion" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_nullable_bool_arg = args.at(0); - const auto* a_nullable_bool_arg = std::get_if(&encodable_a_nullable_bool_arg); - const auto& encodable_a_nullable_int_arg = args.at(1); - const int64_t a_nullable_int_arg_value = encodable_a_nullable_int_arg.IsNull() ? 0 : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = encodable_a_nullable_int_arg.IsNull() ? nullptr : &a_nullable_int_arg_value; - const auto& encodable_a_nullable_string_arg = args.at(2); - const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); - api->CallFlutterSendMultipleNullableTypesWithoutRecursion(a_nullable_bool_arg, a_nullable_int_arg, a_nullable_string_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_bool_arg = args.at(0); + const auto* a_nullable_bool_arg = + std::get_if(&encodable_a_nullable_bool_arg); + const auto& encodable_a_nullable_int_arg = args.at(1); + const int64_t a_nullable_int_arg_value = + encodable_a_nullable_int_arg.IsNull() + ? 0 + : encodable_a_nullable_int_arg.LongValue(); + const auto* a_nullable_int_arg = + encodable_a_nullable_int_arg.IsNull() + ? nullptr + : &a_nullable_int_arg_value; + const auto& encodable_a_nullable_string_arg = args.at(2); + const auto* a_nullable_string_arg = + std::get_if(&encodable_a_nullable_string_arg); + api->CallFlutterSendMultipleNullableTypesWithoutRecursion( + a_nullable_bool_arg, a_nullable_int_arg, + a_nullable_string_arg, + [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoBool" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_bool_arg = args.at(0); - if (encodable_a_bool_arg.IsNull()) { - reply(WrapError("a_bool_arg unexpectedly null.")); - return; - } - const auto& a_bool_arg = std::get(encodable_a_bool_arg); - api->CallFlutterEchoBool(a_bool_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_bool_arg = args.at(0); + if (encodable_a_bool_arg.IsNull()) { + reply(WrapError("a_bool_arg unexpectedly null.")); + return; + } + const auto& a_bool_arg = std::get(encodable_a_bool_arg); + api->CallFlutterEchoBool( + a_bool_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoInt" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - if (encodable_an_int_arg.IsNull()) { - reply(WrapError("an_int_arg unexpectedly null.")); - return; - } - const int64_t an_int_arg = encodable_an_int_arg.LongValue(); - api->CallFlutterEchoInt(an_int_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_int_arg = args.at(0); + if (encodable_an_int_arg.IsNull()) { + reply(WrapError("an_int_arg unexpectedly null.")); + return; + } + const int64_t an_int_arg = encodable_an_int_arg.LongValue(); + api->CallFlutterEchoInt( + an_int_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoDouble" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - if (encodable_a_double_arg.IsNull()) { - reply(WrapError("a_double_arg unexpectedly null.")); - return; - } - const auto& a_double_arg = std::get(encodable_a_double_arg); - api->CallFlutterEchoDouble(a_double_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_double_arg = args.at(0); + if (encodable_a_double_arg.IsNull()) { + reply(WrapError("a_double_arg unexpectedly null.")); + return; + } + const auto& a_double_arg = + std::get(encodable_a_double_arg); + api->CallFlutterEchoDouble( + a_double_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoString" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = std::get(encodable_a_string_arg); - api->CallFlutterEchoString(a_string_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get(encodable_a_string_arg); + api->CallFlutterEchoString( + a_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoUint8List" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - if (encodable_list_arg.IsNull()) { - reply(WrapError("list_arg unexpectedly null.")); - return; - } - const auto& list_arg = std::get>(encodable_list_arg); - api->CallFlutterEchoUint8List(list_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + if (encodable_list_arg.IsNull()) { + reply(WrapError("list_arg unexpectedly null.")); + return; + } + const auto& list_arg = + std::get>(encodable_list_arg); + api->CallFlutterEchoUint8List( + list_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoList" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - if (encodable_list_arg.IsNull()) { - reply(WrapError("list_arg unexpectedly null.")); - return; - } - const auto& list_arg = std::get(encodable_list_arg); - api->CallFlutterEchoList(list_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + if (encodable_list_arg.IsNull()) { + reply(WrapError("list_arg unexpectedly null.")); + return; + } + const auto& list_arg = + std::get(encodable_list_arg); + api->CallFlutterEchoList( + list_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - if (encodable_a_map_arg.IsNull()) { - reply(WrapError("a_map_arg unexpectedly null.")); - return; - } - const auto& a_map_arg = std::get(encodable_a_map_arg); - api->CallFlutterEchoMap(a_map_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_map_arg = args.at(0); + if (encodable_a_map_arg.IsNull()) { + reply(WrapError("a_map_arg unexpectedly null.")); + return; + } + const auto& a_map_arg = + std::get(encodable_a_map_arg); + api->CallFlutterEchoMap( + a_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoEnum" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - if (encodable_an_enum_arg.IsNull()) { - reply(WrapError("an_enum_arg unexpectedly null.")); - return; - } - const auto& an_enum_arg = std::any_cast(std::get(encodable_an_enum_arg)); - api->CallFlutterEchoEnum(an_enum_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + if (encodable_an_enum_arg.IsNull()) { + reply(WrapError("an_enum_arg unexpectedly null.")); + return; + } + const auto& an_enum_arg = std::any_cast( + std::get(encodable_an_enum_arg)); + api->CallFlutterEchoEnum( + an_enum_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(CustomEncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableBool" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_bool_arg = args.at(0); - const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg); - api->CallFlutterEchoNullableBool(a_bool_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_bool_arg = args.at(0); + const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg); + api->CallFlutterEchoNullableBool( + a_bool_arg, [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableInt" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_int_arg = args.at(0); - const int64_t an_int_arg_value = encodable_an_int_arg.IsNull() ? 0 : encodable_an_int_arg.LongValue(); - const auto* an_int_arg = encodable_an_int_arg.IsNull() ? nullptr : &an_int_arg_value; - api->CallFlutterEchoNullableInt(an_int_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_int_arg = args.at(0); + const int64_t an_int_arg_value = + encodable_an_int_arg.IsNull() + ? 0 + : encodable_an_int_arg.LongValue(); + const auto* an_int_arg = + encodable_an_int_arg.IsNull() ? nullptr : &an_int_arg_value; + api->CallFlutterEchoNullableInt( + an_int_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableDouble" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_double_arg = args.at(0); - const auto* a_double_arg = std::get_if(&encodable_a_double_arg); - api->CallFlutterEchoNullableDouble(a_double_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_double_arg = args.at(0); + const auto* a_double_arg = + std::get_if(&encodable_a_double_arg); + api->CallFlutterEchoNullableDouble( + a_double_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableString" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - const auto* a_string_arg = std::get_if(&encodable_a_string_arg); - api->CallFlutterEchoNullableString(a_string_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + const auto* a_string_arg = + std::get_if(&encodable_a_string_arg); + api->CallFlutterEchoNullableString( + a_string_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableUint8List" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - const auto* list_arg = std::get_if>(&encodable_list_arg); - api->CallFlutterEchoNullableUint8List(list_arg, [reply](ErrorOr>>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + const auto* list_arg = + std::get_if>(&encodable_list_arg); + api->CallFlutterEchoNullableUint8List( + list_arg, + [reply]( + ErrorOr>>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableList" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_list_arg = args.at(0); - const auto* list_arg = std::get_if(&encodable_list_arg); - api->CallFlutterEchoNullableList(list_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_list_arg = args.at(0); + const auto* list_arg = + std::get_if(&encodable_list_arg); + api->CallFlutterEchoNullableList( + list_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - const auto* a_map_arg = std::get_if(&encodable_a_map_arg); - api->CallFlutterEchoNullableMap(a_map_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; - } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(EncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_map_arg = args.at(0); + const auto* a_map_arg = + std::get_if(&encodable_a_map_arg); + api->CallFlutterEchoNullableMap( + a_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableEnum" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - AnEnum an_enum_arg_value; - const AnEnum* an_enum_arg = nullptr; - if (!encodable_an_enum_arg.IsNull()) { - an_enum_arg_value = std::any_cast(std::get(encodable_an_enum_arg)); - an_enum_arg = &an_enum_arg_value; - } - api->CallFlutterEchoNullableEnum(an_enum_arg ? &(*an_enum_arg) : nullptr, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + AnEnum an_enum_arg_value; + const AnEnum* an_enum_arg = nullptr; + if (!encodable_an_enum_arg.IsNull()) { + an_enum_arg_value = std::any_cast( + std::get(encodable_an_enum_arg)); + an_enum_arg = &an_enum_arg_value; + } + api->CallFlutterEchoNullableEnum( + an_enum_arg ? &(*an_enum_arg) : nullptr, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back(CustomEncodableValue( + std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - auto output_optional = std::move(output).TakeValue(); - if (output_optional) { - wrapped.push_back(CustomEncodableValue(std::move(output_optional).value())); - } else { - wrapped.push_back(EncodableValue()); - } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterSmallApiEchoString" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = std::get(encodable_a_string_arg); - api->CallFlutterSmallApiEchoString(a_string_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get(encodable_a_string_arg); + api->CallFlutterSmallApiEchoString( + a_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } } -EncodableValue HostIntegrationCoreApi::WrapError(std::string_view error_message) { - return EncodableValue(EncodableList{ - EncodableValue(std::string(error_message)), - EncodableValue("Error"), - EncodableValue() - }); +EncodableValue HostIntegrationCoreApi::WrapError( + std::string_view error_message) { + return EncodableValue( + EncodableList{EncodableValue(std::string(error_message)), + EncodableValue("Error"), EncodableValue()}); } EncodableValue HostIntegrationCoreApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{ - EncodableValue(error.code()), - EncodableValue(error.message()), - error.details() - }); + return EncodableValue(EncodableList{EncodableValue(error.code()), + EncodableValue(error.message()), + error.details()}); } -// Generated class from Pigeon that represents Flutter messages that can be called from C++. -FlutterIntegrationCoreApi::FlutterIntegrationCoreApi(flutter::BinaryMessenger* binary_messenger) - : binary_messenger_(binary_messenger), - message_channel_suffix_("") {} +// Generated class from Pigeon that represents Flutter messages that can be +// called from C++. +FlutterIntegrationCoreApi::FlutterIntegrationCoreApi( + flutter::BinaryMessenger* binary_messenger) + : binary_messenger_(binary_messenger), message_channel_suffix_("") {} FlutterIntegrationCoreApi::FlutterIntegrationCoreApi( - flutter::BinaryMessenger* binary_messenger, - const std::string& message_channel_suffix) - : binary_messenger_(binary_messenger), - message_channel_suffix_(message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix : "") {} + flutter::BinaryMessenger* binary_messenger, + const std::string& message_channel_suffix) + : binary_messenger_(binary_messenger), + message_channel_suffix_(message_channel_suffix.length() > 0 + ? std::string(".") + message_channel_suffix + : "") {} const flutter::StandardMessageCodec& FlutterIntegrationCoreApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance(&PigeonCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance( + &PigeonCodecSerializer::GetInstance()); } void FlutterIntegrationCoreApi::Noop( - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop" + message_channel_suffix_; + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "noop" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - on_success(); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::ThrowError( - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError" + message_channel_suffix_; + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "throwError" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto* return_value = &list_return_value->at(0); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = &list_return_value->at(0); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::ThrowErrorFromVoid( - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid" + message_channel_suffix_; + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "throwErrorFromVoid" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - on_success(); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoAllTypes( - const AllTypes& everything_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes" + message_channel_suffix_; + const AllTypes& everything_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoAllTypes" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - CustomEncodableValue(everything_arg), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast(std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + CustomEncodableValue(everything_arg), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast( + std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoAllNullableTypes( - const AllNullableTypes* everything_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes" + message_channel_suffix_; + const AllNullableTypes* everything_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoAllNullableTypes" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto* return_value = list_return_value->at(0).IsNull() ? nullptr : &(std::any_cast(std::get(list_return_value->at(0)))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + list_return_value->at(0).IsNull() + ? nullptr + : &(std::any_cast( + std::get( + list_return_value->at(0)))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::SendMultipleNullableTypes( - const bool* a_nullable_bool_arg, - const int64_t* a_nullable_int_arg, - const std::string* a_nullable_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes" + message_channel_suffix_; + const bool* a_nullable_bool_arg, const int64_t* a_nullable_int_arg, + const std::string* a_nullable_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "sendMultipleNullableTypes" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) : EncodableValue(), - a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) : EncodableValue(), - a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) : EncodableValue(), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast(std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) + : EncodableValue(), + a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) + : EncodableValue(), + a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) + : EncodableValue(), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast( + std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoAllNullableTypesWithoutRecursion( - const AllNullableTypesWithoutRecursion* everything_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion" + message_channel_suffix_; + const AllNullableTypesWithoutRecursion* everything_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoAllNullableTypesWithoutRecursion" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto* return_value = list_return_value->at(0).IsNull() ? nullptr : &(std::any_cast(std::get(list_return_value->at(0)))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + everything_arg ? CustomEncodableValue(*everything_arg) : EncodableValue(), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + list_return_value->at(0).IsNull() + ? nullptr + : &(std::any_cast( + std::get( + list_return_value->at(0)))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::SendMultipleNullableTypesWithoutRecursion( - const bool* a_nullable_bool_arg, - const int64_t* a_nullable_int_arg, - const std::string* a_nullable_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion" + message_channel_suffix_; + const bool* a_nullable_bool_arg, const int64_t* a_nullable_int_arg, + const std::string* a_nullable_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "sendMultipleNullableTypesWithoutRecursion" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) : EncodableValue(), - a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) : EncodableValue(), - a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) : EncodableValue(), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast(std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg) + : EncodableValue(), + a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg) + : EncodableValue(), + a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg) + : EncodableValue(), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::any_cast( + std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoBool( - bool a_bool_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool" + message_channel_suffix_; + bool a_bool_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoBool" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_bool_arg), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto& return_value = std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + EncodableValue(a_bool_arg), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoInt( - int64_t an_int_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt" + message_channel_suffix_; + int64_t an_int_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoInt" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(an_int_arg), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const int64_t return_value = list_return_value->at(0).LongValue(); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + EncodableValue(an_int_arg), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const int64_t return_value = list_return_value->at(0).LongValue(); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoDouble( - double a_double_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble" + message_channel_suffix_; + double a_double_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoDouble" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_double_arg), + EncodableValue(a_double_arg), }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + channel.Send(encoded_api_arguments, [channel_name, + on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, + size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); + const auto* list_return_value = + std::get_if(&encodable_return_value); if (list_return_value) { if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + on_error(FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); } else { const auto& return_value = std::get(list_return_value->at(0)); on_success(return_value); } } else { on_error(CreateConnectionError(channel_name)); - } + } }); } void FlutterIntegrationCoreApi::EchoString( - const std::string& a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString" + message_channel_suffix_; + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoString" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto& return_value = std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + EncodableValue(a_string_arg), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoUint8List( - const std::vector& list_arg, - std::function&)>&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List" + message_channel_suffix_; + const std::vector& list_arg, + std::function&)>&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoUint8List" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(list_arg), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto& return_value = std::get>(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + EncodableValue(list_arg), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get>(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoList( - const EncodableList& list_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList" + message_channel_suffix_; + const EncodableList& list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoList" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(list_arg), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto& return_value = std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + EncodableValue(list_arg), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoMap( - const EncodableMap& a_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap" + message_channel_suffix_; + const EncodableMap& a_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoMap" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_map_arg), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto& return_value = std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + EncodableValue(a_map_arg), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoEnum( - const AnEnum& an_enum_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum" + message_channel_suffix_; + const AnEnum& an_enum_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoEnum" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - CustomEncodableValue(an_enum_arg), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast(std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + CustomEncodableValue(an_enum_arg), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast( + std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoNullableBool( - const bool* a_bool_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool" + message_channel_suffix_; + const bool* a_bool_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableBool" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_bool_arg ? EncodableValue(*a_bool_arg) : EncodableValue(), + a_bool_arg ? EncodableValue(*a_bool_arg) : EncodableValue(), }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + channel.Send(encoded_api_arguments, [channel_name, + on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, + size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); + const auto* list_return_value = + std::get_if(&encodable_return_value); if (list_return_value) { if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + on_error(FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); } else { const auto* return_value = std::get_if(&list_return_value->at(0)); on_success(return_value); } } else { on_error(CreateConnectionError(channel_name)); - } + } }); } void FlutterIntegrationCoreApi::EchoNullableInt( - const int64_t* an_int_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt" + message_channel_suffix_; + const int64_t* an_int_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableInt" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - an_int_arg ? EncodableValue(*an_int_arg) : EncodableValue(), + an_int_arg ? EncodableValue(*an_int_arg) : EncodableValue(), }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); + channel.Send(encoded_api_arguments, [channel_name, + on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, + size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); + const auto* list_return_value = + std::get_if(&encodable_return_value); if (list_return_value) { if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); + on_error(FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); } else { - const int64_t return_value_value = list_return_value->at(0).IsNull() ? 0 : list_return_value->at(0).LongValue(); - const auto* return_value = list_return_value->at(0).IsNull() ? nullptr : &return_value_value; + const int64_t return_value_value = + list_return_value->at(0).IsNull() + ? 0 + : list_return_value->at(0).LongValue(); + const auto* return_value = + list_return_value->at(0).IsNull() ? nullptr : &return_value_value; on_success(return_value); } } else { on_error(CreateConnectionError(channel_name)); - } + } }); } void FlutterIntegrationCoreApi::EchoNullableDouble( - const double* a_double_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble" + message_channel_suffix_; + const double* a_double_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableDouble" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_double_arg ? EncodableValue(*a_double_arg) : EncodableValue(), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto* return_value = std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + a_double_arg ? EncodableValue(*a_double_arg) : EncodableValue(), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoNullableString( - const std::string* a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString" + message_channel_suffix_; + const std::string* a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableString" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto* return_value = std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoNullableUint8List( - const std::vector* list_arg, - std::function*)>&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List" + message_channel_suffix_; + const std::vector* list_arg, + std::function*)>&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableUint8List" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - list_arg ? EncodableValue(*list_arg) : EncodableValue(), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto* return_value = std::get_if>(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + list_arg ? EncodableValue(*list_arg) : EncodableValue(), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if>(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoNullableList( - const EncodableList* list_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList" + message_channel_suffix_; + const EncodableList* list_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableList" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - list_arg ? EncodableValue(*list_arg) : EncodableValue(), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto* return_value = std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + list_arg ? EncodableValue(*list_arg) : EncodableValue(), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoNullableMap( - const EncodableMap* a_map_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap" + message_channel_suffix_; + const EncodableMap* a_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableMap" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_map_arg ? EncodableValue(*a_map_arg) : EncodableValue(), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto* return_value = std::get_if(&list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + a_map_arg ? EncodableValue(*a_map_arg) : EncodableValue(), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoNullableEnum( - const AnEnum* an_enum_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum" + message_channel_suffix_; + const AnEnum* an_enum_arg, std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableEnum" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - an_enum_arg ? CustomEncodableValue(*an_enum_arg) : EncodableValue(), + an_enum_arg ? CustomEncodableValue(*an_enum_arg) : EncodableValue(), }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - AnEnum return_value_value; - const AnEnum* return_value = nullptr; - if (!list_return_value->at(0).IsNull()) { - return_value_value = std::any_cast(std::get(list_return_value->at(0))); - return_value = &return_value_value; + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + AnEnum return_value_value; + const AnEnum* return_value = nullptr; + if (!list_return_value->at(0).IsNull()) { + return_value_value = std::any_cast( + std::get(list_return_value->at(0))); + return_value = &return_value_value; + } + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); } - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); + }); } void FlutterIntegrationCoreApi::NoopAsync( - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync" + message_channel_suffix_; + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "noopAsync" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - on_success(); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + on_success(); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoAsyncString( - const std::string& a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString" + message_channel_suffix_; + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoAsyncString" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto& return_value = std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + EncodableValue(a_string_arg), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } /// The codec used by HostTrivialApi. const flutter::StandardMessageCodec& HostTrivialApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance(&PigeonCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance( + &PigeonCodecSerializer::GetInstance()); } -// Sets up an instance of `HostTrivialApi` to handle messages through the `binary_messenger`. -void HostTrivialApi::SetUp( - flutter::BinaryMessenger* binary_messenger, - HostTrivialApi* api) { +// Sets up an instance of `HostTrivialApi` to handle messages through the +// `binary_messenger`. +void HostTrivialApi::SetUp(flutter::BinaryMessenger* binary_messenger, + HostTrivialApi* api) { HostTrivialApi::SetUp(binary_messenger, api, ""); } -void HostTrivialApi::SetUp( - flutter::BinaryMessenger* binary_messenger, - HostTrivialApi* api, - const std::string& message_channel_suffix) { - const std::string prepended_suffix = message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix : ""; +void HostTrivialApi::SetUp(flutter::BinaryMessenger* binary_messenger, + HostTrivialApi* api, + const std::string& message_channel_suffix) { + const std::string prepended_suffix = + message_channel_suffix.length() > 0 + ? std::string(".") + message_channel_suffix + : ""; { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - std::optional output = api->Noop(); - if (output.has_value()) { - reply(WrapError(output.value())); - return; - } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + std::optional output = api->Noop(); + if (output.has_value()) { + reply(WrapError(output.value())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); } else { channel.SetMessageHandler(nullptr); } @@ -4579,85 +5992,98 @@ void HostTrivialApi::SetUp( } EncodableValue HostTrivialApi::WrapError(std::string_view error_message) { - return EncodableValue(EncodableList{ - EncodableValue(std::string(error_message)), - EncodableValue("Error"), - EncodableValue() - }); + return EncodableValue( + EncodableList{EncodableValue(std::string(error_message)), + EncodableValue("Error"), EncodableValue()}); } EncodableValue HostTrivialApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{ - EncodableValue(error.code()), - EncodableValue(error.message()), - error.details() - }); + return EncodableValue(EncodableList{EncodableValue(error.code()), + EncodableValue(error.message()), + error.details()}); } /// The codec used by HostSmallApi. const flutter::StandardMessageCodec& HostSmallApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance(&PigeonCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance( + &PigeonCodecSerializer::GetInstance()); } -// Sets up an instance of `HostSmallApi` to handle messages through the `binary_messenger`. -void HostSmallApi::SetUp( - flutter::BinaryMessenger* binary_messenger, - HostSmallApi* api) { +// Sets up an instance of `HostSmallApi` to handle messages through the +// `binary_messenger`. +void HostSmallApi::SetUp(flutter::BinaryMessenger* binary_messenger, + HostSmallApi* api) { HostSmallApi::SetUp(binary_messenger, api, ""); } -void HostSmallApi::SetUp( - flutter::BinaryMessenger* binary_messenger, - HostSmallApi* api, - const std::string& message_channel_suffix) { - const std::string prepended_suffix = message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix : ""; +void HostSmallApi::SetUp(flutter::BinaryMessenger* binary_messenger, + HostSmallApi* api, + const std::string& message_channel_suffix) { + const std::string prepended_suffix = + message_channel_suffix.length() > 0 + ? std::string(".") + message_channel_suffix + : ""; { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - const auto& args = std::get(message); - const auto& encodable_a_string_arg = args.at(0); - if (encodable_a_string_arg.IsNull()) { - reply(WrapError("a_string_arg unexpectedly null.")); - return; - } - const auto& a_string_arg = std::get(encodable_a_string_arg); - api->Echo(a_string_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_string_arg = args.at(0); + if (encodable_a_string_arg.IsNull()) { + reply(WrapError("a_string_arg unexpectedly null.")); + return; + } + const auto& a_string_arg = + std::get(encodable_a_string_arg); + api->Echo(a_string_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } } { - BasicMessageChannel<> channel(binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid" + prepended_suffix, &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { - channel.SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply& reply) { - try { - api->VoidVoid([reply](std::optional&& output) { - if (output.has_value()) { - reply(WrapError(output.value())); - return; + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + api->VoidVoid([reply](std::optional&& output) { + if (output.has_value()) { + reply(WrapError(output.value())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue()); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel.SetMessageHandler(nullptr); } @@ -4665,86 +6091,107 @@ void HostSmallApi::SetUp( } EncodableValue HostSmallApi::WrapError(std::string_view error_message) { - return EncodableValue(EncodableList{ - EncodableValue(std::string(error_message)), - EncodableValue("Error"), - EncodableValue() - }); + return EncodableValue( + EncodableList{EncodableValue(std::string(error_message)), + EncodableValue("Error"), EncodableValue()}); } EncodableValue HostSmallApi::WrapError(const FlutterError& error) { - return EncodableValue(EncodableList{ - EncodableValue(error.code()), - EncodableValue(error.message()), - error.details() - }); + return EncodableValue(EncodableList{EncodableValue(error.code()), + EncodableValue(error.message()), + error.details()}); } -// Generated class from Pigeon that represents Flutter messages that can be called from C++. +// Generated class from Pigeon that represents Flutter messages that can be +// called from C++. FlutterSmallApi::FlutterSmallApi(flutter::BinaryMessenger* binary_messenger) - : binary_messenger_(binary_messenger), - message_channel_suffix_("") {} + : binary_messenger_(binary_messenger), message_channel_suffix_("") {} -FlutterSmallApi::FlutterSmallApi( - flutter::BinaryMessenger* binary_messenger, - const std::string& message_channel_suffix) - : binary_messenger_(binary_messenger), - message_channel_suffix_(message_channel_suffix.length() > 0 ? std::string(".") + message_channel_suffix : "") {} +FlutterSmallApi::FlutterSmallApi(flutter::BinaryMessenger* binary_messenger, + const std::string& message_channel_suffix) + : binary_messenger_(binary_messenger), + message_channel_suffix_(message_channel_suffix.length() > 0 + ? std::string(".") + message_channel_suffix + : "") {} const flutter::StandardMessageCodec& FlutterSmallApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance(&PigeonCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance( + &PigeonCodecSerializer::GetInstance()); } void FlutterSmallApi::EchoWrappedList( - const TestMessage& msg_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList" + message_channel_suffix_; + const TestMessage& msg_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi." + "echoWrappedList" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - CustomEncodableValue(msg_arg), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto& return_value = std::any_cast(std::get(list_return_value->at(0))); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + CustomEncodableValue(msg_arg), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = std::any_cast( + std::get(list_return_value->at(0))); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterSmallApi::EchoString( - const std::string& a_string_arg, - std::function&& on_success, - std::function&& on_error) { - const std::string channel_name = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString" + message_channel_suffix_; + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString" + + message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), - }); - channel.Send(encoded_api_arguments, [channel_name, on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - std::unique_ptr response = GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), std::get(list_return_value->at(1)), list_return_value->at(2))); - } else { - const auto& return_value = std::get(list_return_value->at(0)); - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } + EncodableValue(a_string_arg), }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } } // namespace core_tests_pigeontest diff --git a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h index 236538402593..1d0b64289592 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h +++ b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h @@ -24,12 +24,12 @@ class CoreTestsTest; class FlutterError { public: - explicit FlutterError(const std::string& code) - : code_(code) {} + explicit FlutterError(const std::string& code) : code_(code) {} explicit FlutterError(const std::string& code, const std::string& message) - : code_(code), message_(message) {} - explicit FlutterError(const std::string& code, const std::string& message, const flutter::EncodableValue& details) - : code_(code), message_(message), details_(details) {} + : code_(code), message_(message) {} + explicit FlutterError(const std::string& code, const std::string& message, + const flutter::EncodableValue& details) + : code_(code), message_(message), details_(details) {} const std::string& code() const { return code_; } const std::string& message() const { return message_; } @@ -41,7 +41,8 @@ class FlutterError { flutter::EncodableValue details_; }; -template class ErrorOr { +template +class ErrorOr { public: ErrorOr(const T& rhs) : v_(rhs) {} ErrorOr(const T&& rhs) : v_(std::move(rhs)) {} @@ -64,7 +65,6 @@ template class ErrorOr { std::variant v_; }; - enum class AnEnum { kOne = 0, kTwo = 1, @@ -79,24 +79,19 @@ enum class AnEnum { class AllTypes { public: // Constructs an object setting all fields. - explicit AllTypes( - bool a_bool, - int64_t an_int, - int64_t an_int64, - double a_double, - const std::vector& a_byte_array, - const std::vector& a4_byte_array, - const std::vector& a8_byte_array, - const std::vector& a_float_array, - const AnEnum& an_enum, - const std::string& a_string, - const flutter::EncodableValue& an_object, - const flutter::EncodableList& list, - const flutter::EncodableList& string_list, - const flutter::EncodableList& int_list, - const flutter::EncodableList& double_list, - const flutter::EncodableList& bool_list, - const flutter::EncodableMap& map); + explicit AllTypes(bool a_bool, int64_t an_int, int64_t an_int64, + double a_double, const std::vector& a_byte_array, + const std::vector& a4_byte_array, + const std::vector& a8_byte_array, + const std::vector& a_float_array, + const AnEnum& an_enum, const std::string& a_string, + const flutter::EncodableValue& an_object, + const flutter::EncodableList& list, + const flutter::EncodableList& string_list, + const flutter::EncodableList& int_list, + const flutter::EncodableList& double_list, + const flutter::EncodableList& bool_list, + const flutter::EncodableMap& map); bool a_bool() const; void set_a_bool(bool value_arg); @@ -149,7 +144,6 @@ class AllTypes { const flutter::EncodableMap& map() const; void set_map(const flutter::EncodableMap& value_arg); - private: static AllTypes FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -178,10 +172,8 @@ class AllTypes { flutter::EncodableList double_list_; flutter::EncodableList bool_list_; flutter::EncodableMap map_; - }; - // A class containing all supported nullable types. // // Generated class from Pigeon that represents data sent in messages. @@ -192,28 +184,25 @@ class AllNullableTypes { // Constructs an object setting all fields. explicit AllNullableTypes( - const bool* a_nullable_bool, - const int64_t* a_nullable_int, - const int64_t* a_nullable_int64, - const double* a_nullable_double, - const std::vector* a_nullable_byte_array, - const std::vector* a_nullable4_byte_array, - const std::vector* a_nullable8_byte_array, - const std::vector* a_nullable_float_array, - const flutter::EncodableList* nullable_nested_list, - const flutter::EncodableMap* nullable_map_with_annotations, - const flutter::EncodableMap* nullable_map_with_object, - const AnEnum* a_nullable_enum, - const std::string* a_nullable_string, - const flutter::EncodableValue* a_nullable_object, - const AllNullableTypes* all_nullable_types, - const flutter::EncodableList* list, - const flutter::EncodableList* string_list, - const flutter::EncodableList* int_list, - const flutter::EncodableList* double_list, - const flutter::EncodableList* bool_list, - const flutter::EncodableList* nested_class_list, - const flutter::EncodableMap* map); + const bool* a_nullable_bool, const int64_t* a_nullable_int, + const int64_t* a_nullable_int64, const double* a_nullable_double, + const std::vector* a_nullable_byte_array, + const std::vector* a_nullable4_byte_array, + const std::vector* a_nullable8_byte_array, + const std::vector* a_nullable_float_array, + const flutter::EncodableList* nullable_nested_list, + const flutter::EncodableMap* nullable_map_with_annotations, + const flutter::EncodableMap* nullable_map_with_object, + const AnEnum* a_nullable_enum, const std::string* a_nullable_string, + const flutter::EncodableValue* a_nullable_object, + const AllNullableTypes* all_nullable_types, + const flutter::EncodableList* list, + const flutter::EncodableList* string_list, + const flutter::EncodableList* int_list, + const flutter::EncodableList* double_list, + const flutter::EncodableList* bool_list, + const flutter::EncodableList* nested_class_list, + const flutter::EncodableMap* map); ~AllNullableTypes() = default; AllNullableTypes(const AllNullableTypes& other); @@ -257,8 +246,10 @@ class AllNullableTypes { void set_nullable_nested_list(const flutter::EncodableList& value_arg); const flutter::EncodableMap* nullable_map_with_annotations() const; - void set_nullable_map_with_annotations(const flutter::EncodableMap* value_arg); - void set_nullable_map_with_annotations(const flutter::EncodableMap& value_arg); + void set_nullable_map_with_annotations( + const flutter::EncodableMap* value_arg); + void set_nullable_map_with_annotations( + const flutter::EncodableMap& value_arg); const flutter::EncodableMap* nullable_map_with_object() const; void set_nullable_map_with_object(const flutter::EncodableMap* value_arg); @@ -308,7 +299,6 @@ class AllNullableTypes { void set_map(const flutter::EncodableMap* value_arg); void set_map(const flutter::EncodableMap& value_arg); - private: static AllNullableTypes FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -342,10 +332,8 @@ class AllNullableTypes { std::optional bool_list_; std::optional nested_class_list_; std::optional map_; - }; - // The primary purpose for this class is to ensure coverage of Swift structs // with nullable items, as the primary [AllNullableTypes] class is being used to // test Swift classes. @@ -358,26 +346,23 @@ class AllNullableTypesWithoutRecursion { // Constructs an object setting all fields. explicit AllNullableTypesWithoutRecursion( - const bool* a_nullable_bool, - const int64_t* a_nullable_int, - const int64_t* a_nullable_int64, - const double* a_nullable_double, - const std::vector* a_nullable_byte_array, - const std::vector* a_nullable4_byte_array, - const std::vector* a_nullable8_byte_array, - const std::vector* a_nullable_float_array, - const flutter::EncodableList* nullable_nested_list, - const flutter::EncodableMap* nullable_map_with_annotations, - const flutter::EncodableMap* nullable_map_with_object, - const AnEnum* a_nullable_enum, - const std::string* a_nullable_string, - const flutter::EncodableValue* a_nullable_object, - const flutter::EncodableList* list, - const flutter::EncodableList* string_list, - const flutter::EncodableList* int_list, - const flutter::EncodableList* double_list, - const flutter::EncodableList* bool_list, - const flutter::EncodableMap* map); + const bool* a_nullable_bool, const int64_t* a_nullable_int, + const int64_t* a_nullable_int64, const double* a_nullable_double, + const std::vector* a_nullable_byte_array, + const std::vector* a_nullable4_byte_array, + const std::vector* a_nullable8_byte_array, + const std::vector* a_nullable_float_array, + const flutter::EncodableList* nullable_nested_list, + const flutter::EncodableMap* nullable_map_with_annotations, + const flutter::EncodableMap* nullable_map_with_object, + const AnEnum* a_nullable_enum, const std::string* a_nullable_string, + const flutter::EncodableValue* a_nullable_object, + const flutter::EncodableList* list, + const flutter::EncodableList* string_list, + const flutter::EncodableList* int_list, + const flutter::EncodableList* double_list, + const flutter::EncodableList* bool_list, + const flutter::EncodableMap* map); const bool* a_nullable_bool() const; void set_a_nullable_bool(const bool* value_arg); @@ -416,8 +401,10 @@ class AllNullableTypesWithoutRecursion { void set_nullable_nested_list(const flutter::EncodableList& value_arg); const flutter::EncodableMap* nullable_map_with_annotations() const; - void set_nullable_map_with_annotations(const flutter::EncodableMap* value_arg); - void set_nullable_map_with_annotations(const flutter::EncodableMap& value_arg); + void set_nullable_map_with_annotations( + const flutter::EncodableMap* value_arg); + void set_nullable_map_with_annotations( + const flutter::EncodableMap& value_arg); const flutter::EncodableMap* nullable_map_with_object() const; void set_nullable_map_with_object(const flutter::EncodableMap* value_arg); @@ -459,9 +446,9 @@ class AllNullableTypesWithoutRecursion { void set_map(const flutter::EncodableMap* value_arg); void set_map(const flutter::EncodableMap& value_arg); - private: - static AllNullableTypesWithoutRecursion FromEncodableList(const flutter::EncodableList& list); + static AllNullableTypesWithoutRecursion FromEncodableList( + const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; friend class AllClassesWrapper; friend class HostIntegrationCoreApi; @@ -491,10 +478,8 @@ class AllNullableTypesWithoutRecursion { std::optional double_list_; std::optional bool_list_; std::optional map_; - }; - // A class for testing nested class handling. // // This is needed to test nested nullable and non-nullable classes, @@ -508,10 +493,10 @@ class AllClassesWrapper { explicit AllClassesWrapper(const AllNullableTypes& all_nullable_types); // Constructs an object setting all fields. - explicit AllClassesWrapper( - const AllNullableTypes& all_nullable_types, - const AllNullableTypesWithoutRecursion* all_nullable_types_without_recursion, - const AllTypes* all_types); + explicit AllClassesWrapper(const AllNullableTypes& all_nullable_types, + const AllNullableTypesWithoutRecursion* + all_nullable_types_without_recursion, + const AllTypes* all_types); ~AllClassesWrapper() = default; AllClassesWrapper(const AllClassesWrapper& other); @@ -521,17 +506,20 @@ class AllClassesWrapper { const AllNullableTypes& all_nullable_types() const; void set_all_nullable_types(const AllNullableTypes& value_arg); - const AllNullableTypesWithoutRecursion* all_nullable_types_without_recursion() const; - void set_all_nullable_types_without_recursion(const AllNullableTypesWithoutRecursion* value_arg); - void set_all_nullable_types_without_recursion(const AllNullableTypesWithoutRecursion& value_arg); + const AllNullableTypesWithoutRecursion* all_nullable_types_without_recursion() + const; + void set_all_nullable_types_without_recursion( + const AllNullableTypesWithoutRecursion* value_arg); + void set_all_nullable_types_without_recursion( + const AllNullableTypesWithoutRecursion& value_arg); const AllTypes* all_types() const; void set_all_types(const AllTypes* value_arg); void set_all_types(const AllTypes& value_arg); - private: - static AllClassesWrapper FromEncodableList(const flutter::EncodableList& list); + static AllClassesWrapper FromEncodableList( + const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; friend class HostIntegrationCoreApi; friend class FlutterIntegrationCoreApi; @@ -541,12 +529,11 @@ class AllClassesWrapper { friend class PigeonCodecSerializer; friend class CoreTestsTest; std::unique_ptr all_nullable_types_; - std::unique_ptr all_nullable_types_without_recursion_; + std::unique_ptr + all_nullable_types_without_recursion_; std::unique_ptr all_types_; - }; - // A data class containing a List, used in unit tests. // // Generated class from Pigeon that represents data sent in messages. @@ -562,7 +549,6 @@ class TestMessage { void set_test_list(const flutter::EncodableList* value_arg); void set_test_list(const flutter::EncodableList& value_arg); - private: static TestMessage FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -574,7 +560,6 @@ class TestMessage { friend class PigeonCodecSerializer; friend class CoreTestsTest; std::optional test_list_; - }; class PigeonCodecSerializer : public flutter::StandardCodecSerializer { @@ -585,21 +570,19 @@ class PigeonCodecSerializer : public flutter::StandardCodecSerializer { return sInstance; } - void WriteValue( - const flutter::EncodableValue& value, - flutter::ByteStreamWriter* stream) const override; + void WriteValue(const flutter::EncodableValue& value, + flutter::ByteStreamWriter* stream) const override; protected: flutter::EncodableValue ReadValueOfType( - uint8_t type, - flutter::ByteStreamReader* stream) const override; - + uint8_t type, flutter::ByteStreamReader* stream) const override; }; // The core interface that each host language plugin must implement in // platform_test integration tests. // -// Generated interface from Pigeon that represents a handler of messages from Flutter. +// Generated interface from Pigeon that represents a handler of messages from +// Flutter. class HostIntegrationCoreApi { public: HostIntegrationCoreApi(const HostIntegrationCoreApi&) = delete; @@ -615,7 +598,8 @@ class HostIntegrationCoreApi { // Returns an error from a void function, to test error handling. virtual std::optional ThrowErrorFromVoid() = 0; // Returns a Flutter error, to test error handling. - virtual ErrorOr> ThrowFlutterError() = 0; + virtual ErrorOr> + ThrowFlutterError() = 0; // Returns passed in int. virtual ErrorOr EchoInt(int64_t an_int) = 0; // Returns passed in double. @@ -625,395 +609,417 @@ class HostIntegrationCoreApi { // Returns the passed in string. virtual ErrorOr EchoString(const std::string& a_string) = 0; // Returns the passed in Uint8List. - virtual ErrorOr> EchoUint8List(const std::vector& a_uint8_list) = 0; + virtual ErrorOr> EchoUint8List( + const std::vector& a_uint8_list) = 0; // Returns the passed in generic Object. - virtual ErrorOr EchoObject(const flutter::EncodableValue& an_object) = 0; + virtual ErrorOr EchoObject( + const flutter::EncodableValue& an_object) = 0; // Returns the passed list, to test serialization and deserialization. - virtual ErrorOr EchoList(const flutter::EncodableList& list) = 0; + virtual ErrorOr EchoList( + const flutter::EncodableList& list) = 0; // Returns the passed map, to test serialization and deserialization. - virtual ErrorOr EchoMap(const flutter::EncodableMap& a_map) = 0; - // Returns the passed map to test nested class serialization and deserialization. - virtual ErrorOr EchoClassWrapper(const AllClassesWrapper& wrapper) = 0; + virtual ErrorOr EchoMap( + const flutter::EncodableMap& a_map) = 0; + // Returns the passed map to test nested class serialization and + // deserialization. + virtual ErrorOr EchoClassWrapper( + const AllClassesWrapper& wrapper) = 0; // Returns the passed enum to test serialization and deserialization. virtual ErrorOr EchoEnum(const AnEnum& an_enum) = 0; // Returns the default string. - virtual ErrorOr EchoNamedDefaultString(const std::string& a_string) = 0; + virtual ErrorOr EchoNamedDefaultString( + const std::string& a_string) = 0; // Returns passed in double. virtual ErrorOr EchoOptionalDefaultDouble(double a_double) = 0; // Returns passed in int. virtual ErrorOr EchoRequiredInt(int64_t an_int) = 0; // Returns the passed object, to test serialization and deserialization. - virtual ErrorOr> EchoAllNullableTypes(const AllNullableTypes* everything) = 0; + virtual ErrorOr> EchoAllNullableTypes( + const AllNullableTypes* everything) = 0; // Returns the passed object, to test serialization and deserialization. - virtual ErrorOr> EchoAllNullableTypesWithoutRecursion(const AllNullableTypesWithoutRecursion* everything) = 0; + virtual ErrorOr> + EchoAllNullableTypesWithoutRecursion( + const AllNullableTypesWithoutRecursion* everything) = 0; // Returns the inner `aString` value from the wrapped object, to test // sending of nested objects. - virtual ErrorOr> ExtractNestedNullableString(const AllClassesWrapper& wrapper) = 0; + virtual ErrorOr> ExtractNestedNullableString( + const AllClassesWrapper& wrapper) = 0; // Returns the inner `aString` value from the wrapped object, to test // sending of nested objects. - virtual ErrorOr CreateNestedNullableString(const std::string* nullable_string) = 0; + virtual ErrorOr CreateNestedNullableString( + const std::string* nullable_string) = 0; // Returns passed in arguments of multiple types. virtual ErrorOr SendMultipleNullableTypes( - const bool* a_nullable_bool, - const int64_t* a_nullable_int, - const std::string* a_nullable_string) = 0; + const bool* a_nullable_bool, const int64_t* a_nullable_int, + const std::string* a_nullable_string) = 0; // Returns passed in arguments of multiple types. - virtual ErrorOr SendMultipleNullableTypesWithoutRecursion( - const bool* a_nullable_bool, - const int64_t* a_nullable_int, - const std::string* a_nullable_string) = 0; + virtual ErrorOr + SendMultipleNullableTypesWithoutRecursion( + const bool* a_nullable_bool, const int64_t* a_nullable_int, + const std::string* a_nullable_string) = 0; // Returns passed in int. - virtual ErrorOr> EchoNullableInt(const int64_t* a_nullable_int) = 0; + virtual ErrorOr> EchoNullableInt( + const int64_t* a_nullable_int) = 0; // Returns passed in double. - virtual ErrorOr> EchoNullableDouble(const double* a_nullable_double) = 0; + virtual ErrorOr> EchoNullableDouble( + const double* a_nullable_double) = 0; // Returns the passed in boolean. - virtual ErrorOr> EchoNullableBool(const bool* a_nullable_bool) = 0; + virtual ErrorOr> EchoNullableBool( + const bool* a_nullable_bool) = 0; // Returns the passed in string. - virtual ErrorOr> EchoNullableString(const std::string* a_nullable_string) = 0; + virtual ErrorOr> EchoNullableString( + const std::string* a_nullable_string) = 0; // Returns the passed in Uint8List. - virtual ErrorOr>> EchoNullableUint8List(const std::vector* a_nullable_uint8_list) = 0; + virtual ErrorOr>> EchoNullableUint8List( + const std::vector* a_nullable_uint8_list) = 0; // Returns the passed in generic Object. - virtual ErrorOr> EchoNullableObject(const flutter::EncodableValue* a_nullable_object) = 0; + virtual ErrorOr> EchoNullableObject( + const flutter::EncodableValue* a_nullable_object) = 0; // Returns the passed list, to test serialization and deserialization. - virtual ErrorOr> EchoNullableList(const flutter::EncodableList* a_nullable_list) = 0; + virtual ErrorOr> EchoNullableList( + const flutter::EncodableList* a_nullable_list) = 0; // Returns the passed map, to test serialization and deserialization. - virtual ErrorOr> EchoNullableMap(const flutter::EncodableMap* a_nullable_map) = 0; - virtual ErrorOr> EchoNullableEnum(const AnEnum* an_enum) = 0; + virtual ErrorOr> EchoNullableMap( + const flutter::EncodableMap* a_nullable_map) = 0; + virtual ErrorOr> EchoNullableEnum( + const AnEnum* an_enum) = 0; // Returns passed in int. - virtual ErrorOr> EchoOptionalNullableInt(const int64_t* a_nullable_int) = 0; + virtual ErrorOr> EchoOptionalNullableInt( + const int64_t* a_nullable_int) = 0; // Returns the passed in string. - virtual ErrorOr> EchoNamedNullableString(const std::string* a_nullable_string) = 0; + virtual ErrorOr> EchoNamedNullableString( + const std::string* a_nullable_string) = 0; // A no-op function taking no arguments and returning no value, to sanity // test basic asynchronous calling. - virtual void NoopAsync(std::function reply)> result) = 0; + virtual void NoopAsync( + std::function reply)> result) = 0; // Returns passed in int asynchronously. virtual void EchoAsyncInt( - int64_t an_int, - std::function reply)> result) = 0; + int64_t an_int, std::function reply)> result) = 0; // Returns passed in double asynchronously. virtual void EchoAsyncDouble( - double a_double, - std::function reply)> result) = 0; + double a_double, std::function reply)> result) = 0; // Returns the passed in boolean asynchronously. virtual void EchoAsyncBool( - bool a_bool, - std::function reply)> result) = 0; + bool a_bool, std::function reply)> result) = 0; // Returns the passed string asynchronously. virtual void EchoAsyncString( - const std::string& a_string, - std::function reply)> result) = 0; + const std::string& a_string, + std::function reply)> result) = 0; // Returns the passed in Uint8List asynchronously. virtual void EchoAsyncUint8List( - const std::vector& a_uint8_list, - std::function> reply)> result) = 0; + const std::vector& a_uint8_list, + std::function> reply)> result) = 0; // Returns the passed in generic Object asynchronously. virtual void EchoAsyncObject( - const flutter::EncodableValue& an_object, - std::function reply)> result) = 0; - // Returns the passed list, to test asynchronous serialization and deserialization. + const flutter::EncodableValue& an_object, + std::function reply)> result) = 0; + // Returns the passed list, to test asynchronous serialization and + // deserialization. virtual void EchoAsyncList( - const flutter::EncodableList& list, - std::function reply)> result) = 0; - // Returns the passed map, to test asynchronous serialization and deserialization. + const flutter::EncodableList& list, + std::function reply)> result) = 0; + // Returns the passed map, to test asynchronous serialization and + // deserialization. virtual void EchoAsyncMap( - const flutter::EncodableMap& a_map, - std::function reply)> result) = 0; - // Returns the passed enum, to test asynchronous serialization and deserialization. + const flutter::EncodableMap& a_map, + std::function reply)> result) = 0; + // Returns the passed enum, to test asynchronous serialization and + // deserialization. virtual void EchoAsyncEnum( - const AnEnum& an_enum, - std::function reply)> result) = 0; + const AnEnum& an_enum, + std::function reply)> result) = 0; // Responds with an error from an async function returning a value. - virtual void ThrowAsyncError(std::function> reply)> result) = 0; + virtual void ThrowAsyncError( + std::function> reply)> + result) = 0; // Responds with an error from an async void function. - virtual void ThrowAsyncErrorFromVoid(std::function reply)> result) = 0; + virtual void ThrowAsyncErrorFromVoid( + std::function reply)> result) = 0; // Responds with a Flutter error from an async function returning a value. - virtual void ThrowAsyncFlutterError(std::function> reply)> result) = 0; + virtual void ThrowAsyncFlutterError( + std::function> reply)> + result) = 0; // Returns the passed object, to test async serialization and deserialization. virtual void EchoAsyncAllTypes( - const AllTypes& everything, - std::function reply)> result) = 0; + const AllTypes& everything, + std::function reply)> result) = 0; // Returns the passed object, to test serialization and deserialization. virtual void EchoAsyncNullableAllNullableTypes( - const AllNullableTypes* everything, - std::function> reply)> result) = 0; + const AllNullableTypes* everything, + std::function> reply)> + result) = 0; // Returns the passed object, to test serialization and deserialization. virtual void EchoAsyncNullableAllNullableTypesWithoutRecursion( - const AllNullableTypesWithoutRecursion* everything, - std::function> reply)> result) = 0; + const AllNullableTypesWithoutRecursion* everything, + std::function< + void(ErrorOr> reply)> + result) = 0; // Returns passed in int asynchronously. virtual void EchoAsyncNullableInt( - const int64_t* an_int, - std::function> reply)> result) = 0; + const int64_t* an_int, + std::function> reply)> result) = 0; // Returns passed in double asynchronously. virtual void EchoAsyncNullableDouble( - const double* a_double, - std::function> reply)> result) = 0; + const double* a_double, + std::function> reply)> result) = 0; // Returns the passed in boolean asynchronously. virtual void EchoAsyncNullableBool( - const bool* a_bool, - std::function> reply)> result) = 0; + const bool* a_bool, + std::function> reply)> result) = 0; // Returns the passed string asynchronously. virtual void EchoAsyncNullableString( - const std::string* a_string, - std::function> reply)> result) = 0; + const std::string* a_string, + std::function> reply)> + result) = 0; // Returns the passed in Uint8List asynchronously. virtual void EchoAsyncNullableUint8List( - const std::vector* a_uint8_list, - std::function>> reply)> result) = 0; + const std::vector* a_uint8_list, + std::function>> reply)> + result) = 0; // Returns the passed in generic Object asynchronously. virtual void EchoAsyncNullableObject( - const flutter::EncodableValue* an_object, - std::function> reply)> result) = 0; - // Returns the passed list, to test asynchronous serialization and deserialization. + const flutter::EncodableValue* an_object, + std::function> reply)> + result) = 0; + // Returns the passed list, to test asynchronous serialization and + // deserialization. virtual void EchoAsyncNullableList( - const flutter::EncodableList* list, - std::function> reply)> result) = 0; - // Returns the passed map, to test asynchronous serialization and deserialization. + const flutter::EncodableList* list, + std::function> reply)> + result) = 0; + // Returns the passed map, to test asynchronous serialization and + // deserialization. virtual void EchoAsyncNullableMap( - const flutter::EncodableMap* a_map, - std::function> reply)> result) = 0; - // Returns the passed enum, to test asynchronous serialization and deserialization. + const flutter::EncodableMap* a_map, + std::function> reply)> + result) = 0; + // Returns the passed enum, to test asynchronous serialization and + // deserialization. virtual void EchoAsyncNullableEnum( - const AnEnum* an_enum, - std::function> reply)> result) = 0; - virtual void CallFlutterNoop(std::function reply)> result) = 0; - virtual void CallFlutterThrowError(std::function> reply)> result) = 0; - virtual void CallFlutterThrowErrorFromVoid(std::function reply)> result) = 0; + const AnEnum* an_enum, + std::function> reply)> result) = 0; + virtual void CallFlutterNoop( + std::function reply)> result) = 0; + virtual void CallFlutterThrowError( + std::function> reply)> + result) = 0; + virtual void CallFlutterThrowErrorFromVoid( + std::function reply)> result) = 0; virtual void CallFlutterEchoAllTypes( - const AllTypes& everything, - std::function reply)> result) = 0; + const AllTypes& everything, + std::function reply)> result) = 0; virtual void CallFlutterEchoAllNullableTypes( - const AllNullableTypes* everything, - std::function> reply)> result) = 0; + const AllNullableTypes* everything, + std::function> reply)> + result) = 0; virtual void CallFlutterSendMultipleNullableTypes( - const bool* a_nullable_bool, - const int64_t* a_nullable_int, - const std::string* a_nullable_string, - std::function reply)> result) = 0; + const bool* a_nullable_bool, const int64_t* a_nullable_int, + const std::string* a_nullable_string, + std::function reply)> result) = 0; virtual void CallFlutterEchoAllNullableTypesWithoutRecursion( - const AllNullableTypesWithoutRecursion* everything, - std::function> reply)> result) = 0; + const AllNullableTypesWithoutRecursion* everything, + std::function< + void(ErrorOr> reply)> + result) = 0; virtual void CallFlutterSendMultipleNullableTypesWithoutRecursion( - const bool* a_nullable_bool, - const int64_t* a_nullable_int, - const std::string* a_nullable_string, - std::function reply)> result) = 0; + const bool* a_nullable_bool, const int64_t* a_nullable_int, + const std::string* a_nullable_string, + std::function reply)> + result) = 0; virtual void CallFlutterEchoBool( - bool a_bool, - std::function reply)> result) = 0; + bool a_bool, std::function reply)> result) = 0; virtual void CallFlutterEchoInt( - int64_t an_int, - std::function reply)> result) = 0; + int64_t an_int, std::function reply)> result) = 0; virtual void CallFlutterEchoDouble( - double a_double, - std::function reply)> result) = 0; + double a_double, std::function reply)> result) = 0; virtual void CallFlutterEchoString( - const std::string& a_string, - std::function reply)> result) = 0; + const std::string& a_string, + std::function reply)> result) = 0; virtual void CallFlutterEchoUint8List( - const std::vector& list, - std::function> reply)> result) = 0; + const std::vector& list, + std::function> reply)> result) = 0; virtual void CallFlutterEchoList( - const flutter::EncodableList& list, - std::function reply)> result) = 0; + const flutter::EncodableList& list, + std::function reply)> result) = 0; virtual void CallFlutterEchoMap( - const flutter::EncodableMap& a_map, - std::function reply)> result) = 0; + const flutter::EncodableMap& a_map, + std::function reply)> result) = 0; virtual void CallFlutterEchoEnum( - const AnEnum& an_enum, - std::function reply)> result) = 0; + const AnEnum& an_enum, + std::function reply)> result) = 0; virtual void CallFlutterEchoNullableBool( - const bool* a_bool, - std::function> reply)> result) = 0; + const bool* a_bool, + std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableInt( - const int64_t* an_int, - std::function> reply)> result) = 0; + const int64_t* an_int, + std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableDouble( - const double* a_double, - std::function> reply)> result) = 0; + const double* a_double, + std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableString( - const std::string* a_string, - std::function> reply)> result) = 0; + const std::string* a_string, + std::function> reply)> + result) = 0; virtual void CallFlutterEchoNullableUint8List( - const std::vector* list, - std::function>> reply)> result) = 0; + const std::vector* list, + std::function>> reply)> + result) = 0; virtual void CallFlutterEchoNullableList( - const flutter::EncodableList* list, - std::function> reply)> result) = 0; + const flutter::EncodableList* list, + std::function> reply)> + result) = 0; virtual void CallFlutterEchoNullableMap( - const flutter::EncodableMap* a_map, - std::function> reply)> result) = 0; + const flutter::EncodableMap* a_map, + std::function> reply)> + result) = 0; virtual void CallFlutterEchoNullableEnum( - const AnEnum* an_enum, - std::function> reply)> result) = 0; + const AnEnum* an_enum, + std::function> reply)> result) = 0; virtual void CallFlutterSmallApiEchoString( - const std::string& a_string, - std::function reply)> result) = 0; + const std::string& a_string, + std::function reply)> result) = 0; // The codec used by HostIntegrationCoreApi. static const flutter::StandardMessageCodec& GetCodec(); - // Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binary_messenger`. - static void SetUp( - flutter::BinaryMessenger* binary_messenger, - HostIntegrationCoreApi* api); - static void SetUp( - flutter::BinaryMessenger* binary_messenger, - HostIntegrationCoreApi* api, - const std::string& message_channel_suffix); + // Sets up an instance of `HostIntegrationCoreApi` to handle messages through + // the `binary_messenger`. + static void SetUp(flutter::BinaryMessenger* binary_messenger, + HostIntegrationCoreApi* api); + static void SetUp(flutter::BinaryMessenger* binary_messenger, + HostIntegrationCoreApi* api, + const std::string& message_channel_suffix); static flutter::EncodableValue WrapError(std::string_view error_message); static flutter::EncodableValue WrapError(const FlutterError& error); protected: HostIntegrationCoreApi() = default; - }; // The core interface that the Dart platform_test code implements for host // integration tests to call into. // -// Generated class from Pigeon that represents Flutter messages that can be called from C++. +// Generated class from Pigeon that represents Flutter messages that can be +// called from C++. class FlutterIntegrationCoreApi { public: FlutterIntegrationCoreApi(flutter::BinaryMessenger* binary_messenger); - FlutterIntegrationCoreApi( - flutter::BinaryMessenger* binary_messenger, - const std::string& message_channel_suffix); + FlutterIntegrationCoreApi(flutter::BinaryMessenger* binary_messenger, + const std::string& message_channel_suffix); static const flutter::StandardMessageCodec& GetCodec(); // A no-op function taking no arguments and returning no value, to sanity // test basic calling. - void Noop( - std::function&& on_success, - std::function&& on_error); + void Noop(std::function&& on_success, + std::function&& on_error); // Responds with an error from an async function returning a value. void ThrowError( - std::function&& on_success, - std::function&& on_error); + std::function&& on_success, + std::function&& on_error); // Responds with an error from an async void function. - void ThrowErrorFromVoid( - std::function&& on_success, - std::function&& on_error); + void ThrowErrorFromVoid(std::function&& on_success, + std::function&& on_error); // Returns the passed object, to test serialization and deserialization. - void EchoAllTypes( - const AllTypes& everything, - std::function&& on_success, - std::function&& on_error); + void EchoAllTypes(const AllTypes& everything, + std::function&& on_success, + std::function&& on_error); // Returns the passed object, to test serialization and deserialization. void EchoAllNullableTypes( - const AllNullableTypes* everything, - std::function&& on_success, - std::function&& on_error); + const AllNullableTypes* everything, + std::function&& on_success, + std::function&& on_error); // Returns passed in arguments of multiple types. // // Tests multiple-arity FlutterApi handling. void SendMultipleNullableTypes( - const bool* a_nullable_bool, - const int64_t* a_nullable_int, - const std::string* a_nullable_string, - std::function&& on_success, - std::function&& on_error); + const bool* a_nullable_bool, const int64_t* a_nullable_int, + const std::string* a_nullable_string, + std::function&& on_success, + std::function&& on_error); // Returns the passed object, to test serialization and deserialization. void EchoAllNullableTypesWithoutRecursion( - const AllNullableTypesWithoutRecursion* everything, - std::function&& on_success, - std::function&& on_error); + const AllNullableTypesWithoutRecursion* everything, + std::function&& on_success, + std::function&& on_error); // Returns passed in arguments of multiple types. // // Tests multiple-arity FlutterApi handling. void SendMultipleNullableTypesWithoutRecursion( - const bool* a_nullable_bool, - const int64_t* a_nullable_int, - const std::string* a_nullable_string, - std::function&& on_success, - std::function&& on_error); + const bool* a_nullable_bool, const int64_t* a_nullable_int, + const std::string* a_nullable_string, + std::function&& on_success, + std::function&& on_error); // Returns the passed boolean, to test serialization and deserialization. - void EchoBool( - bool a_bool, - std::function&& on_success, - std::function&& on_error); + void EchoBool(bool a_bool, std::function&& on_success, + std::function&& on_error); // Returns the passed int, to test serialization and deserialization. - void EchoInt( - int64_t an_int, - std::function&& on_success, - std::function&& on_error); + void EchoInt(int64_t an_int, std::function&& on_success, + std::function&& on_error); // Returns the passed double, to test serialization and deserialization. - void EchoDouble( - double a_double, - std::function&& on_success, - std::function&& on_error); + void EchoDouble(double a_double, std::function&& on_success, + std::function&& on_error); // Returns the passed string, to test serialization and deserialization. - void EchoString( - const std::string& a_string, - std::function&& on_success, - std::function&& on_error); + void EchoString(const std::string& a_string, + std::function&& on_success, + std::function&& on_error); // Returns the passed byte list, to test serialization and deserialization. void EchoUint8List( - const std::vector& list, - std::function&)>&& on_success, - std::function&& on_error); + const std::vector& list, + std::function&)>&& on_success, + std::function&& on_error); // Returns the passed list, to test serialization and deserialization. - void EchoList( - const flutter::EncodableList& list, - std::function&& on_success, - std::function&& on_error); + void EchoList(const flutter::EncodableList& list, + std::function&& on_success, + std::function&& on_error); // Returns the passed map, to test serialization and deserialization. - void EchoMap( - const flutter::EncodableMap& a_map, - std::function&& on_success, - std::function&& on_error); + void EchoMap(const flutter::EncodableMap& a_map, + std::function&& on_success, + std::function&& on_error); // Returns the passed enum to test serialization and deserialization. - void EchoEnum( - const AnEnum& an_enum, - std::function&& on_success, - std::function&& on_error); + void EchoEnum(const AnEnum& an_enum, + std::function&& on_success, + std::function&& on_error); // Returns the passed boolean, to test serialization and deserialization. - void EchoNullableBool( - const bool* a_bool, - std::function&& on_success, - std::function&& on_error); + void EchoNullableBool(const bool* a_bool, + std::function&& on_success, + std::function&& on_error); // Returns the passed int, to test serialization and deserialization. - void EchoNullableInt( - const int64_t* an_int, - std::function&& on_success, - std::function&& on_error); + void EchoNullableInt(const int64_t* an_int, + std::function&& on_success, + std::function&& on_error); // Returns the passed double, to test serialization and deserialization. - void EchoNullableDouble( - const double* a_double, - std::function&& on_success, - std::function&& on_error); + void EchoNullableDouble(const double* a_double, + std::function&& on_success, + std::function&& on_error); // Returns the passed string, to test serialization and deserialization. - void EchoNullableString( - const std::string* a_string, - std::function&& on_success, - std::function&& on_error); + void EchoNullableString(const std::string* a_string, + std::function&& on_success, + std::function&& on_error); // Returns the passed byte list, to test serialization and deserialization. void EchoNullableUint8List( - const std::vector* list, - std::function*)>&& on_success, - std::function&& on_error); + const std::vector* list, + std::function*)>&& on_success, + std::function&& on_error); // Returns the passed list, to test serialization and deserialization. void EchoNullableList( - const flutter::EncodableList* list, - std::function&& on_success, - std::function&& on_error); + const flutter::EncodableList* list, + std::function&& on_success, + std::function&& on_error); // Returns the passed map, to test serialization and deserialization. void EchoNullableMap( - const flutter::EncodableMap* a_map, - std::function&& on_success, - std::function&& on_error); + const flutter::EncodableMap* a_map, + std::function&& on_success, + std::function&& on_error); // Returns the passed enum to test serialization and deserialization. - void EchoNullableEnum( - const AnEnum* an_enum, - std::function&& on_success, - std::function&& on_error); + void EchoNullableEnum(const AnEnum* an_enum, + std::function&& on_success, + std::function&& on_error); // A no-op function taking no arguments and returning no value, to sanity // test basic asynchronous calling. - void NoopAsync( - std::function&& on_success, - std::function&& on_error); + void NoopAsync(std::function&& on_success, + std::function&& on_error); // Returns the passed in generic Object asynchronously. - void EchoAsyncString( - const std::string& a_string, - std::function&& on_success, - std::function&& on_error); + void EchoAsyncString(const std::string& a_string, + std::function&& on_success, + std::function&& on_error); private: flutter::BinaryMessenger* binary_messenger_; @@ -1022,7 +1028,8 @@ class FlutterIntegrationCoreApi { // An API that can be implemented for minimal, compile-only tests. // -// Generated interface from Pigeon that represents a handler of messages from Flutter. +// Generated interface from Pigeon that represents a handler of messages from +// Flutter. class HostTrivialApi { public: HostTrivialApi(const HostTrivialApi&) = delete; @@ -1032,69 +1039,64 @@ class HostTrivialApi { // The codec used by HostTrivialApi. static const flutter::StandardMessageCodec& GetCodec(); - // Sets up an instance of `HostTrivialApi` to handle messages through the `binary_messenger`. - static void SetUp( - flutter::BinaryMessenger* binary_messenger, - HostTrivialApi* api); - static void SetUp( - flutter::BinaryMessenger* binary_messenger, - HostTrivialApi* api, - const std::string& message_channel_suffix); + // Sets up an instance of `HostTrivialApi` to handle messages through the + // `binary_messenger`. + static void SetUp(flutter::BinaryMessenger* binary_messenger, + HostTrivialApi* api); + static void SetUp(flutter::BinaryMessenger* binary_messenger, + HostTrivialApi* api, + const std::string& message_channel_suffix); static flutter::EncodableValue WrapError(std::string_view error_message); static flutter::EncodableValue WrapError(const FlutterError& error); protected: HostTrivialApi() = default; - }; // A simple API implemented in some unit tests. // -// Generated interface from Pigeon that represents a handler of messages from Flutter. +// Generated interface from Pigeon that represents a handler of messages from +// Flutter. class HostSmallApi { public: HostSmallApi(const HostSmallApi&) = delete; HostSmallApi& operator=(const HostSmallApi&) = delete; virtual ~HostSmallApi() {} - virtual void Echo( - const std::string& a_string, - std::function reply)> result) = 0; - virtual void VoidVoid(std::function reply)> result) = 0; + virtual void Echo(const std::string& a_string, + std::function reply)> result) = 0; + virtual void VoidVoid( + std::function reply)> result) = 0; // The codec used by HostSmallApi. static const flutter::StandardMessageCodec& GetCodec(); - // Sets up an instance of `HostSmallApi` to handle messages through the `binary_messenger`. - static void SetUp( - flutter::BinaryMessenger* binary_messenger, - HostSmallApi* api); - static void SetUp( - flutter::BinaryMessenger* binary_messenger, - HostSmallApi* api, - const std::string& message_channel_suffix); + // Sets up an instance of `HostSmallApi` to handle messages through the + // `binary_messenger`. + static void SetUp(flutter::BinaryMessenger* binary_messenger, + HostSmallApi* api); + static void SetUp(flutter::BinaryMessenger* binary_messenger, + HostSmallApi* api, + const std::string& message_channel_suffix); static flutter::EncodableValue WrapError(std::string_view error_message); static flutter::EncodableValue WrapError(const FlutterError& error); protected: HostSmallApi() = default; - }; // A simple API called in some unit tests. // -// Generated class from Pigeon that represents Flutter messages that can be called from C++. +// Generated class from Pigeon that represents Flutter messages that can be +// called from C++. class FlutterSmallApi { public: FlutterSmallApi(flutter::BinaryMessenger* binary_messenger); - FlutterSmallApi( - flutter::BinaryMessenger* binary_messenger, - const std::string& message_channel_suffix); + FlutterSmallApi(flutter::BinaryMessenger* binary_messenger, + const std::string& message_channel_suffix); static const flutter::StandardMessageCodec& GetCodec(); - void EchoWrappedList( - const TestMessage& msg, - std::function&& on_success, - std::function&& on_error); - void EchoString( - const std::string& a_string, - std::function&& on_success, - std::function&& on_error); + void EchoWrappedList(const TestMessage& msg, + std::function&& on_success, + std::function&& on_error); + void EchoString(const std::string& a_string, + std::function&& on_success, + std::function&& on_error); private: flutter::BinaryMessenger* binary_messenger_; From 4627f4a5a8fff210c06fdff608070ffa67c2c51b Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Fri, 19 Jul 2024 16:31:59 -0400 Subject: [PATCH 53/77] formatting --- .../example/app/ios/Runner/Messages.g.swift | 43 +- .../ios/Classes/CoreTests.gen.swift | 1012 +++++++++++++---- .../macos/Classes/CoreTests.gen.swift | 1012 +++++++++++++---- 3 files changed, 1571 insertions(+), 496 deletions(-) diff --git a/packages/pigeon/example/app/ios/Runner/Messages.g.swift b/packages/pigeon/example/app/ios/Runner/Messages.g.swift index f86af0503153..3d5362cc4f1b 100644 --- a/packages/pigeon/example/app/ios/Runner/Messages.g.swift +++ b/packages/pigeon/example/app/ios/Runner/Messages.g.swift @@ -29,7 +29,7 @@ final class PigeonError: Error { var localizedDescription: String { return "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" - } + } } private func wrapResult(_ result: Any?) -> [Any?] { @@ -59,7 +59,9 @@ private func wrapError(_ error: Any) -> [Any?] { } private func createConnectionError(withChannelName channelName: String) -> PigeonError { - return PigeonError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "") + return PigeonError( + code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", + details: "") } private func isNullish(_ value: Any?) -> Bool { @@ -152,7 +154,6 @@ class MessagesPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { static let shared = MessagesPigeonCodec(readerWriter: MessagesPigeonCodecReaderWriter()) } - /// Generated protocol from Pigeon that represents a handler of messages from Flutter. protocol ExampleHostApi { func getHostLanguage() throws -> String @@ -164,9 +165,14 @@ protocol ExampleHostApi { class ExampleHostApiSetup { static var codec: FlutterStandardMessageCodec { MessagesPigeonCodec.shared } /// Sets up an instance of `ExampleHostApi` to handle messages through the `binaryMessenger`. - static func setUp(binaryMessenger: FlutterBinaryMessenger, api: ExampleHostApi?, messageChannelSuffix: String = "") { + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: ExampleHostApi?, messageChannelSuffix: String = "" + ) { let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" - let getHostLanguageChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let getHostLanguageChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.getHostLanguage\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { getHostLanguageChannel.setMessageHandler { _, reply in do { @@ -179,7 +185,9 @@ class ExampleHostApiSetup { } else { getHostLanguageChannel.setMessageHandler(nil) } - let addChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let addChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.add\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { addChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -195,7 +203,9 @@ class ExampleHostApiSetup { } else { addChannel.setMessageHandler(nil) } - let sendMessageChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let sendMessageChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_example_package.ExampleHostApi.sendMessage\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { sendMessageChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -216,7 +226,8 @@ class ExampleHostApiSetup { } /// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. protocol MessageFlutterApiProtocol { - func flutterMethod(aString aStringArg: String?, completion: @escaping (Result) -> Void) + func flutterMethod( + aString aStringArg: String?, completion: @escaping (Result) -> Void) } class MessageFlutterApi: MessageFlutterApiProtocol { private let binaryMessenger: FlutterBinaryMessenger @@ -228,9 +239,13 @@ class MessageFlutterApi: MessageFlutterApiProtocol { var codec: MessagesPigeonCodec { return MessagesPigeonCodec.shared } - func flutterMethod(aString aStringArg: String?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func flutterMethod( + aString aStringArg: String?, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_example_package.MessageFlutterApi.flutterMethod\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -242,7 +257,11 @@ class MessageFlutterApi: MessageFlutterApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! String completion(.success(result)) diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift index dcb2ad4a0ec9..2b95f040b483 100644 --- a/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift +++ b/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift @@ -30,7 +30,7 @@ final class PigeonError: Error { var localizedDescription: String { return "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" - } + } } private func wrapResult(_ result: Any?) -> [Any?] { @@ -60,7 +60,9 @@ private func wrapError(_ error: Any) -> [Any?] { } private func createConnectionError(withChannelName channelName: String) -> PigeonError { - return PigeonError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "") + return PigeonError( + code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", + details: "") } private func isNullish(_ value: Any?) -> Bool { @@ -105,8 +107,10 @@ struct AllTypes { // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ __pigeon_list: [Any?]) -> AllTypes? { let aBool = __pigeon_list[0] as! Bool - let anInt = __pigeon_list[1] is Int64 ? __pigeon_list[1] as! Int64 : Int64(__pigeon_list[1] as! Int32) - let anInt64 = __pigeon_list[2] is Int64 ? __pigeon_list[2] as! Int64 : Int64(__pigeon_list[2] as! Int32) + let anInt = + __pigeon_list[1] is Int64 ? __pigeon_list[1] as! Int64 : Int64(__pigeon_list[1] as! Int32) + let anInt64 = + __pigeon_list[2] is Int64 ? __pigeon_list[2] as! Int64 : Int64(__pigeon_list[2] as! Int32) let aDouble = __pigeon_list[3] as! Double let aByteArray = __pigeon_list[4] as! FlutterStandardTypedData let a4ByteArray = __pigeon_list[5] as! FlutterStandardTypedData @@ -242,8 +246,16 @@ class AllNullableTypes { // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ __pigeon_list: [Any?]) -> AllNullableTypes? { let aNullableBool: Bool? = nilOrValue(__pigeon_list[0]) - let aNullableInt: Int64? = isNullish(__pigeon_list[1]) ? nil : (__pigeon_list[1] is Int64? ? __pigeon_list[1] as! Int64? : Int64(__pigeon_list[1] as! Int32)) - let aNullableInt64: Int64? = isNullish(__pigeon_list[2]) ? nil : (__pigeon_list[2] is Int64? ? __pigeon_list[2] as! Int64? : Int64(__pigeon_list[2] as! Int32)) + let aNullableInt: Int64? = + isNullish(__pigeon_list[1]) + ? nil + : (__pigeon_list[1] is Int64? + ? __pigeon_list[1] as! Int64? : Int64(__pigeon_list[1] as! Int32)) + let aNullableInt64: Int64? = + isNullish(__pigeon_list[2]) + ? nil + : (__pigeon_list[2] is Int64? + ? __pigeon_list[2] as! Int64? : Int64(__pigeon_list[2] as! Int32)) let aNullableDouble: Double? = nilOrValue(__pigeon_list[3]) let aNullableByteArray: FlutterStandardTypedData? = nilOrValue(__pigeon_list[4]) let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(__pigeon_list[5]) @@ -347,8 +359,16 @@ struct AllNullableTypesWithoutRecursion { // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ __pigeon_list: [Any?]) -> AllNullableTypesWithoutRecursion? { let aNullableBool: Bool? = nilOrValue(__pigeon_list[0]) - let aNullableInt: Int64? = isNullish(__pigeon_list[1]) ? nil : (__pigeon_list[1] is Int64? ? __pigeon_list[1] as! Int64? : Int64(__pigeon_list[1] as! Int32)) - let aNullableInt64: Int64? = isNullish(__pigeon_list[2]) ? nil : (__pigeon_list[2] is Int64? ? __pigeon_list[2] as! Int64? : Int64(__pigeon_list[2] as! Int32)) + let aNullableInt: Int64? = + isNullish(__pigeon_list[1]) + ? nil + : (__pigeon_list[1] is Int64? + ? __pigeon_list[1] as! Int64? : Int64(__pigeon_list[1] as! Int32)) + let aNullableInt64: Int64? = + isNullish(__pigeon_list[2]) + ? nil + : (__pigeon_list[2] is Int64? + ? __pigeon_list[2] as! Int64? : Int64(__pigeon_list[2] as! Int32)) let aNullableDouble: Double? = nilOrValue(__pigeon_list[3]) let aNullableByteArray: FlutterStandardTypedData? = nilOrValue(__pigeon_list[4]) let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(__pigeon_list[5]) @@ -431,7 +451,8 @@ struct AllClassesWrapper { // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ __pigeon_list: [Any?]) -> AllClassesWrapper? { let allNullableTypes = __pigeon_list[0] as! AllNullableTypes - let allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = nilOrValue(__pigeon_list[1]) + let allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = nilOrValue( + __pigeon_list[1]) let allTypes: AllTypes? = nilOrValue(__pigeon_list[2]) return AllClassesWrapper( @@ -535,7 +556,6 @@ class CoreTestsPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { static let shared = CoreTestsPigeonCodec(readerWriter: CoreTestsPigeonCodecReaderWriter()) } - /// The core interface that each host language plugin must implement in /// platform_test integration tests. /// @@ -581,7 +601,8 @@ protocol HostIntegrationCoreApi { /// Returns the passed object, to test serialization and deserialization. func echo(_ everything: AllNullableTypes?) throws -> AllNullableTypes? /// Returns the passed object, to test serialization and deserialization. - func echo(_ everything: AllNullableTypesWithoutRecursion?) throws -> AllNullableTypesWithoutRecursion? + func echo(_ everything: AllNullableTypesWithoutRecursion?) throws + -> AllNullableTypesWithoutRecursion? /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. func extractNestedNullableString(from wrapper: AllClassesWrapper) throws -> String? @@ -589,9 +610,13 @@ protocol HostIntegrationCoreApi { /// sending of nested objects. func createNestedObject(with nullableString: String?) throws -> AllClassesWrapper /// Returns passed in arguments of multiple types. - func sendMultipleNullableTypes(aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?) throws -> AllNullableTypes + func sendMultipleNullableTypes( + aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String? + ) throws -> AllNullableTypes /// Returns passed in arguments of multiple types. - func sendMultipleNullableTypesWithoutRecursion(aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?) throws -> AllNullableTypesWithoutRecursion + func sendMultipleNullableTypesWithoutRecursion( + aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String? + ) throws -> AllNullableTypesWithoutRecursion /// Returns passed in int. func echo(_ aNullableInt: Int64?) throws -> Int64? /// Returns passed in double. @@ -625,13 +650,16 @@ protocol HostIntegrationCoreApi { /// Returns the passed string asynchronously. func echoAsync(_ aString: String, completion: @escaping (Result) -> Void) /// Returns the passed in Uint8List asynchronously. - func echoAsync(_ aUint8List: FlutterStandardTypedData, completion: @escaping (Result) -> Void) + func echoAsync( + _ aUint8List: FlutterStandardTypedData, + completion: @escaping (Result) -> Void) /// Returns the passed in generic Object asynchronously. func echoAsync(_ anObject: Any, completion: @escaping (Result) -> Void) /// Returns the passed list, to test asynchronous serialization and deserialization. func echoAsync(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsync(_ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) + func echoAsync( + _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. func echoAsync(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) /// Responds with an error from an async function returning a value. @@ -643,9 +671,13 @@ protocol HostIntegrationCoreApi { /// Returns the passed object, to test async serialization and deserialization. func echoAsync(_ everything: AllTypes, completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echoAsync(_ everything: AllNullableTypes?, completion: @escaping (Result) -> Void) + func echoAsync( + _ everything: AllNullableTypes?, + completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echoAsync(_ everything: AllNullableTypesWithoutRecursion?, completion: @escaping (Result) -> Void) + func echoAsync( + _ everything: AllNullableTypesWithoutRecursion?, + completion: @escaping (Result) -> Void) /// Returns passed in int asynchronously. func echoAsyncNullable(_ anInt: Int64?, completion: @escaping (Result) -> Void) /// Returns passed in double asynchronously. @@ -655,51 +687,81 @@ protocol HostIntegrationCoreApi { /// Returns the passed string asynchronously. func echoAsyncNullable(_ aString: String?, completion: @escaping (Result) -> Void) /// Returns the passed in Uint8List asynchronously. - func echoAsyncNullable(_ aUint8List: FlutterStandardTypedData?, completion: @escaping (Result) -> Void) + func echoAsyncNullable( + _ aUint8List: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void) /// Returns the passed in generic Object asynchronously. func echoAsyncNullable(_ anObject: Any?, completion: @escaping (Result) -> Void) /// Returns the passed list, to test asynchronous serialization and deserialization. func echoAsyncNullable(_ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsyncNullable(_ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + func echoAsyncNullable( + _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. func echoAsyncNullable(_ anEnum: AnEnum?, completion: @escaping (Result) -> Void) func callFlutterNoop(completion: @escaping (Result) -> Void) func callFlutterThrowError(completion: @escaping (Result) -> Void) func callFlutterThrowErrorFromVoid(completion: @escaping (Result) -> Void) - func callFlutterEcho(_ everything: AllTypes, completion: @escaping (Result) -> Void) - func callFlutterEcho(_ everything: AllNullableTypes?, completion: @escaping (Result) -> Void) - func callFlutterSendMultipleNullableTypes(aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, completion: @escaping (Result) -> Void) - func callFlutterEcho(_ everything: AllNullableTypesWithoutRecursion?, completion: @escaping (Result) -> Void) - func callFlutterSendMultipleNullableTypesWithoutRecursion(aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, completion: @escaping (Result) -> Void) + func callFlutterEcho( + _ everything: AllTypes, completion: @escaping (Result) -> Void) + func callFlutterEcho( + _ everything: AllNullableTypes?, + completion: @escaping (Result) -> Void) + func callFlutterSendMultipleNullableTypes( + aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, + completion: @escaping (Result) -> Void) + func callFlutterEcho( + _ everything: AllNullableTypesWithoutRecursion?, + completion: @escaping (Result) -> Void) + func callFlutterSendMultipleNullableTypesWithoutRecursion( + aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, + completion: @escaping (Result) -> Void) func callFlutterEcho(_ aBool: Bool, completion: @escaping (Result) -> Void) func callFlutterEcho(_ anInt: Int64, completion: @escaping (Result) -> Void) func callFlutterEcho(_ aDouble: Double, completion: @escaping (Result) -> Void) func callFlutterEcho(_ aString: String, completion: @escaping (Result) -> Void) - func callFlutterEcho(_ list: FlutterStandardTypedData, completion: @escaping (Result) -> Void) + func callFlutterEcho( + _ list: FlutterStandardTypedData, + completion: @escaping (Result) -> Void) func callFlutterEcho(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) - func callFlutterEcho(_ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) + func callFlutterEcho( + _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) func callFlutterEcho(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) func callFlutterEchoNullable(_ aBool: Bool?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable(_ anInt: Int64?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable(_ aDouble: Double?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable(_ aString: String?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable(_ list: FlutterStandardTypedData?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable(_ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) - func callFlutterEchoNullable(_ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) - func callFlutterNullableEcho(_ anEnum: AnEnum?, completion: @escaping (Result) -> Void) - func callFlutterSmallApiEcho(_ aString: String, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable( + _ anInt: Int64?, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable( + _ aDouble: Double?, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable( + _ aString: String?, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable( + _ list: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void) + func callFlutterEchoNullable( + _ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) + func callFlutterEchoNullable( + _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + func callFlutterNullableEcho( + _ anEnum: AnEnum?, completion: @escaping (Result) -> Void) + func callFlutterSmallApiEcho( + _ aString: String, completion: @escaping (Result) -> Void) } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. class HostIntegrationCoreApiSetup { static var codec: FlutterStandardMessageCodec { CoreTestsPigeonCodec.shared } /// Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binaryMessenger`. - static func setUp(binaryMessenger: FlutterBinaryMessenger, api: HostIntegrationCoreApi?, messageChannelSuffix: String = "") { + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: HostIntegrationCoreApi?, + messageChannelSuffix: String = "" + ) { let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. - let noopChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let noopChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { noopChannel.setMessageHandler { _, reply in do { @@ -713,7 +775,10 @@ class HostIntegrationCoreApiSetup { noopChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAllTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAllTypesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAllTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -729,7 +794,10 @@ class HostIntegrationCoreApiSetup { echoAllTypesChannel.setMessageHandler(nil) } /// Returns an error, to test error handling. - let throwErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let throwErrorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwErrorChannel.setMessageHandler { _, reply in do { @@ -743,7 +811,10 @@ class HostIntegrationCoreApiSetup { throwErrorChannel.setMessageHandler(nil) } /// Returns an error from a void function, to test error handling. - let throwErrorFromVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let throwErrorFromVoidChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwErrorFromVoidChannel.setMessageHandler { _, reply in do { @@ -757,7 +828,10 @@ class HostIntegrationCoreApiSetup { throwErrorFromVoidChannel.setMessageHandler(nil) } /// Returns a Flutter error, to test error handling. - let throwFlutterErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let throwFlutterErrorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwFlutterErrorChannel.setMessageHandler { _, reply in do { @@ -771,7 +845,10 @@ class HostIntegrationCoreApiSetup { throwFlutterErrorChannel.setMessageHandler(nil) } /// Returns passed in int. - let echoIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -787,7 +864,10 @@ class HostIntegrationCoreApiSetup { echoIntChannel.setMessageHandler(nil) } /// Returns passed in double. - let echoDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -803,7 +883,10 @@ class HostIntegrationCoreApiSetup { echoDoubleChannel.setMessageHandler(nil) } /// Returns the passed in boolean. - let echoBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoBoolChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -819,7 +902,10 @@ class HostIntegrationCoreApiSetup { echoBoolChannel.setMessageHandler(nil) } /// Returns the passed in string. - let echoStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -835,7 +921,10 @@ class HostIntegrationCoreApiSetup { echoStringChannel.setMessageHandler(nil) } /// Returns the passed in Uint8List. - let echoUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -851,7 +940,10 @@ class HostIntegrationCoreApiSetup { echoUint8ListChannel.setMessageHandler(nil) } /// Returns the passed in generic Object. - let echoObjectChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoObjectChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoObjectChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -867,7 +959,10 @@ class HostIntegrationCoreApiSetup { echoObjectChannel.setMessageHandler(nil) } /// Returns the passed list, to test serialization and deserialization. - let echoListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -883,7 +978,10 @@ class HostIntegrationCoreApiSetup { echoListChannel.setMessageHandler(nil) } /// Returns the passed map, to test serialization and deserialization. - let echoMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -899,7 +997,10 @@ class HostIntegrationCoreApiSetup { echoMapChannel.setMessageHandler(nil) } /// Returns the passed map to test nested class serialization and deserialization. - let echoClassWrapperChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoClassWrapperChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoClassWrapperChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -915,7 +1016,10 @@ class HostIntegrationCoreApiSetup { echoClassWrapperChannel.setMessageHandler(nil) } /// Returns the passed enum to test serialization and deserialization. - let echoEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -931,7 +1035,10 @@ class HostIntegrationCoreApiSetup { echoEnumChannel.setMessageHandler(nil) } /// Returns the default string. - let echoNamedDefaultStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNamedDefaultStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNamedDefaultStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -947,7 +1054,10 @@ class HostIntegrationCoreApiSetup { echoNamedDefaultStringChannel.setMessageHandler(nil) } /// Returns passed in double. - let echoOptionalDefaultDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoOptionalDefaultDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoOptionalDefaultDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -963,7 +1073,10 @@ class HostIntegrationCoreApiSetup { echoOptionalDefaultDoubleChannel.setMessageHandler(nil) } /// Returns passed in int. - let echoRequiredIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoRequiredIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoRequiredIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -979,7 +1092,10 @@ class HostIntegrationCoreApiSetup { echoRequiredIntChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAllNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAllNullableTypesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAllNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -995,7 +1111,10 @@ class HostIntegrationCoreApiSetup { echoAllNullableTypesChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAllNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1012,7 +1131,10 @@ class HostIntegrationCoreApiSetup { } /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. - let extractNestedNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let extractNestedNullableStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { extractNestedNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1029,7 +1151,10 @@ class HostIntegrationCoreApiSetup { } /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. - let createNestedNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let createNestedNullableStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { createNestedNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1045,15 +1170,21 @@ class HostIntegrationCoreApiSetup { createNestedNullableStringChannel.setMessageHandler(nil) } /// Returns passed in arguments of multiple types. - let sendMultipleNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let sendMultipleNullableTypesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { sendMultipleNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = isNullish(args[1]) ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = + isNullish(args[1]) + ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) let aNullableStringArg: String? = nilOrValue(args[2]) do { - let result = try api.sendMultipleNullableTypes(aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) + let result = try api.sendMultipleNullableTypes( + aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1063,15 +1194,21 @@ class HostIntegrationCoreApiSetup { sendMultipleNullableTypesChannel.setMessageHandler(nil) } /// Returns passed in arguments of multiple types. - let sendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let sendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { sendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = isNullish(args[1]) ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = + isNullish(args[1]) + ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) let aNullableStringArg: String? = nilOrValue(args[2]) do { - let result = try api.sendMultipleNullableTypesWithoutRecursion(aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) + let result = try api.sendMultipleNullableTypesWithoutRecursion( + aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1081,11 +1218,16 @@ class HostIntegrationCoreApiSetup { sendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler(nil) } /// Returns passed in int. - let echoNullableIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aNullableIntArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let aNullableIntArg: Int64? = + isNullish(args[0]) + ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) do { let result = try api.echo(aNullableIntArg) reply(wrapResult(result)) @@ -1097,7 +1239,10 @@ class HostIntegrationCoreApiSetup { echoNullableIntChannel.setMessageHandler(nil) } /// Returns passed in double. - let echoNullableDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1113,7 +1258,10 @@ class HostIntegrationCoreApiSetup { echoNullableDoubleChannel.setMessageHandler(nil) } /// Returns the passed in boolean. - let echoNullableBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableBoolChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1129,7 +1277,10 @@ class HostIntegrationCoreApiSetup { echoNullableBoolChannel.setMessageHandler(nil) } /// Returns the passed in string. - let echoNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1145,7 +1296,10 @@ class HostIntegrationCoreApiSetup { echoNullableStringChannel.setMessageHandler(nil) } /// Returns the passed in Uint8List. - let echoNullableUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1161,7 +1315,10 @@ class HostIntegrationCoreApiSetup { echoNullableUint8ListChannel.setMessageHandler(nil) } /// Returns the passed in generic Object. - let echoNullableObjectChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableObjectChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableObjectChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1177,7 +1334,10 @@ class HostIntegrationCoreApiSetup { echoNullableObjectChannel.setMessageHandler(nil) } /// Returns the passed list, to test serialization and deserialization. - let echoNullableListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1193,7 +1353,10 @@ class HostIntegrationCoreApiSetup { echoNullableListChannel.setMessageHandler(nil) } /// Returns the passed map, to test serialization and deserialization. - let echoNullableMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1208,7 +1371,10 @@ class HostIntegrationCoreApiSetup { } else { echoNullableMapChannel.setMessageHandler(nil) } - let echoNullableEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1224,11 +1390,16 @@ class HostIntegrationCoreApiSetup { echoNullableEnumChannel.setMessageHandler(nil) } /// Returns passed in int. - let echoOptionalNullableIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoOptionalNullableIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoOptionalNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aNullableIntArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let aNullableIntArg: Int64? = + isNullish(args[0]) + ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) do { let result = try api.echoOptional(aNullableIntArg) reply(wrapResult(result)) @@ -1240,7 +1411,10 @@ class HostIntegrationCoreApiSetup { echoOptionalNullableIntChannel.setMessageHandler(nil) } /// Returns the passed in string. - let echoNamedNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNamedNullableStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNamedNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1257,7 +1431,10 @@ class HostIntegrationCoreApiSetup { } /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. - let noopAsyncChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let noopAsyncChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { noopAsyncChannel.setMessageHandler { _, reply in api.noopAsync { result in @@ -1273,7 +1450,10 @@ class HostIntegrationCoreApiSetup { noopAsyncChannel.setMessageHandler(nil) } /// Returns passed in int asynchronously. - let echoAsyncIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1291,7 +1471,10 @@ class HostIntegrationCoreApiSetup { echoAsyncIntChannel.setMessageHandler(nil) } /// Returns passed in double asynchronously. - let echoAsyncDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1309,7 +1492,10 @@ class HostIntegrationCoreApiSetup { echoAsyncDoubleChannel.setMessageHandler(nil) } /// Returns the passed in boolean asynchronously. - let echoAsyncBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncBoolChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1327,7 +1513,10 @@ class HostIntegrationCoreApiSetup { echoAsyncBoolChannel.setMessageHandler(nil) } /// Returns the passed string asynchronously. - let echoAsyncStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1345,7 +1534,10 @@ class HostIntegrationCoreApiSetup { echoAsyncStringChannel.setMessageHandler(nil) } /// Returns the passed in Uint8List asynchronously. - let echoAsyncUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1363,7 +1555,10 @@ class HostIntegrationCoreApiSetup { echoAsyncUint8ListChannel.setMessageHandler(nil) } /// Returns the passed in generic Object asynchronously. - let echoAsyncObjectChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncObjectChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncObjectChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1381,7 +1576,10 @@ class HostIntegrationCoreApiSetup { echoAsyncObjectChannel.setMessageHandler(nil) } /// Returns the passed list, to test asynchronous serialization and deserialization. - let echoAsyncListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1399,7 +1597,10 @@ class HostIntegrationCoreApiSetup { echoAsyncListChannel.setMessageHandler(nil) } /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1417,7 +1618,10 @@ class HostIntegrationCoreApiSetup { echoAsyncMapChannel.setMessageHandler(nil) } /// Returns the passed enum, to test asynchronous serialization and deserialization. - let echoAsyncEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1435,7 +1639,10 @@ class HostIntegrationCoreApiSetup { echoAsyncEnumChannel.setMessageHandler(nil) } /// Responds with an error from an async function returning a value. - let throwAsyncErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let throwAsyncErrorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwAsyncErrorChannel.setMessageHandler { _, reply in api.throwAsyncError { result in @@ -1451,7 +1658,10 @@ class HostIntegrationCoreApiSetup { throwAsyncErrorChannel.setMessageHandler(nil) } /// Responds with an error from an async void function. - let throwAsyncErrorFromVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let throwAsyncErrorFromVoidChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwAsyncErrorFromVoidChannel.setMessageHandler { _, reply in api.throwAsyncErrorFromVoid { result in @@ -1467,7 +1677,10 @@ class HostIntegrationCoreApiSetup { throwAsyncErrorFromVoidChannel.setMessageHandler(nil) } /// Responds with a Flutter error from an async function returning a value. - let throwAsyncFlutterErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let throwAsyncFlutterErrorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwAsyncFlutterErrorChannel.setMessageHandler { _, reply in api.throwAsyncFlutterError { result in @@ -1483,7 +1696,10 @@ class HostIntegrationCoreApiSetup { throwAsyncFlutterErrorChannel.setMessageHandler(nil) } /// Returns the passed object, to test async serialization and deserialization. - let echoAsyncAllTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncAllTypesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncAllTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1501,7 +1717,10 @@ class HostIntegrationCoreApiSetup { echoAsyncAllTypesChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAsyncNullableAllNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableAllNullableTypesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableAllNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1519,7 +1738,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableAllNullableTypesChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAsyncNullableAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableAllNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1537,11 +1759,16 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableAllNullableTypesWithoutRecursionChannel.setMessageHandler(nil) } /// Returns passed in int asynchronously. - let echoAsyncNullableIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let anIntArg: Int64? = + isNullish(args[0]) + ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) api.echoAsyncNullable(anIntArg) { result in switch result { case .success(let res): @@ -1555,7 +1782,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableIntChannel.setMessageHandler(nil) } /// Returns passed in double asynchronously. - let echoAsyncNullableDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1573,7 +1803,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableDoubleChannel.setMessageHandler(nil) } /// Returns the passed in boolean asynchronously. - let echoAsyncNullableBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableBoolChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1591,7 +1824,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableBoolChannel.setMessageHandler(nil) } /// Returns the passed string asynchronously. - let echoAsyncNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1609,7 +1845,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableStringChannel.setMessageHandler(nil) } /// Returns the passed in Uint8List asynchronously. - let echoAsyncNullableUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1627,7 +1866,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableUint8ListChannel.setMessageHandler(nil) } /// Returns the passed in generic Object asynchronously. - let echoAsyncNullableObjectChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableObjectChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableObjectChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1645,7 +1887,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableObjectChannel.setMessageHandler(nil) } /// Returns the passed list, to test asynchronous serialization and deserialization. - let echoAsyncNullableListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1663,7 +1908,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableListChannel.setMessageHandler(nil) } /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncNullableMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1681,7 +1929,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableMapChannel.setMessageHandler(nil) } /// Returns the passed enum, to test asynchronous serialization and deserialization. - let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1698,7 +1949,10 @@ class HostIntegrationCoreApiSetup { } else { echoAsyncNullableEnumChannel.setMessageHandler(nil) } - let callFlutterNoopChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterNoopChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterNoopChannel.setMessageHandler { _, reply in api.callFlutterNoop { result in @@ -1713,7 +1967,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterNoopChannel.setMessageHandler(nil) } - let callFlutterThrowErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterThrowErrorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterThrowErrorChannel.setMessageHandler { _, reply in api.callFlutterThrowError { result in @@ -1728,7 +1985,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterThrowErrorChannel.setMessageHandler(nil) } - let callFlutterThrowErrorFromVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterThrowErrorFromVoidChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterThrowErrorFromVoidChannel.setMessageHandler { _, reply in api.callFlutterThrowErrorFromVoid { result in @@ -1743,7 +2003,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterThrowErrorFromVoidChannel.setMessageHandler(nil) } - let callFlutterEchoAllTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoAllTypesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoAllTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1760,7 +2023,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoAllTypesChannel.setMessageHandler(nil) } - let callFlutterEchoAllNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoAllNullableTypesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoAllNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1777,14 +2043,21 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoAllNullableTypesChannel.setMessageHandler(nil) } - let callFlutterSendMultipleNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterSendMultipleNullableTypesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterSendMultipleNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = isNullish(args[1]) ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = + isNullish(args[1]) + ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) let aNullableStringArg: String? = nilOrValue(args[2]) - api.callFlutterSendMultipleNullableTypes(aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) { result in + api.callFlutterSendMultipleNullableTypes( + aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg + ) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -1796,7 +2069,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterSendMultipleNullableTypesChannel.setMessageHandler(nil) } - let callFlutterEchoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoAllNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1813,14 +2089,22 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoAllNullableTypesWithoutRecursionChannel.setMessageHandler(nil) } - let callFlutterSendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterSendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterSendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in + callFlutterSendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler { + message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = isNullish(args[1]) ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = + isNullish(args[1]) + ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) let aNullableStringArg: String? = nilOrValue(args[2]) - api.callFlutterSendMultipleNullableTypesWithoutRecursion(aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) { result in + api.callFlutterSendMultipleNullableTypesWithoutRecursion( + aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg + ) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -1832,7 +2116,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterSendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler(nil) } - let callFlutterEchoBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoBoolChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1849,7 +2136,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoBoolChannel.setMessageHandler(nil) } - let callFlutterEchoIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1866,7 +2156,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoIntChannel.setMessageHandler(nil) } - let callFlutterEchoDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1883,7 +2176,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoDoubleChannel.setMessageHandler(nil) } - let callFlutterEchoStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1900,7 +2196,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoStringChannel.setMessageHandler(nil) } - let callFlutterEchoUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1917,7 +2216,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoUint8ListChannel.setMessageHandler(nil) } - let callFlutterEchoListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1934,7 +2236,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoListChannel.setMessageHandler(nil) } - let callFlutterEchoMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1951,7 +2256,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoMapChannel.setMessageHandler(nil) } - let callFlutterEchoEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1968,7 +2276,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoEnumChannel.setMessageHandler(nil) } - let callFlutterEchoNullableBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableBoolChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1985,11 +2296,16 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableBoolChannel.setMessageHandler(nil) } - let callFlutterEchoNullableIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let anIntArg: Int64? = + isNullish(args[0]) + ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) api.callFlutterEchoNullable(anIntArg) { result in switch result { case .success(let res): @@ -2002,7 +2318,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableIntChannel.setMessageHandler(nil) } - let callFlutterEchoNullableDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2019,7 +2338,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableDoubleChannel.setMessageHandler(nil) } - let callFlutterEchoNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2036,7 +2358,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableStringChannel.setMessageHandler(nil) } - let callFlutterEchoNullableUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2053,7 +2378,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableUint8ListChannel.setMessageHandler(nil) } - let callFlutterEchoNullableListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2070,7 +2398,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableListChannel.setMessageHandler(nil) } - let callFlutterEchoNullableMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2087,7 +2418,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2104,7 +2438,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableEnumChannel.setMessageHandler(nil) } - let callFlutterSmallApiEchoStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterSmallApiEchoStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterSmallApiEchoStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2136,19 +2473,30 @@ protocol FlutterIntegrationCoreApiProtocol { /// Responds with an error from an async void function. func throwErrorFromVoid(completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echo(_ everythingArg: AllTypes, completion: @escaping (Result) -> Void) + func echo( + _ everythingArg: AllTypes, completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echoNullable(_ everythingArg: AllNullableTypes?, completion: @escaping (Result) -> Void) + func echoNullable( + _ everythingArg: AllNullableTypes?, + completion: @escaping (Result) -> Void) /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypes(aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, completion: @escaping (Result) -> Void) + func sendMultipleNullableTypes( + aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, + aString aNullableStringArg: String?, + completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echoNullable(_ everythingArg: AllNullableTypesWithoutRecursion?, completion: @escaping (Result) -> Void) + func echoNullable( + _ everythingArg: AllNullableTypesWithoutRecursion?, + completion: @escaping (Result) -> Void) /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypesWithoutRecursion(aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, completion: @escaping (Result) -> Void) + func sendMultipleNullableTypesWithoutRecursion( + aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, + aString aNullableStringArg: String?, + completion: @escaping (Result) -> Void) /// Returns the passed boolean, to test serialization and deserialization. func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) /// Returns the passed int, to test serialization and deserialization. @@ -2158,11 +2506,15 @@ protocol FlutterIntegrationCoreApiProtocol { /// Returns the passed string, to test serialization and deserialization. func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) /// Returns the passed byte list, to test serialization and deserialization. - func echo(_ listArg: FlutterStandardTypedData, completion: @escaping (Result) -> Void) + func echo( + _ listArg: FlutterStandardTypedData, + completion: @escaping (Result) -> Void) /// Returns the passed list, to test serialization and deserialization. func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) /// Returns the passed map, to test serialization and deserialization. - func echo(_ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void) + func echo( + _ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void + ) /// Returns the passed enum to test serialization and deserialization. func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) /// Returns the passed boolean, to test serialization and deserialization. @@ -2170,17 +2522,25 @@ protocol FlutterIntegrationCoreApiProtocol { /// Returns the passed int, to test serialization and deserialization. func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) /// Returns the passed double, to test serialization and deserialization. - func echoNullable(_ aDoubleArg: Double?, completion: @escaping (Result) -> Void) + func echoNullable( + _ aDoubleArg: Double?, completion: @escaping (Result) -> Void) /// Returns the passed string, to test serialization and deserialization. - func echoNullable(_ aStringArg: String?, completion: @escaping (Result) -> Void) + func echoNullable( + _ aStringArg: String?, completion: @escaping (Result) -> Void) /// Returns the passed byte list, to test serialization and deserialization. - func echoNullable(_ listArg: FlutterStandardTypedData?, completion: @escaping (Result) -> Void) + func echoNullable( + _ listArg: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void) /// Returns the passed list, to test serialization and deserialization. - func echoNullable(_ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) + func echoNullable( + _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) /// Returns the passed map, to test serialization and deserialization. - func echoNullable(_ aMapArg: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void) + func echoNullable( + _ aMapArg: [String?: Any?]?, + completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void) /// Returns the passed enum to test serialization and deserialization. - func echoNullable(_ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) + func echoNullable( + _ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. func noopAsync(completion: @escaping (Result) -> Void) @@ -2200,8 +2560,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. func noop(completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2219,8 +2581,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Responds with an error from an async function returning a value. func throwError(completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2239,8 +2603,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Responds with an error from an async void function. func throwErrorFromVoid(completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2257,9 +2623,13 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed object, to test serialization and deserialization. - func echo(_ everythingArg: AllTypes, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo( + _ everythingArg: AllTypes, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([everythingArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2271,7 +2641,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! AllTypes completion(.success(result)) @@ -2279,9 +2653,14 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed object, to test serialization and deserialization. - func echoNullable(_ everythingArg: AllNullableTypes?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable( + _ everythingArg: AllNullableTypes?, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([everythingArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2301,10 +2680,17 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypes(aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { response in + func sendMultipleNullableTypes( + aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, + aString aNullableStringArg: String?, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { + response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2315,7 +2701,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! AllNullableTypes completion(.success(result)) @@ -2323,9 +2713,14 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed object, to test serialization and deserialization. - func echoNullable(_ everythingArg: AllNullableTypesWithoutRecursion?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable( + _ everythingArg: AllNullableTypesWithoutRecursion?, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([everythingArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2345,10 +2740,17 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypesWithoutRecursion(aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { response in + func sendMultipleNullableTypesWithoutRecursion( + aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, + aString aNullableStringArg: String?, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { + response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2359,7 +2761,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! AllNullableTypesWithoutRecursion completion(.success(result)) @@ -2368,8 +2774,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed boolean, to test serialization and deserialization. func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aBoolArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2381,7 +2789,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! Bool completion(.success(result)) @@ -2390,8 +2802,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed int, to test serialization and deserialization. func echo(_ anIntArg: Int64, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anIntArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2403,17 +2817,24 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] is Int64 ? listResponse[0] as! Int64 : Int64(listResponse[0] as! Int32) + let result = + listResponse[0] is Int64 ? listResponse[0] as! Int64 : Int64(listResponse[0] as! Int32) completion(.success(result)) } } } /// Returns the passed double, to test serialization and deserialization. func echo(_ aDoubleArg: Double, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aDoubleArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2425,7 +2846,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! Double completion(.success(result)) @@ -2434,8 +2859,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed string, to test serialization and deserialization. func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2447,7 +2874,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! String completion(.success(result)) @@ -2455,9 +2886,14 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed byte list, to test serialization and deserialization. - func echo(_ listArg: FlutterStandardTypedData, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo( + _ listArg: FlutterStandardTypedData, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2469,7 +2905,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! FlutterStandardTypedData completion(.success(result)) @@ -2478,8 +2918,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed list, to test serialization and deserialization. func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2491,7 +2933,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! [Any?] completion(.success(result)) @@ -2499,9 +2945,13 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed map, to test serialization and deserialization. - func echo(_ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo( + _ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2513,7 +2963,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! [String?: Any?] completion(.success(result)) @@ -2522,8 +2976,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed enum to test serialization and deserialization. func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anEnumArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2535,7 +2991,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! AnEnum completion(.success(result)) @@ -2544,8 +3004,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed boolean, to test serialization and deserialization. func echoNullable(_ aBoolArg: Bool?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aBoolArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2563,9 +3025,12 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed int, to test serialization and deserialization. - func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) + { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anIntArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2577,15 +3042,23 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: Int64? = isNullish(listResponse[0]) ? nil : (listResponse[0] is Int64? ? listResponse[0] as! Int64? : Int64(listResponse[0] as! Int32)) + let result: Int64? = + isNullish(listResponse[0]) + ? nil + : (listResponse[0] is Int64? + ? listResponse[0] as! Int64? : Int64(listResponse[0] as! Int32)) completion(.success(result)) } } } /// Returns the passed double, to test serialization and deserialization. - func echoNullable(_ aDoubleArg: Double?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable( + _ aDoubleArg: Double?, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aDoubleArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2603,9 +3076,13 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed string, to test serialization and deserialization. - func echoNullable(_ aStringArg: String?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable( + _ aStringArg: String?, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2623,9 +3100,14 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed byte list, to test serialization and deserialization. - func echoNullable(_ listArg: FlutterStandardTypedData?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable( + _ listArg: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2643,9 +3125,13 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed list, to test serialization and deserialization. - func echoNullable(_ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable( + _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2663,9 +3149,14 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed map, to test serialization and deserialization. - func echoNullable(_ aMapArg: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable( + _ aMapArg: [String?: Any?]?, + completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2683,9 +3174,13 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed enum to test serialization and deserialization. - func echoNullable(_ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable( + _ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anEnumArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2705,8 +3200,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. func noopAsync(completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2723,9 +3220,12 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed in generic Object asynchronously. - func echoAsync(_ aStringArg: String, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoAsync(_ aStringArg: String, completion: @escaping (Result) -> Void) + { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2737,7 +3237,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! String completion(.success(result)) @@ -2756,9 +3260,13 @@ protocol HostTrivialApi { class HostTrivialApiSetup { static var codec: FlutterStandardMessageCodec { CoreTestsPigeonCodec.shared } /// Sets up an instance of `HostTrivialApi` to handle messages through the `binaryMessenger`. - static func setUp(binaryMessenger: FlutterBinaryMessenger, api: HostTrivialApi?, messageChannelSuffix: String = "") { + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: HostTrivialApi?, messageChannelSuffix: String = "" + ) { let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" - let noopChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let noopChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { noopChannel.setMessageHandler { _, reply in do { @@ -2785,9 +3293,13 @@ protocol HostSmallApi { class HostSmallApiSetup { static var codec: FlutterStandardMessageCodec { CoreTestsPigeonCodec.shared } /// Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. - static func setUp(binaryMessenger: FlutterBinaryMessenger, api: HostSmallApi?, messageChannelSuffix: String = "") { + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: HostSmallApi?, messageChannelSuffix: String = "" + ) { let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" - let echoChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2804,7 +3316,9 @@ class HostSmallApiSetup { } else { echoChannel.setMessageHandler(nil) } - let voidVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let voidVoidChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { voidVoidChannel.setMessageHandler { _, reply in api.voidVoid { result in @@ -2838,9 +3352,12 @@ class FlutterSmallApi: FlutterSmallApiProtocol { var codec: CoreTestsPigeonCodec { return CoreTestsPigeonCodec.shared } - func echo(_ msgArg: TestMessage, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo(_ msgArg: TestMessage, completion: @escaping (Result) -> Void) + { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([msgArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2852,16 +3369,23 @@ class FlutterSmallApi: FlutterSmallApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! TestMessage completion(.success(result)) } } } - func echo(string aStringArg: String, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo(string aStringArg: String, completion: @escaping (Result) -> Void) + { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2873,7 +3397,11 @@ class FlutterSmallApi: FlutterSmallApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! String completion(.success(result)) diff --git a/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift index dcb2ad4a0ec9..2b95f040b483 100644 --- a/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift +++ b/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift @@ -30,7 +30,7 @@ final class PigeonError: Error { var localizedDescription: String { return "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" - } + } } private func wrapResult(_ result: Any?) -> [Any?] { @@ -60,7 +60,9 @@ private func wrapError(_ error: Any) -> [Any?] { } private func createConnectionError(withChannelName channelName: String) -> PigeonError { - return PigeonError(code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", details: "") + return PigeonError( + code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", + details: "") } private func isNullish(_ value: Any?) -> Bool { @@ -105,8 +107,10 @@ struct AllTypes { // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ __pigeon_list: [Any?]) -> AllTypes? { let aBool = __pigeon_list[0] as! Bool - let anInt = __pigeon_list[1] is Int64 ? __pigeon_list[1] as! Int64 : Int64(__pigeon_list[1] as! Int32) - let anInt64 = __pigeon_list[2] is Int64 ? __pigeon_list[2] as! Int64 : Int64(__pigeon_list[2] as! Int32) + let anInt = + __pigeon_list[1] is Int64 ? __pigeon_list[1] as! Int64 : Int64(__pigeon_list[1] as! Int32) + let anInt64 = + __pigeon_list[2] is Int64 ? __pigeon_list[2] as! Int64 : Int64(__pigeon_list[2] as! Int32) let aDouble = __pigeon_list[3] as! Double let aByteArray = __pigeon_list[4] as! FlutterStandardTypedData let a4ByteArray = __pigeon_list[5] as! FlutterStandardTypedData @@ -242,8 +246,16 @@ class AllNullableTypes { // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ __pigeon_list: [Any?]) -> AllNullableTypes? { let aNullableBool: Bool? = nilOrValue(__pigeon_list[0]) - let aNullableInt: Int64? = isNullish(__pigeon_list[1]) ? nil : (__pigeon_list[1] is Int64? ? __pigeon_list[1] as! Int64? : Int64(__pigeon_list[1] as! Int32)) - let aNullableInt64: Int64? = isNullish(__pigeon_list[2]) ? nil : (__pigeon_list[2] is Int64? ? __pigeon_list[2] as! Int64? : Int64(__pigeon_list[2] as! Int32)) + let aNullableInt: Int64? = + isNullish(__pigeon_list[1]) + ? nil + : (__pigeon_list[1] is Int64? + ? __pigeon_list[1] as! Int64? : Int64(__pigeon_list[1] as! Int32)) + let aNullableInt64: Int64? = + isNullish(__pigeon_list[2]) + ? nil + : (__pigeon_list[2] is Int64? + ? __pigeon_list[2] as! Int64? : Int64(__pigeon_list[2] as! Int32)) let aNullableDouble: Double? = nilOrValue(__pigeon_list[3]) let aNullableByteArray: FlutterStandardTypedData? = nilOrValue(__pigeon_list[4]) let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(__pigeon_list[5]) @@ -347,8 +359,16 @@ struct AllNullableTypesWithoutRecursion { // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ __pigeon_list: [Any?]) -> AllNullableTypesWithoutRecursion? { let aNullableBool: Bool? = nilOrValue(__pigeon_list[0]) - let aNullableInt: Int64? = isNullish(__pigeon_list[1]) ? nil : (__pigeon_list[1] is Int64? ? __pigeon_list[1] as! Int64? : Int64(__pigeon_list[1] as! Int32)) - let aNullableInt64: Int64? = isNullish(__pigeon_list[2]) ? nil : (__pigeon_list[2] is Int64? ? __pigeon_list[2] as! Int64? : Int64(__pigeon_list[2] as! Int32)) + let aNullableInt: Int64? = + isNullish(__pigeon_list[1]) + ? nil + : (__pigeon_list[1] is Int64? + ? __pigeon_list[1] as! Int64? : Int64(__pigeon_list[1] as! Int32)) + let aNullableInt64: Int64? = + isNullish(__pigeon_list[2]) + ? nil + : (__pigeon_list[2] is Int64? + ? __pigeon_list[2] as! Int64? : Int64(__pigeon_list[2] as! Int32)) let aNullableDouble: Double? = nilOrValue(__pigeon_list[3]) let aNullableByteArray: FlutterStandardTypedData? = nilOrValue(__pigeon_list[4]) let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(__pigeon_list[5]) @@ -431,7 +451,8 @@ struct AllClassesWrapper { // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ __pigeon_list: [Any?]) -> AllClassesWrapper? { let allNullableTypes = __pigeon_list[0] as! AllNullableTypes - let allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = nilOrValue(__pigeon_list[1]) + let allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion? = nilOrValue( + __pigeon_list[1]) let allTypes: AllTypes? = nilOrValue(__pigeon_list[2]) return AllClassesWrapper( @@ -535,7 +556,6 @@ class CoreTestsPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { static let shared = CoreTestsPigeonCodec(readerWriter: CoreTestsPigeonCodecReaderWriter()) } - /// The core interface that each host language plugin must implement in /// platform_test integration tests. /// @@ -581,7 +601,8 @@ protocol HostIntegrationCoreApi { /// Returns the passed object, to test serialization and deserialization. func echo(_ everything: AllNullableTypes?) throws -> AllNullableTypes? /// Returns the passed object, to test serialization and deserialization. - func echo(_ everything: AllNullableTypesWithoutRecursion?) throws -> AllNullableTypesWithoutRecursion? + func echo(_ everything: AllNullableTypesWithoutRecursion?) throws + -> AllNullableTypesWithoutRecursion? /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. func extractNestedNullableString(from wrapper: AllClassesWrapper) throws -> String? @@ -589,9 +610,13 @@ protocol HostIntegrationCoreApi { /// sending of nested objects. func createNestedObject(with nullableString: String?) throws -> AllClassesWrapper /// Returns passed in arguments of multiple types. - func sendMultipleNullableTypes(aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?) throws -> AllNullableTypes + func sendMultipleNullableTypes( + aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String? + ) throws -> AllNullableTypes /// Returns passed in arguments of multiple types. - func sendMultipleNullableTypesWithoutRecursion(aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?) throws -> AllNullableTypesWithoutRecursion + func sendMultipleNullableTypesWithoutRecursion( + aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String? + ) throws -> AllNullableTypesWithoutRecursion /// Returns passed in int. func echo(_ aNullableInt: Int64?) throws -> Int64? /// Returns passed in double. @@ -625,13 +650,16 @@ protocol HostIntegrationCoreApi { /// Returns the passed string asynchronously. func echoAsync(_ aString: String, completion: @escaping (Result) -> Void) /// Returns the passed in Uint8List asynchronously. - func echoAsync(_ aUint8List: FlutterStandardTypedData, completion: @escaping (Result) -> Void) + func echoAsync( + _ aUint8List: FlutterStandardTypedData, + completion: @escaping (Result) -> Void) /// Returns the passed in generic Object asynchronously. func echoAsync(_ anObject: Any, completion: @escaping (Result) -> Void) /// Returns the passed list, to test asynchronous serialization and deserialization. func echoAsync(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsync(_ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) + func echoAsync( + _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. func echoAsync(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) /// Responds with an error from an async function returning a value. @@ -643,9 +671,13 @@ protocol HostIntegrationCoreApi { /// Returns the passed object, to test async serialization and deserialization. func echoAsync(_ everything: AllTypes, completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echoAsync(_ everything: AllNullableTypes?, completion: @escaping (Result) -> Void) + func echoAsync( + _ everything: AllNullableTypes?, + completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echoAsync(_ everything: AllNullableTypesWithoutRecursion?, completion: @escaping (Result) -> Void) + func echoAsync( + _ everything: AllNullableTypesWithoutRecursion?, + completion: @escaping (Result) -> Void) /// Returns passed in int asynchronously. func echoAsyncNullable(_ anInt: Int64?, completion: @escaping (Result) -> Void) /// Returns passed in double asynchronously. @@ -655,51 +687,81 @@ protocol HostIntegrationCoreApi { /// Returns the passed string asynchronously. func echoAsyncNullable(_ aString: String?, completion: @escaping (Result) -> Void) /// Returns the passed in Uint8List asynchronously. - func echoAsyncNullable(_ aUint8List: FlutterStandardTypedData?, completion: @escaping (Result) -> Void) + func echoAsyncNullable( + _ aUint8List: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void) /// Returns the passed in generic Object asynchronously. func echoAsyncNullable(_ anObject: Any?, completion: @escaping (Result) -> Void) /// Returns the passed list, to test asynchronous serialization and deserialization. func echoAsyncNullable(_ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) /// Returns the passed map, to test asynchronous serialization and deserialization. - func echoAsyncNullable(_ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + func echoAsyncNullable( + _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. func echoAsyncNullable(_ anEnum: AnEnum?, completion: @escaping (Result) -> Void) func callFlutterNoop(completion: @escaping (Result) -> Void) func callFlutterThrowError(completion: @escaping (Result) -> Void) func callFlutterThrowErrorFromVoid(completion: @escaping (Result) -> Void) - func callFlutterEcho(_ everything: AllTypes, completion: @escaping (Result) -> Void) - func callFlutterEcho(_ everything: AllNullableTypes?, completion: @escaping (Result) -> Void) - func callFlutterSendMultipleNullableTypes(aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, completion: @escaping (Result) -> Void) - func callFlutterEcho(_ everything: AllNullableTypesWithoutRecursion?, completion: @escaping (Result) -> Void) - func callFlutterSendMultipleNullableTypesWithoutRecursion(aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, completion: @escaping (Result) -> Void) + func callFlutterEcho( + _ everything: AllTypes, completion: @escaping (Result) -> Void) + func callFlutterEcho( + _ everything: AllNullableTypes?, + completion: @escaping (Result) -> Void) + func callFlutterSendMultipleNullableTypes( + aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, + completion: @escaping (Result) -> Void) + func callFlutterEcho( + _ everything: AllNullableTypesWithoutRecursion?, + completion: @escaping (Result) -> Void) + func callFlutterSendMultipleNullableTypesWithoutRecursion( + aBool aNullableBool: Bool?, anInt aNullableInt: Int64?, aString aNullableString: String?, + completion: @escaping (Result) -> Void) func callFlutterEcho(_ aBool: Bool, completion: @escaping (Result) -> Void) func callFlutterEcho(_ anInt: Int64, completion: @escaping (Result) -> Void) func callFlutterEcho(_ aDouble: Double, completion: @escaping (Result) -> Void) func callFlutterEcho(_ aString: String, completion: @escaping (Result) -> Void) - func callFlutterEcho(_ list: FlutterStandardTypedData, completion: @escaping (Result) -> Void) + func callFlutterEcho( + _ list: FlutterStandardTypedData, + completion: @escaping (Result) -> Void) func callFlutterEcho(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) - func callFlutterEcho(_ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) + func callFlutterEcho( + _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) func callFlutterEcho(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) func callFlutterEchoNullable(_ aBool: Bool?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable(_ anInt: Int64?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable(_ aDouble: Double?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable(_ aString: String?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable(_ list: FlutterStandardTypedData?, completion: @escaping (Result) -> Void) - func callFlutterEchoNullable(_ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) - func callFlutterEchoNullable(_ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) - func callFlutterNullableEcho(_ anEnum: AnEnum?, completion: @escaping (Result) -> Void) - func callFlutterSmallApiEcho(_ aString: String, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable( + _ anInt: Int64?, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable( + _ aDouble: Double?, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable( + _ aString: String?, completion: @escaping (Result) -> Void) + func callFlutterEchoNullable( + _ list: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void) + func callFlutterEchoNullable( + _ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) + func callFlutterEchoNullable( + _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + func callFlutterNullableEcho( + _ anEnum: AnEnum?, completion: @escaping (Result) -> Void) + func callFlutterSmallApiEcho( + _ aString: String, completion: @escaping (Result) -> Void) } /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. class HostIntegrationCoreApiSetup { static var codec: FlutterStandardMessageCodec { CoreTestsPigeonCodec.shared } /// Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binaryMessenger`. - static func setUp(binaryMessenger: FlutterBinaryMessenger, api: HostIntegrationCoreApi?, messageChannelSuffix: String = "") { + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: HostIntegrationCoreApi?, + messageChannelSuffix: String = "" + ) { let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. - let noopChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let noopChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noop\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { noopChannel.setMessageHandler { _, reply in do { @@ -713,7 +775,10 @@ class HostIntegrationCoreApiSetup { noopChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAllTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAllTypesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllTypes\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAllTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -729,7 +794,10 @@ class HostIntegrationCoreApiSetup { echoAllTypesChannel.setMessageHandler(nil) } /// Returns an error, to test error handling. - let throwErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let throwErrorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwError\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwErrorChannel.setMessageHandler { _, reply in do { @@ -743,7 +811,10 @@ class HostIntegrationCoreApiSetup { throwErrorChannel.setMessageHandler(nil) } /// Returns an error from a void function, to test error handling. - let throwErrorFromVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let throwErrorFromVoidChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwErrorFromVoid\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwErrorFromVoidChannel.setMessageHandler { _, reply in do { @@ -757,7 +828,10 @@ class HostIntegrationCoreApiSetup { throwErrorFromVoidChannel.setMessageHandler(nil) } /// Returns a Flutter error, to test error handling. - let throwFlutterErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let throwFlutterErrorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwFlutterError\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwFlutterErrorChannel.setMessageHandler { _, reply in do { @@ -771,7 +845,10 @@ class HostIntegrationCoreApiSetup { throwFlutterErrorChannel.setMessageHandler(nil) } /// Returns passed in int. - let echoIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoInt\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -787,7 +864,10 @@ class HostIntegrationCoreApiSetup { echoIntChannel.setMessageHandler(nil) } /// Returns passed in double. - let echoDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoDouble\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -803,7 +883,10 @@ class HostIntegrationCoreApiSetup { echoDoubleChannel.setMessageHandler(nil) } /// Returns the passed in boolean. - let echoBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoBoolChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoBool\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -819,7 +902,10 @@ class HostIntegrationCoreApiSetup { echoBoolChannel.setMessageHandler(nil) } /// Returns the passed in string. - let echoStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -835,7 +921,10 @@ class HostIntegrationCoreApiSetup { echoStringChannel.setMessageHandler(nil) } /// Returns the passed in Uint8List. - let echoUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoUint8List\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -851,7 +940,10 @@ class HostIntegrationCoreApiSetup { echoUint8ListChannel.setMessageHandler(nil) } /// Returns the passed in generic Object. - let echoObjectChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoObjectChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoObject\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoObjectChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -867,7 +959,10 @@ class HostIntegrationCoreApiSetup { echoObjectChannel.setMessageHandler(nil) } /// Returns the passed list, to test serialization and deserialization. - let echoListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -883,7 +978,10 @@ class HostIntegrationCoreApiSetup { echoListChannel.setMessageHandler(nil) } /// Returns the passed map, to test serialization and deserialization. - let echoMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -899,7 +997,10 @@ class HostIntegrationCoreApiSetup { echoMapChannel.setMessageHandler(nil) } /// Returns the passed map to test nested class serialization and deserialization. - let echoClassWrapperChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoClassWrapperChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoClassWrapperChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -915,7 +1016,10 @@ class HostIntegrationCoreApiSetup { echoClassWrapperChannel.setMessageHandler(nil) } /// Returns the passed enum to test serialization and deserialization. - let echoEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoEnum\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -931,7 +1035,10 @@ class HostIntegrationCoreApiSetup { echoEnumChannel.setMessageHandler(nil) } /// Returns the default string. - let echoNamedDefaultStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNamedDefaultStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedDefaultString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNamedDefaultStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -947,7 +1054,10 @@ class HostIntegrationCoreApiSetup { echoNamedDefaultStringChannel.setMessageHandler(nil) } /// Returns passed in double. - let echoOptionalDefaultDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoOptionalDefaultDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalDefaultDouble\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoOptionalDefaultDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -963,7 +1073,10 @@ class HostIntegrationCoreApiSetup { echoOptionalDefaultDoubleChannel.setMessageHandler(nil) } /// Returns passed in int. - let echoRequiredIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoRequiredIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoRequiredInt\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoRequiredIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -979,7 +1092,10 @@ class HostIntegrationCoreApiSetup { echoRequiredIntChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAllNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAllNullableTypesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypes\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAllNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -995,7 +1111,10 @@ class HostIntegrationCoreApiSetup { echoAllNullableTypesChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAllNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1012,7 +1131,10 @@ class HostIntegrationCoreApiSetup { } /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. - let extractNestedNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let extractNestedNullableStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.extractNestedNullableString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { extractNestedNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1029,7 +1151,10 @@ class HostIntegrationCoreApiSetup { } /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. - let createNestedNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let createNestedNullableStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.createNestedNullableString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { createNestedNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1045,15 +1170,21 @@ class HostIntegrationCoreApiSetup { createNestedNullableStringChannel.setMessageHandler(nil) } /// Returns passed in arguments of multiple types. - let sendMultipleNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let sendMultipleNullableTypesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypes\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { sendMultipleNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = isNullish(args[1]) ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = + isNullish(args[1]) + ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) let aNullableStringArg: String? = nilOrValue(args[2]) do { - let result = try api.sendMultipleNullableTypes(aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) + let result = try api.sendMultipleNullableTypes( + aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1063,15 +1194,21 @@ class HostIntegrationCoreApiSetup { sendMultipleNullableTypesChannel.setMessageHandler(nil) } /// Returns passed in arguments of multiple types. - let sendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let sendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { sendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = isNullish(args[1]) ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = + isNullish(args[1]) + ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) let aNullableStringArg: String? = nilOrValue(args[2]) do { - let result = try api.sendMultipleNullableTypesWithoutRecursion(aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) + let result = try api.sendMultipleNullableTypesWithoutRecursion( + aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1081,11 +1218,16 @@ class HostIntegrationCoreApiSetup { sendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler(nil) } /// Returns passed in int. - let echoNullableIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableInt\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aNullableIntArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let aNullableIntArg: Int64? = + isNullish(args[0]) + ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) do { let result = try api.echo(aNullableIntArg) reply(wrapResult(result)) @@ -1097,7 +1239,10 @@ class HostIntegrationCoreApiSetup { echoNullableIntChannel.setMessageHandler(nil) } /// Returns passed in double. - let echoNullableDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableDouble\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1113,7 +1258,10 @@ class HostIntegrationCoreApiSetup { echoNullableDoubleChannel.setMessageHandler(nil) } /// Returns the passed in boolean. - let echoNullableBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableBoolChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableBool\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1129,7 +1277,10 @@ class HostIntegrationCoreApiSetup { echoNullableBoolChannel.setMessageHandler(nil) } /// Returns the passed in string. - let echoNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1145,7 +1296,10 @@ class HostIntegrationCoreApiSetup { echoNullableStringChannel.setMessageHandler(nil) } /// Returns the passed in Uint8List. - let echoNullableUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableUint8List\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1161,7 +1315,10 @@ class HostIntegrationCoreApiSetup { echoNullableUint8ListChannel.setMessageHandler(nil) } /// Returns the passed in generic Object. - let echoNullableObjectChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableObjectChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableObject\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableObjectChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1177,7 +1334,10 @@ class HostIntegrationCoreApiSetup { echoNullableObjectChannel.setMessageHandler(nil) } /// Returns the passed list, to test serialization and deserialization. - let echoNullableListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1193,7 +1353,10 @@ class HostIntegrationCoreApiSetup { echoNullableListChannel.setMessageHandler(nil) } /// Returns the passed map, to test serialization and deserialization. - let echoNullableMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1208,7 +1371,10 @@ class HostIntegrationCoreApiSetup { } else { echoNullableMapChannel.setMessageHandler(nil) } - let echoNullableEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNullableEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNullableEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1224,11 +1390,16 @@ class HostIntegrationCoreApiSetup { echoNullableEnumChannel.setMessageHandler(nil) } /// Returns passed in int. - let echoOptionalNullableIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoOptionalNullableIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoOptionalNullableInt\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoOptionalNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aNullableIntArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let aNullableIntArg: Int64? = + isNullish(args[0]) + ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) do { let result = try api.echoOptional(aNullableIntArg) reply(wrapResult(result)) @@ -1240,7 +1411,10 @@ class HostIntegrationCoreApiSetup { echoOptionalNullableIntChannel.setMessageHandler(nil) } /// Returns the passed in string. - let echoNamedNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoNamedNullableStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNamedNullableString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoNamedNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1257,7 +1431,10 @@ class HostIntegrationCoreApiSetup { } /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. - let noopAsyncChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let noopAsyncChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.noopAsync\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { noopAsyncChannel.setMessageHandler { _, reply in api.noopAsync { result in @@ -1273,7 +1450,10 @@ class HostIntegrationCoreApiSetup { noopAsyncChannel.setMessageHandler(nil) } /// Returns passed in int asynchronously. - let echoAsyncIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncInt\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1291,7 +1471,10 @@ class HostIntegrationCoreApiSetup { echoAsyncIntChannel.setMessageHandler(nil) } /// Returns passed in double asynchronously. - let echoAsyncDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncDouble\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1309,7 +1492,10 @@ class HostIntegrationCoreApiSetup { echoAsyncDoubleChannel.setMessageHandler(nil) } /// Returns the passed in boolean asynchronously. - let echoAsyncBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncBoolChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncBool\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1327,7 +1513,10 @@ class HostIntegrationCoreApiSetup { echoAsyncBoolChannel.setMessageHandler(nil) } /// Returns the passed string asynchronously. - let echoAsyncStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1345,7 +1534,10 @@ class HostIntegrationCoreApiSetup { echoAsyncStringChannel.setMessageHandler(nil) } /// Returns the passed in Uint8List asynchronously. - let echoAsyncUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncUint8List\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1363,7 +1555,10 @@ class HostIntegrationCoreApiSetup { echoAsyncUint8ListChannel.setMessageHandler(nil) } /// Returns the passed in generic Object asynchronously. - let echoAsyncObjectChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncObjectChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncObject\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncObjectChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1381,7 +1576,10 @@ class HostIntegrationCoreApiSetup { echoAsyncObjectChannel.setMessageHandler(nil) } /// Returns the passed list, to test asynchronous serialization and deserialization. - let echoAsyncListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1399,7 +1597,10 @@ class HostIntegrationCoreApiSetup { echoAsyncListChannel.setMessageHandler(nil) } /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1417,7 +1618,10 @@ class HostIntegrationCoreApiSetup { echoAsyncMapChannel.setMessageHandler(nil) } /// Returns the passed enum, to test asynchronous serialization and deserialization. - let echoAsyncEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncEnum\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1435,7 +1639,10 @@ class HostIntegrationCoreApiSetup { echoAsyncEnumChannel.setMessageHandler(nil) } /// Responds with an error from an async function returning a value. - let throwAsyncErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let throwAsyncErrorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncError\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwAsyncErrorChannel.setMessageHandler { _, reply in api.throwAsyncError { result in @@ -1451,7 +1658,10 @@ class HostIntegrationCoreApiSetup { throwAsyncErrorChannel.setMessageHandler(nil) } /// Responds with an error from an async void function. - let throwAsyncErrorFromVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let throwAsyncErrorFromVoidChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncErrorFromVoid\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwAsyncErrorFromVoidChannel.setMessageHandler { _, reply in api.throwAsyncErrorFromVoid { result in @@ -1467,7 +1677,10 @@ class HostIntegrationCoreApiSetup { throwAsyncErrorFromVoidChannel.setMessageHandler(nil) } /// Responds with a Flutter error from an async function returning a value. - let throwAsyncFlutterErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let throwAsyncFlutterErrorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.throwAsyncFlutterError\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { throwAsyncFlutterErrorChannel.setMessageHandler { _, reply in api.throwAsyncFlutterError { result in @@ -1483,7 +1696,10 @@ class HostIntegrationCoreApiSetup { throwAsyncFlutterErrorChannel.setMessageHandler(nil) } /// Returns the passed object, to test async serialization and deserialization. - let echoAsyncAllTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncAllTypesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncAllTypes\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncAllTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1501,7 +1717,10 @@ class HostIntegrationCoreApiSetup { echoAsyncAllTypesChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAsyncNullableAllNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableAllNullableTypesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableAllNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1519,7 +1738,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableAllNullableTypesChannel.setMessageHandler(nil) } /// Returns the passed object, to test serialization and deserialization. - let echoAsyncNullableAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypesWithoutRecursion\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableAllNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1537,11 +1759,16 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableAllNullableTypesWithoutRecursionChannel.setMessageHandler(nil) } /// Returns passed in int asynchronously. - let echoAsyncNullableIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableInt\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let anIntArg: Int64? = + isNullish(args[0]) + ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) api.echoAsyncNullable(anIntArg) { result in switch result { case .success(let res): @@ -1555,7 +1782,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableIntChannel.setMessageHandler(nil) } /// Returns passed in double asynchronously. - let echoAsyncNullableDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableDouble\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1573,7 +1803,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableDoubleChannel.setMessageHandler(nil) } /// Returns the passed in boolean asynchronously. - let echoAsyncNullableBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableBoolChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableBool\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1591,7 +1824,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableBoolChannel.setMessageHandler(nil) } /// Returns the passed string asynchronously. - let echoAsyncNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1609,7 +1845,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableStringChannel.setMessageHandler(nil) } /// Returns the passed in Uint8List asynchronously. - let echoAsyncNullableUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableUint8List\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1627,7 +1866,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableUint8ListChannel.setMessageHandler(nil) } /// Returns the passed in generic Object asynchronously. - let echoAsyncNullableObjectChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableObjectChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableObject\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableObjectChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1645,7 +1887,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableObjectChannel.setMessageHandler(nil) } /// Returns the passed list, to test asynchronous serialization and deserialization. - let echoAsyncNullableListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1663,7 +1908,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableListChannel.setMessageHandler(nil) } /// Returns the passed map, to test asynchronous serialization and deserialization. - let echoAsyncNullableMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1681,7 +1929,10 @@ class HostIntegrationCoreApiSetup { echoAsyncNullableMapChannel.setMessageHandler(nil) } /// Returns the passed enum, to test asynchronous serialization and deserialization. - let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableEnum\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoAsyncNullableEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1698,7 +1949,10 @@ class HostIntegrationCoreApiSetup { } else { echoAsyncNullableEnumChannel.setMessageHandler(nil) } - let callFlutterNoopChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterNoopChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterNoop\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterNoopChannel.setMessageHandler { _, reply in api.callFlutterNoop { result in @@ -1713,7 +1967,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterNoopChannel.setMessageHandler(nil) } - let callFlutterThrowErrorChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterThrowErrorChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowError\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterThrowErrorChannel.setMessageHandler { _, reply in api.callFlutterThrowError { result in @@ -1728,7 +1985,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterThrowErrorChannel.setMessageHandler(nil) } - let callFlutterThrowErrorFromVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterThrowErrorFromVoidChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterThrowErrorFromVoidChannel.setMessageHandler { _, reply in api.callFlutterThrowErrorFromVoid { result in @@ -1743,7 +2003,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterThrowErrorFromVoidChannel.setMessageHandler(nil) } - let callFlutterEchoAllTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoAllTypesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllTypes\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoAllTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1760,7 +2023,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoAllTypesChannel.setMessageHandler(nil) } - let callFlutterEchoAllNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoAllNullableTypesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypes\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoAllNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1777,14 +2043,21 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoAllNullableTypesChannel.setMessageHandler(nil) } - let callFlutterSendMultipleNullableTypesChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterSendMultipleNullableTypesChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterSendMultipleNullableTypesChannel.setMessageHandler { message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = isNullish(args[1]) ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = + isNullish(args[1]) + ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) let aNullableStringArg: String? = nilOrValue(args[2]) - api.callFlutterSendMultipleNullableTypes(aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) { result in + api.callFlutterSendMultipleNullableTypes( + aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg + ) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -1796,7 +2069,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterSendMultipleNullableTypesChannel.setMessageHandler(nil) } - let callFlutterEchoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoAllNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoAllNullableTypesWithoutRecursion\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoAllNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1813,14 +2089,22 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoAllNullableTypesWithoutRecursionChannel.setMessageHandler(nil) } - let callFlutterSendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterSendMultipleNullableTypesWithoutRecursionChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypesWithoutRecursion\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { - callFlutterSendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler { message, reply in + callFlutterSendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler { + message, reply in let args = message as! [Any?] let aNullableBoolArg: Bool? = nilOrValue(args[0]) - let aNullableIntArg: Int64? = isNullish(args[1]) ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) + let aNullableIntArg: Int64? = + isNullish(args[1]) + ? nil : (args[1] is Int64? ? args[1] as! Int64? : Int64(args[1] as! Int32)) let aNullableStringArg: String? = nilOrValue(args[2]) - api.callFlutterSendMultipleNullableTypesWithoutRecursion(aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg) { result in + api.callFlutterSendMultipleNullableTypesWithoutRecursion( + aBool: aNullableBoolArg, anInt: aNullableIntArg, aString: aNullableStringArg + ) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -1832,7 +2116,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterSendMultipleNullableTypesWithoutRecursionChannel.setMessageHandler(nil) } - let callFlutterEchoBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoBoolChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoBool\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1849,7 +2136,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoBoolChannel.setMessageHandler(nil) } - let callFlutterEchoIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoInt\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1866,7 +2156,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoIntChannel.setMessageHandler(nil) } - let callFlutterEchoDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoDouble\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1883,7 +2176,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoDoubleChannel.setMessageHandler(nil) } - let callFlutterEchoStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1900,7 +2196,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoStringChannel.setMessageHandler(nil) } - let callFlutterEchoUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoUint8List\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1917,7 +2216,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoUint8ListChannel.setMessageHandler(nil) } - let callFlutterEchoListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1934,7 +2236,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoListChannel.setMessageHandler(nil) } - let callFlutterEchoMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1951,7 +2256,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoMapChannel.setMessageHandler(nil) } - let callFlutterEchoEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1968,7 +2276,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoEnumChannel.setMessageHandler(nil) } - let callFlutterEchoNullableBoolChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableBoolChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableBool\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableBoolChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -1985,11 +2296,16 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableBoolChannel.setMessageHandler(nil) } - let callFlutterEchoNullableIntChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableIntChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableInt\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableIntChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let anIntArg: Int64? = isNullish(args[0]) ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) + let anIntArg: Int64? = + isNullish(args[0]) + ? nil : (args[0] is Int64? ? args[0] as! Int64? : Int64(args[0] as! Int32)) api.callFlutterEchoNullable(anIntArg) { result in switch result { case .success(let res): @@ -2002,7 +2318,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableIntChannel.setMessageHandler(nil) } - let callFlutterEchoNullableDoubleChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableDoubleChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableDouble\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableDoubleChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2019,7 +2338,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableDoubleChannel.setMessageHandler(nil) } - let callFlutterEchoNullableStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2036,7 +2358,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableStringChannel.setMessageHandler(nil) } - let callFlutterEchoNullableUint8ListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableUint8ListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableUint8List\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableUint8ListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2053,7 +2378,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableUint8ListChannel.setMessageHandler(nil) } - let callFlutterEchoNullableListChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableListChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableList\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableListChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2070,7 +2398,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableListChannel.setMessageHandler(nil) } - let callFlutterEchoNullableMapChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2087,7 +2418,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableMapChannel.setMessageHandler(nil) } - let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterEchoNullableEnumChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2104,7 +2438,10 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableEnumChannel.setMessageHandler(nil) } - let callFlutterSmallApiEchoStringChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let callFlutterSmallApiEchoStringChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterSmallApiEchoString\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { callFlutterSmallApiEchoStringChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2136,19 +2473,30 @@ protocol FlutterIntegrationCoreApiProtocol { /// Responds with an error from an async void function. func throwErrorFromVoid(completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echo(_ everythingArg: AllTypes, completion: @escaping (Result) -> Void) + func echo( + _ everythingArg: AllTypes, completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echoNullable(_ everythingArg: AllNullableTypes?, completion: @escaping (Result) -> Void) + func echoNullable( + _ everythingArg: AllNullableTypes?, + completion: @escaping (Result) -> Void) /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypes(aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, completion: @escaping (Result) -> Void) + func sendMultipleNullableTypes( + aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, + aString aNullableStringArg: String?, + completion: @escaping (Result) -> Void) /// Returns the passed object, to test serialization and deserialization. - func echoNullable(_ everythingArg: AllNullableTypesWithoutRecursion?, completion: @escaping (Result) -> Void) + func echoNullable( + _ everythingArg: AllNullableTypesWithoutRecursion?, + completion: @escaping (Result) -> Void) /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypesWithoutRecursion(aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, completion: @escaping (Result) -> Void) + func sendMultipleNullableTypesWithoutRecursion( + aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, + aString aNullableStringArg: String?, + completion: @escaping (Result) -> Void) /// Returns the passed boolean, to test serialization and deserialization. func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) /// Returns the passed int, to test serialization and deserialization. @@ -2158,11 +2506,15 @@ protocol FlutterIntegrationCoreApiProtocol { /// Returns the passed string, to test serialization and deserialization. func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) /// Returns the passed byte list, to test serialization and deserialization. - func echo(_ listArg: FlutterStandardTypedData, completion: @escaping (Result) -> Void) + func echo( + _ listArg: FlutterStandardTypedData, + completion: @escaping (Result) -> Void) /// Returns the passed list, to test serialization and deserialization. func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) /// Returns the passed map, to test serialization and deserialization. - func echo(_ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void) + func echo( + _ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void + ) /// Returns the passed enum to test serialization and deserialization. func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) /// Returns the passed boolean, to test serialization and deserialization. @@ -2170,17 +2522,25 @@ protocol FlutterIntegrationCoreApiProtocol { /// Returns the passed int, to test serialization and deserialization. func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) /// Returns the passed double, to test serialization and deserialization. - func echoNullable(_ aDoubleArg: Double?, completion: @escaping (Result) -> Void) + func echoNullable( + _ aDoubleArg: Double?, completion: @escaping (Result) -> Void) /// Returns the passed string, to test serialization and deserialization. - func echoNullable(_ aStringArg: String?, completion: @escaping (Result) -> Void) + func echoNullable( + _ aStringArg: String?, completion: @escaping (Result) -> Void) /// Returns the passed byte list, to test serialization and deserialization. - func echoNullable(_ listArg: FlutterStandardTypedData?, completion: @escaping (Result) -> Void) + func echoNullable( + _ listArg: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void) /// Returns the passed list, to test serialization and deserialization. - func echoNullable(_ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) + func echoNullable( + _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) /// Returns the passed map, to test serialization and deserialization. - func echoNullable(_ aMapArg: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void) + func echoNullable( + _ aMapArg: [String?: Any?]?, + completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void) /// Returns the passed enum to test serialization and deserialization. - func echoNullable(_ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) + func echoNullable( + _ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. func noopAsync(completion: @escaping (Result) -> Void) @@ -2200,8 +2560,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. func noop(completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noop\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2219,8 +2581,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Responds with an error from an async function returning a value. func throwError(completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwError\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2239,8 +2603,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Responds with an error from an async void function. func throwErrorFromVoid(completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.throwErrorFromVoid\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2257,9 +2623,13 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed object, to test serialization and deserialization. - func echo(_ everythingArg: AllTypes, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo( + _ everythingArg: AllTypes, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([everythingArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2271,7 +2641,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! AllTypes completion(.success(result)) @@ -2279,9 +2653,14 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed object, to test serialization and deserialization. - func echoNullable(_ everythingArg: AllNullableTypes?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable( + _ everythingArg: AllNullableTypes?, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([everythingArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2301,10 +2680,17 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypes(aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { response in + func sendMultipleNullableTypes( + aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, + aString aNullableStringArg: String?, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypes\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { + response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2315,7 +2701,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! AllNullableTypes completion(.success(result)) @@ -2323,9 +2713,14 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed object, to test serialization and deserialization. - func echoNullable(_ everythingArg: AllNullableTypesWithoutRecursion?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable( + _ everythingArg: AllNullableTypesWithoutRecursion?, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAllNullableTypesWithoutRecursion\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([everythingArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2345,10 +2740,17 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { /// Returns passed in arguments of multiple types. /// /// Tests multiple-arity FlutterApi handling. - func sendMultipleNullableTypesWithoutRecursion(aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, aString aNullableStringArg: String?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { response in + func sendMultipleNullableTypesWithoutRecursion( + aBool aNullableBoolArg: Bool?, anInt aNullableIntArg: Int64?, + aString aNullableStringArg: String?, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.sendMultipleNullableTypesWithoutRecursion\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aNullableBoolArg, aNullableIntArg, aNullableStringArg] as [Any?]) { + response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -2359,7 +2761,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! AllNullableTypesWithoutRecursion completion(.success(result)) @@ -2368,8 +2774,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed boolean, to test serialization and deserialization. func echo(_ aBoolArg: Bool, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoBool\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aBoolArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2381,7 +2789,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! Bool completion(.success(result)) @@ -2390,8 +2802,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed int, to test serialization and deserialization. func echo(_ anIntArg: Int64, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoInt\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anIntArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2403,17 +2817,24 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] is Int64 ? listResponse[0] as! Int64 : Int64(listResponse[0] as! Int32) + let result = + listResponse[0] is Int64 ? listResponse[0] as! Int64 : Int64(listResponse[0] as! Int32) completion(.success(result)) } } } /// Returns the passed double, to test serialization and deserialization. func echo(_ aDoubleArg: Double, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoDouble\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aDoubleArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2425,7 +2846,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! Double completion(.success(result)) @@ -2434,8 +2859,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed string, to test serialization and deserialization. func echo(_ aStringArg: String, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2447,7 +2874,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! String completion(.success(result)) @@ -2455,9 +2886,14 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed byte list, to test serialization and deserialization. - func echo(_ listArg: FlutterStandardTypedData, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo( + _ listArg: FlutterStandardTypedData, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoUint8List\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2469,7 +2905,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! FlutterStandardTypedData completion(.success(result)) @@ -2478,8 +2918,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed list, to test serialization and deserialization. func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2491,7 +2933,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! [Any?] completion(.success(result)) @@ -2499,9 +2945,13 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed map, to test serialization and deserialization. - func echo(_ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo( + _ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2513,7 +2963,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! [String?: Any?] completion(.success(result)) @@ -2522,8 +2976,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed enum to test serialization and deserialization. func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoEnum\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anEnumArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2535,7 +2991,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! AnEnum completion(.success(result)) @@ -2544,8 +3004,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed boolean, to test serialization and deserialization. func echoNullable(_ aBoolArg: Bool?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableBool\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aBoolArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2563,9 +3025,12 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed int, to test serialization and deserialization. - func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable(_ anIntArg: Int64?, completion: @escaping (Result) -> Void) + { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableInt\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anIntArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2577,15 +3042,23 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: Int64? = isNullish(listResponse[0]) ? nil : (listResponse[0] is Int64? ? listResponse[0] as! Int64? : Int64(listResponse[0] as! Int32)) + let result: Int64? = + isNullish(listResponse[0]) + ? nil + : (listResponse[0] is Int64? + ? listResponse[0] as! Int64? : Int64(listResponse[0] as! Int32)) completion(.success(result)) } } } /// Returns the passed double, to test serialization and deserialization. - func echoNullable(_ aDoubleArg: Double?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable( + _ aDoubleArg: Double?, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableDouble\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aDoubleArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2603,9 +3076,13 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed string, to test serialization and deserialization. - func echoNullable(_ aStringArg: String?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable( + _ aStringArg: String?, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2623,9 +3100,14 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed byte list, to test serialization and deserialization. - func echoNullable(_ listArg: FlutterStandardTypedData?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable( + _ listArg: FlutterStandardTypedData?, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableUint8List\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2643,9 +3125,13 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed list, to test serialization and deserialization. - func echoNullable(_ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable( + _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([listArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2663,9 +3149,14 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed map, to test serialization and deserialization. - func echoNullable(_ aMapArg: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable( + _ aMapArg: [String?: Any?]?, + completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2683,9 +3174,13 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed enum to test serialization and deserialization. - func echoNullable(_ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoNullable( + _ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableEnum\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([anEnumArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2705,8 +3200,10 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. func noopAsync(completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.noopAsync\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage(nil) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2723,9 +3220,12 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } } /// Returns the passed in generic Object asynchronously. - func echoAsync(_ aStringArg: String, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echoAsync(_ aStringArg: String, completion: @escaping (Result) -> Void) + { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoAsyncString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2737,7 +3237,11 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! String completion(.success(result)) @@ -2756,9 +3260,13 @@ protocol HostTrivialApi { class HostTrivialApiSetup { static var codec: FlutterStandardMessageCodec { CoreTestsPigeonCodec.shared } /// Sets up an instance of `HostTrivialApi` to handle messages through the `binaryMessenger`. - static func setUp(binaryMessenger: FlutterBinaryMessenger, api: HostTrivialApi?, messageChannelSuffix: String = "") { + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: HostTrivialApi?, messageChannelSuffix: String = "" + ) { let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" - let noopChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let noopChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.HostTrivialApi.noop\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { noopChannel.setMessageHandler { _, reply in do { @@ -2785,9 +3293,13 @@ protocol HostSmallApi { class HostSmallApiSetup { static var codec: FlutterStandardMessageCodec { CoreTestsPigeonCodec.shared } /// Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. - static func setUp(binaryMessenger: FlutterBinaryMessenger, api: HostSmallApi?, messageChannelSuffix: String = "") { + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: HostSmallApi?, messageChannelSuffix: String = "" + ) { let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" - let echoChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let echoChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.echo\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { echoChannel.setMessageHandler { message, reply in let args = message as! [Any?] @@ -2804,7 +3316,9 @@ class HostSmallApiSetup { } else { echoChannel.setMessageHandler(nil) } - let voidVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) + let voidVoidChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.pigeon_integration_tests.HostSmallApi.voidVoid\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) if let api = api { voidVoidChannel.setMessageHandler { _, reply in api.voidVoid { result in @@ -2838,9 +3352,12 @@ class FlutterSmallApi: FlutterSmallApiProtocol { var codec: CoreTestsPigeonCodec { return CoreTestsPigeonCodec.shared } - func echo(_ msgArg: TestMessage, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo(_ msgArg: TestMessage, completion: @escaping (Result) -> Void) + { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoWrappedList\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([msgArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2852,16 +3369,23 @@ class FlutterSmallApi: FlutterSmallApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! TestMessage completion(.success(result)) } } } - func echo(string aStringArg: String, completion: @escaping (Result) -> Void) { - let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString\(messageChannelSuffix)" - let channel = FlutterBasicMessageChannel(name: channelName, binaryMessenger: binaryMessenger, codec: codec) + func echo(string aStringArg: String, completion: @escaping (Result) -> Void) + { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterSmallApi.echoString\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) channel.sendMessage([aStringArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) @@ -2873,7 +3397,11 @@ class FlutterSmallApi: FlutterSmallApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else if listResponse[0] == nil { - completion(.failure(PigeonError(code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) } else { let result = listResponse[0] as! String completion(.success(result)) From abe2c0dfbe44dc365189bbd4ef861e2220c2564c Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 29 Jul 2024 14:03:25 -0400 Subject: [PATCH 54/77] check supported types first --- packages/pigeon/lib/kotlin_generator.dart | 28 ++++++++++++++++++- .../example/test_plugin/ProxyApiTests.gen.kt | 21 +++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 18dfef5cd85f..659d0f9fcfe3 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -722,6 +722,32 @@ class KotlinGenerator extends StructuredGenerator { 'override fun writeValue(stream: ByteArrayOutputStream, value: Any?) {', '}', () { + final List nonProxyApiTypes = [ + 'Boolean', + 'ByteArray', + 'Double', + 'DoubleArray', + 'FloatArray', + 'IntArray', + 'List<*>', + 'Long', + 'LongArray', + 'Map<*, *>', + 'String', + ...root.enums.map((Enum anEnum) => anEnum.name), + ]; + final String isSupportedExpression = nonProxyApiTypes + .map((String kotlinType) => 'value is $kotlinType') + .followedBy(['value == null']).join(' || '); + // Non ProxyApi types are checked first to handle the scenario + // where a client wraps the `Object` class which all the + // classes above extend. + indent.writeScoped('if ($isSupportedExpression) {', '}', () { + indent.writeln('super.writeValue(stream, value)'); + indent.writeln('return'); + }); + indent.newln(); + enumerate( sortedApis, (int index, AstProxyApi api) { @@ -751,7 +777,7 @@ class KotlinGenerator extends StructuredGenerator { stream.write($proxyApiCodecInstanceManagerKey) writeValue(stream, registrar.instanceManager.getIdentifierForStrongReference(value)) } - else -> super.writeValue(stream, value) + else -> throw IllegalArgumentException("Unsupported value: '\$value' of type '\${value.javaClass.name}'") }''', trimIndentation: true, ); diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index d460c004861d..6ee2acd89e51 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -428,6 +428,23 @@ private class ProxyApiTestsPigeonProxyApiBaseCodec( } override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + if (value is Boolean || + value is ByteArray || + value is Double || + value is DoubleArray || + value is FloatArray || + value is IntArray || + value is List<*> || + value is Long || + value is LongArray || + value is Map<*, *> || + value is String || + value is ProxyApiTestEnum || + value == null) { + super.writeValue(stream, value) + return + } + if (value is ProxyApiTestClass) { registrar.getPigeonApiProxyApiTestClass().pigeon_newInstance(value) {} } else if (value is com.example.test_plugin.ProxyApiSuperClass) { @@ -443,7 +460,9 @@ private class ProxyApiTestsPigeonProxyApiBaseCodec( stream.write(128) writeValue(stream, registrar.instanceManager.getIdentifierForStrongReference(value)) } - else -> super.writeValue(stream, value) + else -> + throw IllegalArgumentException( + "Unsupported value: '$value' of type '${value.javaClass.name}'") } } } From 6d5b581c55c72fee8fc6328752c2d465cb0e0840 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:58:04 -0400 Subject: [PATCH 55/77] maybe fix kotlin --- packages/pigeon/lib/kotlin_generator.dart | 1 + .../src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 659d0f9fcfe3..b67769293b07 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -728,6 +728,7 @@ class KotlinGenerator extends StructuredGenerator { 'Double', 'DoubleArray', 'FloatArray', + 'Int', 'IntArray', 'List<*>', 'Long', diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 6ee2acd89e51..26af3f44b866 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -433,6 +433,7 @@ private class ProxyApiTestsPigeonProxyApiBaseCodec( value is Double || value is DoubleArray || value is FloatArray || + value is Int || value is IntArray || value is List<*> || value is Long || From 9e59393c457b3be660d28263205c0fed476ac0cd Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 30 Jul 2024 21:46:39 -0400 Subject: [PATCH 56/77] add ignoreCallsToDart --- packages/pigeon/lib/kotlin_generator.dart | 34 ++++ .../example/test_plugin/ProxyApiTests.gen.kt | 182 ++++++++++++++++++ 2 files changed, 216 insertions(+) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index b67769293b07..79847d0f5e5f 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -1245,6 +1245,12 @@ class KotlinGenerator extends StructuredGenerator { 'abstract class $registrarName(val binaryMessenger: BinaryMessenger) {', '}', () { + addDocumentationComments( + indent, + [' Whether APIs should ignore calling to Dart.'], + _docCommentSpec, + ); + indent.writeln('public var ignoreCallsToDart = false'); indent.format( ''' val instanceManager: $instanceManagerName @@ -1701,6 +1707,20 @@ class KotlinGenerator extends StructuredGenerator { required String channelName, required String errorClassName, }) { + indent.writeScoped( + 'if (pigeonRegistrar.ignoreCallsToDart) {', + '}', + () { + indent.format( + ''' + callback( + Result.failure( + $errorClassName("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return''', + trimIndentation: true, + ); + }, + ); indent.writeScoped( 'if (pigeonRegistrar.instanceManager.containsInstance(${classMemberNamePrefix}instanceArg)) {', '}', @@ -1793,6 +1813,20 @@ class KotlinGenerator extends StructuredGenerator { required String channelName, required String errorClassName, }) { + indent.writeScoped( + 'if (pigeonRegistrar.ignoreCallsToDart) {', + '}', + () { + indent.format( + ''' + callback( + Result.failure( + $errorClassName("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return''', + trimIndentation: true, + ); + }, + ); indent .writeln('val binaryMessenger = pigeonRegistrar.binaryMessenger'); indent.writeln('val codec = pigeonRegistrar.codec'); diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 26af3f44b866..1c40c0d1018a 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -344,6 +344,8 @@ private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryM * by any implementation. */ abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { + /** Whether APIs should ignore calling to Dart. */ + public var ignoreCallsToDart = false val instanceManager: ProxyApiTestsPigeonInstanceManager private var _codec: StandardMessageCodec? = null val codec: StandardMessageCodec @@ -3008,6 +3010,12 @@ abstract class PigeonApiProxyApiTestClass( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ProxyApiTestClass and attaches it to [pigeon_instanceArg]. */ fun pigeon_newInstance(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { Result.success(Unit) return @@ -3074,6 +3082,12 @@ abstract class PigeonApiProxyApiTestClass( /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ fun flutterNoop(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoop" @@ -3095,6 +3109,12 @@ abstract class PigeonApiProxyApiTestClass( /** Responds with an error from an async function returning a value. */ fun flutterThrowError(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3121,6 +3141,12 @@ abstract class PigeonApiProxyApiTestClass( pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3147,6 +3173,12 @@ abstract class PigeonApiProxyApiTestClass( aBoolArg: Boolean, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3181,6 +3213,12 @@ abstract class PigeonApiProxyApiTestClass( anIntArg: Long, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoInt" @@ -3214,6 +3252,12 @@ abstract class PigeonApiProxyApiTestClass( aDoubleArg: Double, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3248,6 +3292,12 @@ abstract class PigeonApiProxyApiTestClass( aStringArg: String, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3282,6 +3332,12 @@ abstract class PigeonApiProxyApiTestClass( aListArg: ByteArray, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3316,6 +3372,12 @@ abstract class PigeonApiProxyApiTestClass( aListArg: List, callback: (Result>) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3350,6 +3412,12 @@ abstract class PigeonApiProxyApiTestClass( aListArg: List, callback: (Result>) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3384,6 +3452,12 @@ abstract class PigeonApiProxyApiTestClass( aMapArg: Map, callback: (Result>) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoMap" @@ -3417,6 +3491,12 @@ abstract class PigeonApiProxyApiTestClass( aMapArg: Map, callback: (Result>) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3451,6 +3531,12 @@ abstract class PigeonApiProxyApiTestClass( anEnumArg: ProxyApiTestEnum, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3485,6 +3571,12 @@ abstract class PigeonApiProxyApiTestClass( aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3519,6 +3611,12 @@ abstract class PigeonApiProxyApiTestClass( aBoolArg: Boolean?, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3546,6 +3644,12 @@ abstract class PigeonApiProxyApiTestClass( anIntArg: Long?, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3573,6 +3677,12 @@ abstract class PigeonApiProxyApiTestClass( aDoubleArg: Double?, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3600,6 +3710,12 @@ abstract class PigeonApiProxyApiTestClass( aStringArg: String?, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3627,6 +3743,12 @@ abstract class PigeonApiProxyApiTestClass( aListArg: ByteArray?, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3654,6 +3776,12 @@ abstract class PigeonApiProxyApiTestClass( aListArg: List?, callback: (Result?>) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3681,6 +3809,12 @@ abstract class PigeonApiProxyApiTestClass( aMapArg: Map?, callback: (Result?>) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3708,6 +3842,12 @@ abstract class PigeonApiProxyApiTestClass( anEnumArg: ProxyApiTestEnum?, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3735,6 +3875,12 @@ abstract class PigeonApiProxyApiTestClass( aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass?, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3761,6 +3907,12 @@ abstract class PigeonApiProxyApiTestClass( * calling. */ fun flutterNoopAsync(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3787,6 +3939,12 @@ abstract class PigeonApiProxyApiTestClass( aStringArg: String, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -3897,6 +4055,12 @@ abstract class PigeonApiProxyApiSuperClass( pigeon_instanceArg: com.example.test_plugin.ProxyApiSuperClass, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { Result.success(Unit) return @@ -3931,6 +4095,12 @@ open class PigeonApiProxyApiInterface( @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ProxyApiInterface and attaches it to [pigeon_instanceArg]. */ fun pigeon_newInstance(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { Result.success(Unit) return @@ -3958,6 +4128,12 @@ open class PigeonApiProxyApiInterface( } fun anInterfaceMethod(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } val binaryMessenger = pigeonRegistrar.binaryMessenger val codec = pigeonRegistrar.codec val channelName = @@ -4090,6 +4266,12 @@ abstract class PigeonApiClassWithApiRequirement( pigeon_instanceArg: ClassWithApiRequirement, callback: (Result) -> Unit ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } if (pigeonRegistrar.instanceManager.containsInstance(pigeon_instanceArg)) { Result.success(Unit) return From cae65e831198e76007c7625fe198f3d6c90215cb Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 15 Aug 2024 12:37:53 -0400 Subject: [PATCH 57/77] fix kotlin tests and add kotlin prefixes --- packages/pigeon/lib/generator_tools.dart | 12 +- packages/pigeon/lib/kotlin/templates.dart | 8 +- .../example/test_plugin/ProxyApiTests.gen.kt | 146 +++++++++--------- .../pigeon/test/kotlin/proxy_api_test.dart | 6 +- 4 files changed, 86 insertions(+), 86 deletions(-) diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index 2b14ae943cce..e28c70b60b8e 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -316,11 +316,17 @@ const String seeAlsoWarning = 'See also: https://pub.dev/packages/pigeon'; /// parameters. const String classNamePrefix = 'PigeonInternal'; +/// Prefix for classes generated to use with ProxyApis. +/// +/// This lowers the chances of variable name collisions with user defined +/// parameters. +const String proxyApiClassNamePrefix = 'Pigeon'; + /// Prefix for APIs generated for ProxyApi. /// /// Since ProxyApis are intended to wrap a class and will often share the name /// of said class, host APIs should prefix the API with this protected name. -const String hostProxyApiPrefix = '${classNamePrefix}Api'; +const String hostProxyApiPrefix = '${proxyApiClassNamePrefix}Api'; /// Name for the generated InstanceManager for ProxyApis. /// @@ -334,7 +340,7 @@ const String instanceManagerClassName = '${classNamePrefix}InstanceManager'; /// parameters. const String classMemberNamePrefix = 'pigeon_'; -/// Prefix for variable names not defined by the user. +/// Prefix for variable names not defined by the user. /// /// This lowers the chances of variable name collisions with user defined /// parameters. @@ -344,6 +350,8 @@ const String varNamePrefix = 'pigeonVar_'; const List disallowedPrefixes = [ classNamePrefix, classMemberNamePrefix, + hostProxyApiPrefix, + proxyApiClassNamePrefix, varNamePrefix, 'pigeonChannelCodec' ]; diff --git a/packages/pigeon/lib/kotlin/templates.dart b/packages/pigeon/lib/kotlin/templates.dart index 25fa860c1148..c3c8ca8a83b3 100644 --- a/packages/pigeon/lib/kotlin/templates.dart +++ b/packages/pigeon/lib/kotlin/templates.dart @@ -7,15 +7,15 @@ import '../kotlin_generator.dart'; /// Name of the Kotlin `InstanceManager`. String kotlinInstanceManagerClassName(KotlinOptions options) => - '${options.fileSpecificClassNameComponent ?? ''}${classNamePrefix}InstanceManager'; + '${options.fileSpecificClassNameComponent ?? ''}${proxyApiClassNamePrefix}InstanceManager'; /// The name of the registrar containing all the ProxyApi implementations. String proxyApiRegistrarName(KotlinOptions options) => - '${options.fileSpecificClassNameComponent ?? ''}${classNamePrefix}ProxyApiRegistrar'; + '${options.fileSpecificClassNameComponent ?? ''}${proxyApiClassNamePrefix}ProxyApiRegistrar'; /// The name of the codec that handles ProxyApis. String proxyApiCodecName(KotlinOptions options) => - '${options.fileSpecificClassNameComponent ?? ''}${classNamePrefix}ProxyApiBaseCodec'; + '${options.fileSpecificClassNameComponent ?? ''}${proxyApiClassNamePrefix}ProxyApiBaseCodec'; /// The Kotlin `InstanceManager`. String instanceManagerTemplate(KotlinOptions options) { @@ -237,4 +237,4 @@ class ${kotlinInstanceManagerClassName(options)}(private val finalizationListene } const String _finalizationListenerClassName = - '${classNamePrefix}FinalizationListener'; + '${proxyApiClassNamePrefix}FinalizationListener'; diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 71f6ea2c9c0a..dcf9839b8822 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -64,11 +64,11 @@ class ProxyApiTestsError( * instance is recreated. The strong reference will then need to be removed manually again. */ @Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") -class ProxyApiTestsPigeonInternalInstanceManager( - private val finalizationListener: PigeonInternalFinalizationListener +class ProxyApiTestsPigeonInstanceManager( + private val finalizationListener: PigeonFinalizationListener ) { /** Interface for listening when a weak reference of an instance is removed from the manager. */ - interface PigeonInternalFinalizationListener { + interface PigeonFinalizationListener { fun onFinalize(identifier: Long) } @@ -110,9 +110,9 @@ class ProxyApiTestsPigeonInternalInstanceManager( * When the manager is no longer needed, [stopFinalizationListener] must be called. */ fun create( - finalizationListener: PigeonInternalFinalizationListener - ): ProxyApiTestsPigeonInternalInstanceManager { - return ProxyApiTestsPigeonInternalInstanceManager(finalizationListener) + finalizationListener: PigeonFinalizationListener + ): ProxyApiTestsPigeonInstanceManager { + return ProxyApiTestsPigeonInstanceManager(finalizationListener) } } @@ -133,7 +133,7 @@ class ProxyApiTestsPigeonInternalInstanceManager( * strong reference to `instance` will be added and will need to be removed again with [remove]. * * If this method returns a nonnull identifier, this method also expects the Dart - * `ProxyApiTestsPigeonInternalInstanceManager` to have, or recreate, a weak reference to the Dart + * `ProxyApiTestsPigeonInstanceManager` to have, or recreate, a weak reference to the Dart * instance the identifier is associated with. */ fun getIdentifierForStrongReference(instance: Any?): Long? { @@ -188,11 +188,11 @@ class ProxyApiTestsPigeonInternalInstanceManager( } /** - * Stops the periodic run of the [PigeonInternalFinalizationListener] for instances that have been - * garbage collected. + * Stops the periodic run of the [PigeonFinalizationListener] for instances that have been garbage + * collected. * - * The InstanceManager can continue to be used, but the [PigeonInternalFinalizationListener] will - * no longer be called and methods will log a warning. + * The InstanceManager can continue to be used, but the [PigeonFinalizationListener] will no + * longer be called and methods will log a warning. */ fun stopFinalizationListener() { handler.removeCallbacks { this.releaseAllFinalizedInstances() } @@ -212,8 +212,8 @@ class ProxyApiTestsPigeonInternalInstanceManager( } /** - * Whether the [PigeonInternalFinalizationListener] is still being called for instances that are - * garbage collected. + * Whether the [PigeonFinalizationListener] is still being called for instances that are garbage + * collected. * * See [stopFinalizationListener]. */ @@ -254,24 +254,24 @@ class ProxyApiTestsPigeonInternalInstanceManager( if (hasFinalizationListenerStopped()) { Log.w( tag, - "The manager was used after calls to the PigeonInternalFinalizationListener has been stopped.") + "The manager was used after calls to the PigeonFinalizationListener has been stopped.") } } } /** Generated API for managing the Dart and native `PigeonInternalInstanceManager`s. */ -private class ProxyApiTestsPigeonInternalInstanceManagerApi(val binaryMessenger: BinaryMessenger) { +private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { companion object { - /** The codec used by ProxyApiTestsPigeonInternalInstanceManagerApi. */ + /** The codec used by ProxyApiTestsPigeonInstanceManagerApi. */ val codec: MessageCodec by lazy { StandardMessageCodec() } /** - * Sets up an instance of `ProxyApiTestsPigeonInternalInstanceManagerApi` to handle messages - * from the `binaryMessenger`. + * Sets up an instance of `ProxyApiTestsPigeonInstanceManagerApi` to handle messages from the + * `binaryMessenger`. */ fun setUpMessageHandlers( binaryMessenger: BinaryMessenger, - instanceManager: ProxyApiTestsPigeonInternalInstanceManager? + instanceManager: ProxyApiTestsPigeonInstanceManager? ) { run { val channel = @@ -343,24 +343,24 @@ private class ProxyApiTestsPigeonInternalInstanceManagerApi(val binaryMessenger: * Provides implementations for each ProxyApi implementation and provides access to resources needed * by any implementation. */ -abstract class ProxyApiTestsPigeonInternalProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { +abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { /** Whether APIs should ignore calling to Dart. */ public var ignoreCallsToDart = false - val instanceManager: ProxyApiTestsPigeonInternalInstanceManager + val instanceManager: ProxyApiTestsPigeonInstanceManager private var _codec: StandardMessageCodec? = null val codec: StandardMessageCodec get() { if (_codec == null) { - _codec = ProxyApiTestsPigeonInternalProxyApiBaseCodec(this) + _codec = ProxyApiTestsPigeonProxyApiBaseCodec(this) } return _codec!! } init { - val api = ProxyApiTestsPigeonInternalInstanceManagerApi(binaryMessenger) + val api = ProxyApiTestsPigeonInstanceManagerApi(binaryMessenger) instanceManager = - ProxyApiTestsPigeonInternalInstanceManager.create( - object : ProxyApiTestsPigeonInternalInstanceManager.PigeonFinalizationListener { + ProxyApiTestsPigeonInstanceManager.create( + object : ProxyApiTestsPigeonInstanceManager.PigeonFinalizationListener { override fun onFinalize(identifier: Long) { api.removeStrongReference(identifier) { if (it.isFailure) { @@ -373,53 +373,51 @@ abstract class ProxyApiTestsPigeonInternalProxyApiRegistrar(val binaryMessenger: }) } /** - * An implementation of [PigeonInternalApiProxyApiTestClass] used to add a new Dart instance of + * An implementation of [PigeonApiProxyApiTestClass] used to add a new Dart instance of * `ProxyApiTestClass` to the Dart `InstanceManager`. */ - abstract fun getPigeonInternalApiProxyApiTestClass(): PigeonInternalApiProxyApiTestClass + abstract fun getPigeonApiProxyApiTestClass(): PigeonApiProxyApiTestClass /** - * An implementation of [PigeonInternalApiProxyApiSuperClass] used to add a new Dart instance of + * An implementation of [PigeonApiProxyApiSuperClass] used to add a new Dart instance of * `ProxyApiSuperClass` to the Dart `InstanceManager`. */ - abstract fun getPigeonInternalApiProxyApiSuperClass(): PigeonInternalApiProxyApiSuperClass + abstract fun getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass /** - * An implementation of [PigeonInternalApiProxyApiInterface] used to add a new Dart instance of + * An implementation of [PigeonApiProxyApiInterface] used to add a new Dart instance of * `ProxyApiInterface` to the Dart `InstanceManager`. */ - open fun getPigeonInternalApiProxyApiInterface(): PigeonInternalApiProxyApiInterface { - return PigeonInternalApiProxyApiInterface(this) + open fun getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { + return PigeonApiProxyApiInterface(this) } /** - * An implementation of [PigeonInternalApiClassWithApiRequirement] used to add a new Dart instance - * of `ClassWithApiRequirement` to the Dart `InstanceManager`. + * An implementation of [PigeonApiClassWithApiRequirement] used to add a new Dart instance of + * `ClassWithApiRequirement` to the Dart `InstanceManager`. */ - abstract fun getPigeonInternalApiClassWithApiRequirement(): - PigeonInternalApiClassWithApiRequirement + abstract fun getPigeonApiClassWithApiRequirement(): PigeonApiClassWithApiRequirement fun setUp() { - ProxyApiTestsPigeonInternalInstanceManagerApi.setUpMessageHandlers( - binaryMessenger, instanceManager) - PigeonInternalApiProxyApiTestClass.setUpMessageHandlers( - binaryMessenger, getPigeonInternalApiProxyApiTestClass()) - PigeonInternalApiProxyApiSuperClass.setUpMessageHandlers( - binaryMessenger, getPigeonInternalApiProxyApiSuperClass()) - PigeonInternalApiClassWithApiRequirement.setUpMessageHandlers( - binaryMessenger, getPigeonInternalApiClassWithApiRequirement()) + ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager) + PigeonApiProxyApiTestClass.setUpMessageHandlers( + binaryMessenger, getPigeonApiProxyApiTestClass()) + PigeonApiProxyApiSuperClass.setUpMessageHandlers( + binaryMessenger, getPigeonApiProxyApiSuperClass()) + PigeonApiClassWithApiRequirement.setUpMessageHandlers( + binaryMessenger, getPigeonApiClassWithApiRequirement()) } fun tearDown() { - ProxyApiTestsPigeonInternalInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null) - PigeonInternalApiProxyApiTestClass.setUpMessageHandlers(binaryMessenger, null) - PigeonInternalApiProxyApiSuperClass.setUpMessageHandlers(binaryMessenger, null) - PigeonInternalApiClassWithApiRequirement.setUpMessageHandlers(binaryMessenger, null) + ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null) + PigeonApiProxyApiTestClass.setUpMessageHandlers(binaryMessenger, null) + PigeonApiProxyApiSuperClass.setUpMessageHandlers(binaryMessenger, null) + PigeonApiClassWithApiRequirement.setUpMessageHandlers(binaryMessenger, null) } } -private class ProxyApiTestsPigeonInternalProxyApiBaseCodec( - val registrar: ProxyApiTestsPigeonInternalProxyApiRegistrar +private class ProxyApiTestsPigeonProxyApiBaseCodec( + val registrar: ProxyApiTestsPigeonProxyApiRegistrar ) : ProxyApiTestsPigeonCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { @@ -451,13 +449,13 @@ private class ProxyApiTestsPigeonInternalProxyApiBaseCodec( } if (value is ProxyApiTestClass) { - registrar.getPigeonInternalApiProxyApiTestClass().pigeon_newInstance(value) {} + registrar.getPigeonApiProxyApiTestClass().pigeon_newInstance(value) {} } else if (value is com.example.test_plugin.ProxyApiSuperClass) { - registrar.getPigeonInternalApiProxyApiSuperClass().pigeon_newInstance(value) {} + registrar.getPigeonApiProxyApiSuperClass().pigeon_newInstance(value) {} } else if (value is ProxyApiInterface) { - registrar.getPigeonInternalApiProxyApiInterface().pigeon_newInstance(value) {} + registrar.getPigeonApiProxyApiInterface().pigeon_newInstance(value) {} } else if (android.os.Build.VERSION.SDK_INT >= 25 && value is ClassWithApiRequirement) { - registrar.getPigeonInternalApiClassWithApiRequirement().pigeon_newInstance(value) {} + registrar.getPigeonApiClassWithApiRequirement().pigeon_newInstance(value) {} } when { @@ -510,8 +508,8 @@ private open class ProxyApiTestsPigeonCodec : StandardMessageCodec() { * integration tests. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonInternalApiProxyApiTestClass( - open val pigeonRegistrar: ProxyApiTestsPigeonInternalProxyApiRegistrar +abstract class PigeonApiProxyApiTestClass( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar ) { abstract fun pigeon_defaultConstructor( aBool: Boolean, @@ -1012,10 +1010,7 @@ abstract class PigeonInternalApiProxyApiTestClass( companion object { @Suppress("LocalVariableName") - fun setUpMessageHandlers( - binaryMessenger: BinaryMessenger, - api: PigeonInternalApiProxyApiTestClass? - ) { + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiTestClass?) { val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() run { val channel = @@ -3979,21 +3974,21 @@ abstract class PigeonInternalApiProxyApiTestClass( } @Suppress("FunctionName") - /** An implementation of [PigeonInternalApiProxyApiSuperClass] used to access callback methods */ - fun pigeon_getPigeonInternalApiProxyApiSuperClass(): PigeonInternalApiProxyApiSuperClass { - return pigeonRegistrar.getPigeonInternalApiProxyApiSuperClass() + /** An implementation of [PigeonApiProxyApiSuperClass] used to access callback methods */ + fun pigeon_getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass { + return pigeonRegistrar.getPigeonApiProxyApiSuperClass() } @Suppress("FunctionName") - /** An implementation of [PigeonInternalApiProxyApiInterface] used to access callback methods */ - fun pigeon_getPigeonInternalApiProxyApiInterface(): PigeonInternalApiProxyApiInterface { - return pigeonRegistrar.getPigeonInternalApiProxyApiInterface() + /** An implementation of [PigeonApiProxyApiInterface] used to access callback methods */ + fun pigeon_getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { + return pigeonRegistrar.getPigeonApiProxyApiInterface() } } /** ProxyApi to serve as a super class to the core ProxyApi class. */ @Suppress("UNCHECKED_CAST") -abstract class PigeonInternalApiProxyApiSuperClass( - open val pigeonRegistrar: ProxyApiTestsPigeonInternalProxyApiRegistrar +abstract class PigeonApiProxyApiSuperClass( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar ) { abstract fun pigeon_defaultConstructor(): com.example.test_plugin.ProxyApiSuperClass @@ -4001,10 +3996,7 @@ abstract class PigeonInternalApiProxyApiSuperClass( companion object { @Suppress("LocalVariableName") - fun setUpMessageHandlers( - binaryMessenger: BinaryMessenger, - api: PigeonInternalApiProxyApiSuperClass? - ) { + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiSuperClass?) { val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() run { val channel = @@ -4097,8 +4089,8 @@ abstract class PigeonInternalApiProxyApiSuperClass( } /** ProxyApi to serve as an interface to the core ProxyApi class. */ @Suppress("UNCHECKED_CAST") -open class PigeonInternalApiProxyApiInterface( - open val pigeonRegistrar: ProxyApiTestsPigeonInternalProxyApiRegistrar +open class PigeonApiProxyApiInterface( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar ) { @Suppress("LocalVariableName", "FunctionName") /** Creates a Dart instance of ProxyApiInterface and attaches it to [pigeon_instanceArg]. */ @@ -4164,8 +4156,8 @@ open class PigeonInternalApiProxyApiInterface( } @Suppress("UNCHECKED_CAST") -abstract class PigeonInternalApiClassWithApiRequirement( - open val pigeonRegistrar: ProxyApiTestsPigeonInternalProxyApiRegistrar +abstract class PigeonApiClassWithApiRequirement( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar ) { @androidx.annotation.RequiresApi(api = 25) abstract fun pigeon_defaultConstructor(): ClassWithApiRequirement @@ -4177,7 +4169,7 @@ abstract class PigeonInternalApiClassWithApiRequirement( @Suppress("LocalVariableName") fun setUpMessageHandlers( binaryMessenger: BinaryMessenger, - api: PigeonInternalApiClassWithApiRequirement? + api: PigeonApiClassWithApiRequirement? ) { val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() if (android.os.Build.VERSION.SDK_INT >= 25) { diff --git a/packages/pigeon/test/kotlin/proxy_api_test.dart b/packages/pigeon/test/kotlin/proxy_api_test.dart index 80ba04761be4..d6ddd35377bf 100644 --- a/packages/pigeon/test/kotlin/proxy_api_test.dart +++ b/packages/pigeon/test/kotlin/proxy_api_test.dart @@ -95,14 +95,14 @@ void main() { final String collapsedCode = _collapseNewlineAndIndentation(code); // Instance Manager - expect(code, contains(r'class MyFilePigeonInternalInstanceManager')); - expect(code, contains(r'class MyFilePigeonInternalInstanceManagerApi')); + expect(code, contains(r'class MyFilePigeonInstanceManager')); + expect(code, contains(r'class MyFilePigeonInstanceManagerApi')); // API registrar expect( code, contains( - 'abstract class MyFilePigeonInternalProxyApiRegistrar(val binaryMessenger: BinaryMessenger)', + 'abstract class MyFilePigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger)', ), ); From 82f0ceea84e2ce6bb70b3309acb483f30181797d Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 15 Aug 2024 12:58:43 -0400 Subject: [PATCH 58/77] fix tools version --- packages/pigeon/lib/generator_tools.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index e28c70b60b8e..24ba4824865e 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -14,7 +14,7 @@ import 'ast.dart'; /// The current version of pigeon. /// /// This must match the version in pubspec.yaml. -const String pigeonVersion = '21.2.0'; +const String pigeonVersion = '21.3.0'; /// Read all the content from [stdin] to a String. String readStdin() { From 233acf50feaae9b446fcfd3972a226f8a56d162d Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 15 Aug 2024 16:51:09 -0400 Subject: [PATCH 59/77] fix lint --- packages/pigeon/lib/ast.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pigeon/lib/ast.dart b/packages/pigeon/lib/ast.dart index 83fd8fe95ef4..31aeea6a928e 100644 --- a/packages/pigeon/lib/ast.dart +++ b/packages/pigeon/lib/ast.dart @@ -5,8 +5,8 @@ import 'package:collection/collection.dart' show ListEquality; import 'package:meta/meta.dart'; -import 'kotlin_generator.dart' show KotlinProxyApiOptions; import 'generator_tools.dart'; +import 'kotlin_generator.dart' show KotlinProxyApiOptions; import 'pigeon_lib.dart'; typedef _ListEquals = bool Function(List, List); From 24daaa1eeb7a86d575c3c3155d4807015e95f9b7 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Sat, 17 Aug 2024 13:49:47 -0400 Subject: [PATCH 60/77] try fix instance manager api name --- packages/pigeon/lib/dart/templates.dart | 44 ++++-- packages/pigeon/lib/dart_generator.dart | 51 +++--- packages/pigeon/lib/generator_tools.dart | 29 +++- packages/pigeon/lib/kotlin/templates.dart | 2 +- packages/pigeon/lib/kotlin_generator.dart | 20 +-- .../src/generated/proxy_api_tests.gen.dart | 148 +++++++++--------- .../example/test_plugin/ProxyApiTests.gen.kt | 10 +- 7 files changed, 156 insertions(+), 148 deletions(-) diff --git a/packages/pigeon/lib/dart/templates.dart b/packages/pigeon/lib/dart/templates.dart index ecdb5290b26d..c78c4f566d22 100644 --- a/packages/pigeon/lib/dart/templates.dart +++ b/packages/pigeon/lib/dart/templates.dart @@ -4,6 +4,20 @@ import '../generator_tools.dart'; +/// Name for the generated InstanceManager for ProxyApis. +/// +/// This lowers the chances of variable name collisions with user defined +/// parameters. +const String dartInstanceManagerClassName = + '${proxyApiClassNamePrefix}InstanceManager'; + +/// Name for the generated InstanceManager API for ProxyApis. +/// +/// This lowers the chances of variable name collisions with user defined +/// parameters. +const String dartInstanceManagerApiClassName = + '_${classNamePrefix}InstanceManagerApi'; + /// Creates the `InstanceManager` with the passed string values. String instanceManagerTemplate({ required Iterable allProxyApiNames, @@ -30,9 +44,9 @@ String instanceManagerTemplate({ /// is added as a weak reference with the same identifier. This prevents a /// scenario where the weak referenced instance was released and then later /// returned by the host platform. -class $instanceManagerClassName { - /// Constructs a [$instanceManagerClassName]. - $instanceManagerClassName({required void Function(int) onWeakReferenceRemoved}) { +class $dartInstanceManagerClassName { + /// Constructs a [$dartInstanceManagerClassName]. + $dartInstanceManagerClassName({required void Function(int) onWeakReferenceRemoved}) { this.onWeakReferenceRemoved = (int identifier) { _weakInstances.remove(identifier); onWeakReferenceRemoved(identifier); @@ -46,12 +60,12 @@ class $instanceManagerClassName { // 0 <= n < 2^16. static const int _maxDartCreatedIdentifier = 65536; - /// The default [$instanceManagerClassName] used by ProxyApis. + /// The default [$dartInstanceManagerClassName] used by ProxyApis. /// /// On creation, this manager makes a call to clear the native /// InstanceManager. This is to prevent identifier conflicts after a host /// restart. - static final $instanceManagerClassName instance = _initInstance(); + static final $dartInstanceManagerClassName instance = _initInstance(); // Expando is used because it doesn't prevent its keys from becoming // inaccessible. This allows the manager to efficiently retrieve an identifier @@ -72,17 +86,17 @@ class $instanceManagerClassName { /// or becomes inaccessible. late final void Function(int) onWeakReferenceRemoved; - static $instanceManagerClassName _initInstance() { + static $dartInstanceManagerClassName _initInstance() { WidgetsFlutterBinding.ensureInitialized(); - final _${instanceManagerClassName}Api api = _${instanceManagerClassName}Api(); - // Clears the native `$instanceManagerClassName` on the initial use of the Dart one. + final $dartInstanceManagerApiClassName api = $dartInstanceManagerApiClassName(); + // Clears the native `$dartInstanceManagerClassName` on the initial use of the Dart one. api.clear(); - final $instanceManagerClassName instanceManager = $instanceManagerClassName( + final $dartInstanceManagerClassName instanceManager = $dartInstanceManagerClassName( onWeakReferenceRemoved: (int identifier) { api.removeStrongReference(identifier); }, ); - _${instanceManagerClassName}Api.setUpMessageHandlers(instanceManager: instanceManager); + $dartInstanceManagerApiClassName.setUpMessageHandlers(instanceManager: instanceManager); ${apiHandlerSetUps.join('\n\t\t')} return instanceManager; } @@ -229,9 +243,9 @@ abstract class $proxyApiBaseClassName { /// Construct a [$proxyApiBaseClassName]. $proxyApiBaseClassName({ this.$_proxyApiBaseClassMessengerVarName, - $instanceManagerClassName? $_proxyApiBaseClassInstanceManagerVarName, + $dartInstanceManagerClassName? $_proxyApiBaseClassInstanceManagerVarName, }) : $_proxyApiBaseClassInstanceManagerVarName = - $_proxyApiBaseClassInstanceManagerVarName ?? $instanceManagerClassName.instance; + $_proxyApiBaseClassInstanceManagerVarName ?? $dartInstanceManagerClassName.instance; /// Sends and receives binary data across the Flutter platform barrier. /// @@ -242,12 +256,12 @@ abstract class $proxyApiBaseClassName { /// Maintains instances stored to communicate with native language objects. @protected - final $instanceManagerClassName $_proxyApiBaseClassInstanceManagerVarName; + final $dartInstanceManagerClassName $_proxyApiBaseClassInstanceManagerVarName; /// Instantiates and returns a functionally identical object to oneself. /// /// Outside of tests, this method should only ever be called by - /// [$instanceManagerClassName]. + /// [$dartInstanceManagerClassName]. /// /// Subclasses should always override their parent's implementation of this /// method. @@ -264,7 +278,7 @@ abstract class $proxyApiBaseClassName { const String proxyApiBaseCodec = ''' class $_proxyApiCodecName extends _PigeonCodec { const $_proxyApiCodecName(this.instanceManager); - final $instanceManagerClassName instanceManager; + final $dartInstanceManagerClassName instanceManager; @override void writeValue(WriteBuffer buffer, Object? value) { if (value is $proxyApiBaseClassName) { diff --git a/packages/pigeon/lib/dart_generator.dart b/packages/pigeon/lib/dart_generator.dart index df9f31759293..d2ea1c8b6afe 100644 --- a/packages/pigeon/lib/dart_generator.dart +++ b/packages/pigeon/lib/dart_generator.dart @@ -534,8 +534,6 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; Indent indent, { required String dartPackageName, }) { - const String apiName = '${instanceManagerClassName}Api'; - final cb.Parameter binaryMessengerParameter = cb.Parameter( (cb.ParameterBuilder builder) => builder ..name = 'binaryMessenger' @@ -550,23 +548,18 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; ..modifier = cb.FieldModifier.final$, ); - final String removeStrongReferenceName = makeChannelNameWithStrings( - apiName: apiName, - methodName: 'removeStrongReference', - dartPackageName: dartPackageName, - ); - final cb.Class instanceManagerApi = cb.Class( (cb.ClassBuilder builder) => builder - ..name = '_$apiName' + ..name = dartInstanceManagerApiClassName ..docs.add( - '/// Generated API for managing the Dart and native `$instanceManagerClassName`s.', + '/// Generated API for managing the Dart and native `$dartInstanceManagerClassName`s.', ) ..constructors.add( cb.Constructor( (cb.ConstructorBuilder builder) { builder - ..docs.add('/// Constructor for [_$apiName].') + ..docs.add( + '/// Constructor for [$dartInstanceManagerApiClassName].') ..optionalParameters.add(binaryMessengerParameter) ..initializers.add( cb.Code( @@ -611,7 +604,7 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; (cb.ParameterBuilder builder) => builder ..name = 'instanceManager' ..named = true - ..type = cb.refer('$instanceManagerClassName?'), + ..type = cb.refer('$dartInstanceManagerClassName?'), ), ]) ..body = cb.Block.of( @@ -631,7 +624,8 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; ) ], returnType: const TypeDeclaration.voidDeclaration(), - channelName: removeStrongReferenceName, + channelName: makeRemoveStrongReferenceChannelName( + dartPackageName), isMockHandler: false, isAsynchronous: false, nullHandlerExpression: @@ -641,7 +635,7 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; Iterable parameters, Iterable safeArgumentNames, ) { - return '(instanceManager ?? $instanceManagerClassName.instance).remove(${safeArgumentNames.single})'; + return '(instanceManager ?? $dartInstanceManagerClassName.instance).remove(${safeArgumentNames.single})'; }, ); builder.statements.add( @@ -674,7 +668,8 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; _writeHostMethodMessageCall( Indent(messageCallSink), addSuffixVariable: false, - channelName: removeStrongReferenceName, + channelName: makeRemoveStrongReferenceChannelName( + dartPackageName), parameters: [ Parameter( name: 'identifier', @@ -700,7 +695,7 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; ..returns = cb.refer('Future') ..modifier = cb.MethodModifier.async ..docs.addAll([ - '/// Clear the native `$instanceManagerClassName`.', + '/// Clear the native `$dartInstanceManagerClassName`.', '///', '/// This is typically called after a hot restart.', ]) @@ -710,11 +705,7 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; _writeHostMethodMessageCall( Indent(messageCallSink), addSuffixVariable: false, - channelName: makeChannelNameWithStrings( - apiName: apiName, - methodName: 'clear', - dartPackageName: dartPackageName, - ), + channelName: makeClearChannelName(dartPackageName), parameters: [], returnType: const TypeDeclaration.voidDeclaration(), ); @@ -1423,7 +1414,7 @@ if (${varNamePrefix}replyList == null) { '/// Constructs [$apiName] without creating the associated native object.', '///', '/// This should only be used by subclasses created by this library or to', - '/// create copies for an [$instanceManagerClassName].', + '/// create copies for an [$dartInstanceManagerClassName].', ]) ..annotations.add(cb.refer('protected')) ..optionalParameters.addAll([ @@ -1530,7 +1521,7 @@ if (${varNamePrefix}replyList == null) { ');', '```', '', - 'Alternatively, [$instanceManagerClassName.removeWeakReference] can be used to', + 'Alternatively, [$dartInstanceManagerClassName.removeWeakReference] can be used to', 'release the associated Native object manually.', ], ], @@ -1676,7 +1667,7 @@ if (${varNamePrefix}replyList == null) { (cb.ParameterBuilder builder) => builder ..name = _instanceManagerVarName ..named = true - ..type = cb.refer('$instanceManagerClassName?'), + ..type = cb.refer('$dartInstanceManagerClassName?'), ), if (hasCallbackConstructor) cb.Parameter( @@ -1727,7 +1718,7 @@ if (${varNamePrefix}replyList == null) { ..body = cb.Block.of([ if (hasAnyMessageHandlers) ...[ cb.Code( - 'final $codecName $_pigeonChannelCodec = $codecName($_instanceManagerVarName ?? $instanceManagerClassName.instance);', + 'final $codecName $_pigeonChannelCodec = $codecName($_instanceManagerVarName ?? $dartInstanceManagerClassName.instance);', ), const cb.Code( 'final BinaryMessenger? binaryMessenger = ${classMemberNamePrefix}binaryMessenger;', @@ -1775,7 +1766,7 @@ if (${varNamePrefix}replyList == null) { return '${parameter.name}: $safeArgName,\n'; }, ).skip(1).join(); - return '($_instanceManagerVarName ?? $instanceManagerClassName.instance)\n' + return '($_instanceManagerVarName ?? $dartInstanceManagerClassName.instance)\n' ' .addHostCreatedInstance(\n' ' $methodName?.call(${safeArgumentNames.skip(1).join(',')}) ??\n' ' $apiName.${classMemberNamePrefix}detached(' @@ -1911,13 +1902,13 @@ if (${varNamePrefix}replyList == null) { 'final $type $instanceName = $type.${classMemberNamePrefix}detached();', ), cb.Code( - 'final $codecName $_pigeonChannelCodec = $codecName($instanceManagerClassName.instance);', + 'final $codecName $_pigeonChannelCodec = $codecName($dartInstanceManagerClassName.instance);', ), const cb.Code( 'final BinaryMessenger ${varNamePrefix}binaryMessenger = ServicesBinding.instance.defaultBinaryMessenger;', ), const cb.Code( - 'final int $identifierInstanceName = $instanceManagerClassName.instance.addDartCreatedInstance($instanceName);', + 'final int $identifierInstanceName = $dartInstanceManagerClassName.instance.addDartCreatedInstance($instanceName);', ), ], const cb.Code('() async {'), @@ -1978,7 +1969,7 @@ if (${varNamePrefix}replyList == null) { cb.Parameter( (cb.ParameterBuilder builder) => builder ..name = _instanceManagerVarName - ..type = cb.refer('$instanceManagerClassName?'), + ..type = cb.refer('$dartInstanceManagerClassName?'), ), ], ]) @@ -2012,7 +2003,7 @@ if (${varNamePrefix}replyList == null) { ' $codecInstanceName;') else cb.Code( - 'final $codecName $_pigeonChannelCodec = $codecName($_instanceManagerVarName ?? $instanceManagerClassName.instance);', + 'final $codecName $_pigeonChannelCodec = $codecName($_instanceManagerVarName ?? $dartInstanceManagerClassName.instance);', ), const cb.Code( 'final BinaryMessenger? ${varNamePrefix}binaryMessenger = ${classMemberNamePrefix}binaryMessenger;', diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index 24ba4824865e..dc4d8b7fa0ba 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -328,12 +328,6 @@ const String proxyApiClassNamePrefix = 'Pigeon'; /// of said class, host APIs should prefix the API with this protected name. const String hostProxyApiPrefix = '${proxyApiClassNamePrefix}Api'; -/// Name for the generated InstanceManager for ProxyApis. -/// -/// This lowers the chances of variable name collisions with user defined -/// parameters. -const String instanceManagerClassName = '${classNamePrefix}InstanceManager'; - /// Prefix for class member names not defined by the user. /// /// This lowers the chances of variable name collisions with user defined @@ -807,3 +801,26 @@ String toScreamingSnakeCase(String string) { RegExp(r'(?<=[a-z])[A-Z]'), (Match m) => '_${m.group(0)}') .toUpperCase(); } + +/// The channel name for the `removeStrongReference` method of the +/// `InstanceManager` API. +/// +/// This ensures the channel name is the same for all languages. +String makeRemoveStrongReferenceChannelName(String dartPackageName) { + return makeChannelNameWithStrings( + apiName: '${classNamePrefix}InstanceManager', + methodName: 'removeStrongReference', + dartPackageName: dartPackageName, + ); +} + +/// The channel name for the `clear` method of the `InstanceManager` API. +/// +/// This ensures the channel name is the same for all languages. +String makeClearChannelName(String dartPackageName) { + return makeChannelNameWithStrings( + apiName: '${classNamePrefix}InstanceManager', + methodName: 'clear', + dartPackageName: dartPackageName, + ); +} diff --git a/packages/pigeon/lib/kotlin/templates.dart b/packages/pigeon/lib/kotlin/templates.dart index c3c8ca8a83b3..5f85078588be 100644 --- a/packages/pigeon/lib/kotlin/templates.dart +++ b/packages/pigeon/lib/kotlin/templates.dart @@ -75,7 +75,7 @@ class ${kotlinInstanceManagerClassName(options)}(private val finalizationListene // Host uses identifiers >= 2^16 and Dart is expected to use values n where, // 0 <= n < 2^16. private const val minHostCreatedIdentifier: Long = 65536 - private const val tag = "$instanceManagerClassName" + private const val tag = "${proxyApiClassNamePrefix}InstanceManager" /** * Instantiate a new manager with a listener for garbage collected weak diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 3843e4fd462d..d114e9837b5a 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -655,21 +655,10 @@ if (wrapped == null) { final String instanceManagerApiName = '${kotlinInstanceManagerClassName(generatorOptions)}Api'; - final String removeStrongReferenceName = makeChannelNameWithStrings( - apiName: '${instanceManagerClassName}Api', - methodName: 'removeStrongReference', - dartPackageName: dartPackageName, - ); - final String clearName = makeChannelNameWithStrings( - apiName: '${instanceManagerClassName}Api', - methodName: 'clear', - dartPackageName: dartPackageName, - ); - addDocumentationComments( indent, [ - 'Generated API for managing the Dart and native `$instanceManagerClassName`s.', + 'Generated API for managing the Dart and native `InstanceManager`s.', ], _docCommentSpec, ); @@ -705,7 +694,8 @@ if (wrapped == null) { _writeHostMethodMessageHandler( indent, name: 'removeStrongReference', - channelName: removeStrongReferenceName, + channelName: + makeRemoveStrongReferenceChannelName(dartPackageName), taskQueueType: TaskQueueType.serial, parameters: [ Parameter( @@ -728,7 +718,7 @@ if (wrapped == null) { _writeHostMethodMessageHandler( indent, name: 'clear', - channelName: clearName, + channelName: makeClearChannelName(dartPackageName), taskQueueType: TaskQueueType.serial, parameters: [], returnType: const TypeDeclaration.voidDeclaration(), @@ -756,7 +746,7 @@ if (wrapped == null) { ) ], returnType: const TypeDeclaration.voidDeclaration(), - channelName: removeStrongReferenceName, + channelName: makeRemoveStrongReferenceChannelName(dartPackageName), dartPackageName: dartPackageName, ); }, diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart index cbb6a01e7af0..e0bff7971ecb 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart @@ -42,9 +42,9 @@ abstract class PigeonInternalProxyApiBaseClass { /// Construct a [PigeonInternalProxyApiBaseClass]. PigeonInternalProxyApiBaseClass({ this.pigeon_binaryMessenger, - PigeonInternalInstanceManager? pigeon_instanceManager, + PigeonInstanceManager? pigeon_instanceManager, }) : pigeon_instanceManager = - pigeon_instanceManager ?? PigeonInternalInstanceManager.instance; + pigeon_instanceManager ?? PigeonInstanceManager.instance; /// Sends and receives binary data across the Flutter platform barrier. /// @@ -55,12 +55,12 @@ abstract class PigeonInternalProxyApiBaseClass { /// Maintains instances stored to communicate with native language objects. @protected - final PigeonInternalInstanceManager pigeon_instanceManager; + final PigeonInstanceManager pigeon_instanceManager; /// Instantiates and returns a functionally identical object to oneself. /// /// Outside of tests, this method should only ever be called by - /// [PigeonInternalInstanceManager]. + /// [PigeonInstanceManager]. /// /// Subclasses should always override their parent's implementation of this /// method. @@ -83,10 +83,9 @@ abstract class PigeonInternalProxyApiBaseClass { /// is added as a weak reference with the same identifier. This prevents a /// scenario where the weak referenced instance was released and then later /// returned by the host platform. -class PigeonInternalInstanceManager { - /// Constructs a [PigeonInternalInstanceManager]. - PigeonInternalInstanceManager( - {required void Function(int) onWeakReferenceRemoved}) { +class PigeonInstanceManager { + /// Constructs a [PigeonInstanceManager]. + PigeonInstanceManager({required void Function(int) onWeakReferenceRemoved}) { this.onWeakReferenceRemoved = (int identifier) { _weakInstances.remove(identifier); onWeakReferenceRemoved(identifier); @@ -100,12 +99,12 @@ class PigeonInternalInstanceManager { // 0 <= n < 2^16. static const int _maxDartCreatedIdentifier = 65536; - /// The default [PigeonInternalInstanceManager] used by ProxyApis. + /// The default [PigeonInstanceManager] used by ProxyApis. /// /// On creation, this manager makes a call to clear the native /// InstanceManager. This is to prevent identifier conflicts after a host /// restart. - static final PigeonInternalInstanceManager instance = _initInstance(); + static final PigeonInstanceManager instance = _initInstance(); // Expando is used because it doesn't prevent its keys from becoming // inaccessible. This allows the manager to efficiently retrieve an identifier @@ -127,14 +126,13 @@ class PigeonInternalInstanceManager { /// or becomes inaccessible. late final void Function(int) onWeakReferenceRemoved; - static PigeonInternalInstanceManager _initInstance() { + static PigeonInstanceManager _initInstance() { WidgetsFlutterBinding.ensureInitialized(); final _PigeonInternalInstanceManagerApi api = _PigeonInternalInstanceManagerApi(); - // Clears the native `PigeonInternalInstanceManager` on the initial use of the Dart one. + // Clears the native `PigeonInstanceManager` on the initial use of the Dart one. api.clear(); - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager( + final PigeonInstanceManager instanceManager = PigeonInstanceManager( onWeakReferenceRemoved: (int identifier) { api.removeStrongReference(identifier); }, @@ -286,7 +284,7 @@ class PigeonInternalInstanceManager { } } -/// Generated API for managing the Dart and native `PigeonInternalInstanceManager`s. +/// Generated API for managing the Dart and native `PigeonInstanceManager`s. class _PigeonInternalInstanceManagerApi { /// Constructor for [_PigeonInternalInstanceManagerApi]. _PigeonInternalInstanceManagerApi({BinaryMessenger? binaryMessenger}) @@ -300,13 +298,13 @@ class _PigeonInternalInstanceManagerApi { static void setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? binaryMessenger, - PigeonInternalInstanceManager? instanceManager, + PigeonInstanceManager? instanceManager, }) { { final BasicMessageChannel< Object?> pigeonVar_channel = BasicMessageChannel< Object?>( - 'dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManagerApi.removeStrongReference', + 'dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference', pigeonChannelCodec, binaryMessenger: binaryMessenger); if (pigeon_clearHandlers) { @@ -314,13 +312,13 @@ class _PigeonInternalInstanceManagerApi { } else { pigeonVar_channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManagerApi.removeStrongReference was null.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManagerApi.removeStrongReference was null, expected non-null int.'); + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference was null, expected non-null int.'); try { - (instanceManager ?? PigeonInternalInstanceManager.instance) + (instanceManager ?? PigeonInstanceManager.instance) .remove(arg_identifier!); return wrapResponse(empty: true); } on PlatformException catch (e) { @@ -336,7 +334,7 @@ class _PigeonInternalInstanceManagerApi { Future removeStrongReference(int identifier) async { const String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManagerApi.removeStrongReference'; + 'dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -358,12 +356,12 @@ class _PigeonInternalInstanceManagerApi { } } - /// Clear the native `PigeonInternalInstanceManager`. + /// Clear the native `PigeonInstanceManager`. /// /// This is typically called after a hot restart. Future clear() async { const String pigeonVar_channelName = - 'dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManagerApi.clear'; + 'dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.clear'; final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( pigeonVar_channelName, @@ -388,7 +386,7 @@ class _PigeonInternalInstanceManagerApi { class _PigeonInternalProxyApiBaseCodec extends _PigeonCodec { const _PigeonInternalProxyApiBaseCodec(this.instanceManager); - final PigeonInternalInstanceManager instanceManager; + final PigeonInstanceManager instanceManager; @override void writeValue(WriteBuffer buffer, Object? value) { if (value is PigeonInternalProxyApiBaseClass) { @@ -582,7 +580,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// Constructs [ProxyApiTestClass] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to - /// create copies for an [PigeonInternalInstanceManager]. + /// create copies for an [PigeonInstanceManager]. @protected ProxyApiTestClass.pigeon_detached({ super.pigeon_binaryMessenger, @@ -691,7 +689,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final void Function(ProxyApiTestClass pigeon_instance)? flutterNoop; @@ -712,7 +710,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final Object? Function(ProxyApiTestClass pigeon_instance)? flutterThrowError; @@ -733,7 +731,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final void Function(ProxyApiTestClass pigeon_instance)? flutterThrowErrorFromVoid; @@ -755,7 +753,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final bool Function( ProxyApiTestClass pigeon_instance, @@ -779,7 +777,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final int Function( ProxyApiTestClass pigeon_instance, @@ -803,7 +801,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final double Function( ProxyApiTestClass pigeon_instance, @@ -827,7 +825,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final String Function( ProxyApiTestClass pigeon_instance, @@ -851,7 +849,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final Uint8List Function( ProxyApiTestClass pigeon_instance, @@ -875,7 +873,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final List Function( ProxyApiTestClass pigeon_instance, @@ -900,7 +898,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final List Function( ProxyApiTestClass pigeon_instance, @@ -924,7 +922,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final Map Function( ProxyApiTestClass pigeon_instance, @@ -949,7 +947,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final Map Function( ProxyApiTestClass pigeon_instance, @@ -973,7 +971,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final ProxyApiTestEnum Function( ProxyApiTestClass pigeon_instance, @@ -997,7 +995,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final ProxyApiSuperClass Function( ProxyApiTestClass pigeon_instance, @@ -1021,7 +1019,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final bool? Function( ProxyApiTestClass pigeon_instance, @@ -1045,7 +1043,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final int? Function( ProxyApiTestClass pigeon_instance, @@ -1069,7 +1067,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final double? Function( ProxyApiTestClass pigeon_instance, @@ -1093,7 +1091,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final String? Function( ProxyApiTestClass pigeon_instance, @@ -1117,7 +1115,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final Uint8List? Function( ProxyApiTestClass pigeon_instance, @@ -1141,7 +1139,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final List? Function( ProxyApiTestClass pigeon_instance, @@ -1165,7 +1163,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final Map? Function( ProxyApiTestClass pigeon_instance, @@ -1189,7 +1187,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final ProxyApiTestEnum? Function( ProxyApiTestClass pigeon_instance, @@ -1213,7 +1211,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final ProxyApiSuperClass? Function( ProxyApiTestClass pigeon_instance, @@ -1238,7 +1236,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final Future Function(ProxyApiTestClass pigeon_instance)? flutterNoopAsync; @@ -1260,7 +1258,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final Future Function( ProxyApiTestClass pigeon_instance, @@ -1278,7 +1276,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, - PigeonInternalInstanceManager? pigeon_instanceManager, + PigeonInstanceManager? pigeon_instanceManager, ProxyApiTestClass Function( bool aBool, int anInt, @@ -1390,7 +1388,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass }) { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _PigeonInternalProxyApiBaseCodec( - pigeon_instanceManager ?? PigeonInternalInstanceManager.instance); + pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { final BasicMessageChannel< @@ -1453,7 +1451,7 @@ class ProxyApiTestClass extends ProxyApiSuperClass final ProxyApiSuperClass? arg_aNullableProxyApi = (args[18] as ProxyApiSuperClass?); try { - (pigeon_instanceManager ?? PigeonInternalInstanceManager.instance) + (pigeon_instanceManager ?? PigeonInstanceManager.instance) .addHostCreatedInstance( pigeon_newInstance?.call( arg_aBool!, @@ -2430,12 +2428,10 @@ class ProxyApiTestClass extends ProxyApiSuperClass final ProxyApiSuperClass pigeonVar_instance = ProxyApiSuperClass.pigeon_detached(); final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = - _PigeonInternalProxyApiBaseCodec( - PigeonInternalInstanceManager.instance); + _PigeonInternalProxyApiBaseCodec(PigeonInstanceManager.instance); final BinaryMessenger pigeonVar_binaryMessenger = ServicesBinding.instance.defaultBinaryMessenger; - final int pigeonVar_instanceIdentifier = PigeonInternalInstanceManager - .instance + final int pigeonVar_instanceIdentifier = PigeonInstanceManager.instance .addDartCreatedInstance(pigeonVar_instance); () async { const String pigeonVar_channelName = @@ -3931,11 +3927,11 @@ class ProxyApiTestClass extends ProxyApiSuperClass static Future staticNoop({ BinaryMessenger? pigeon_binaryMessenger, - PigeonInternalInstanceManager? pigeon_instanceManager, + PigeonInstanceManager? pigeon_instanceManager, }) async { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _PigeonInternalProxyApiBaseCodec( - pigeon_instanceManager ?? PigeonInternalInstanceManager.instance); + pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; const String pigeonVar_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticNoop'; @@ -3963,11 +3959,11 @@ class ProxyApiTestClass extends ProxyApiSuperClass static Future echoStaticString( String aString, { BinaryMessenger? pigeon_binaryMessenger, - PigeonInternalInstanceManager? pigeon_instanceManager, + PigeonInstanceManager? pigeon_instanceManager, }) async { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _PigeonInternalProxyApiBaseCodec( - pigeon_instanceManager ?? PigeonInternalInstanceManager.instance); + pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; const String pigeonVar_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoStaticString'; @@ -3999,11 +3995,11 @@ class ProxyApiTestClass extends ProxyApiSuperClass static Future staticAsyncNoop({ BinaryMessenger? pigeon_binaryMessenger, - PigeonInternalInstanceManager? pigeon_instanceManager, + PigeonInstanceManager? pigeon_instanceManager, }) async { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _PigeonInternalProxyApiBaseCodec( - pigeon_instanceManager ?? PigeonInternalInstanceManager.instance); + pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? pigeonVar_binaryMessenger = pigeon_binaryMessenger; const String pigeonVar_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAsyncNoop'; @@ -4868,7 +4864,7 @@ class ProxyApiSuperClass extends PigeonInternalProxyApiBaseClass { /// Constructs [ProxyApiSuperClass] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to - /// create copies for an [PigeonInternalInstanceManager]. + /// create copies for an [PigeonInstanceManager]. @protected ProxyApiSuperClass.pigeon_detached({ super.pigeon_binaryMessenger, @@ -4882,12 +4878,12 @@ class ProxyApiSuperClass extends PigeonInternalProxyApiBaseClass { static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, - PigeonInternalInstanceManager? pigeon_instanceManager, + PigeonInstanceManager? pigeon_instanceManager, ProxyApiSuperClass Function()? pigeon_newInstance, }) { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _PigeonInternalProxyApiBaseCodec( - pigeon_instanceManager ?? PigeonInternalInstanceManager.instance); + pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { final BasicMessageChannel< @@ -4907,7 +4903,7 @@ class ProxyApiSuperClass extends PigeonInternalProxyApiBaseClass { assert(arg_pigeon_instanceIdentifier != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.pigeon_newInstance was null, expected non-null int.'); try { - (pigeon_instanceManager ?? PigeonInternalInstanceManager.instance) + (pigeon_instanceManager ?? PigeonInstanceManager.instance) .addHostCreatedInstance( pigeon_newInstance?.call() ?? ProxyApiSuperClass.pigeon_detached( @@ -4969,7 +4965,7 @@ class ProxyApiInterface extends PigeonInternalProxyApiBaseClass { /// Constructs [ProxyApiInterface] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to - /// create copies for an [PigeonInternalInstanceManager]. + /// create copies for an [PigeonInstanceManager]. @protected ProxyApiInterface.pigeon_detached({ super.pigeon_binaryMessenger, @@ -4994,20 +4990,20 @@ class ProxyApiInterface extends PigeonInternalProxyApiBaseClass { /// ); /// ``` /// - /// Alternatively, [PigeonInternalInstanceManager.removeWeakReference] can be used to + /// Alternatively, [PigeonInstanceManager.removeWeakReference] can be used to /// release the associated Native object manually. final void Function(ProxyApiInterface pigeon_instance)? anInterfaceMethod; static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, - PigeonInternalInstanceManager? pigeon_instanceManager, + PigeonInstanceManager? pigeon_instanceManager, ProxyApiInterface Function()? pigeon_newInstance, void Function(ProxyApiInterface pigeon_instance)? anInterfaceMethod, }) { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _PigeonInternalProxyApiBaseCodec( - pigeon_instanceManager ?? PigeonInternalInstanceManager.instance); + pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { final BasicMessageChannel< @@ -5027,7 +5023,7 @@ class ProxyApiInterface extends PigeonInternalProxyApiBaseClass { assert(arg_pigeon_instanceIdentifier != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.pigeon_newInstance was null, expected non-null int.'); try { - (pigeon_instanceManager ?? PigeonInternalInstanceManager.instance) + (pigeon_instanceManager ?? PigeonInstanceManager.instance) .addHostCreatedInstance( pigeon_newInstance?.call() ?? ProxyApiInterface.pigeon_detached( @@ -5128,7 +5124,7 @@ class ClassWithApiRequirement extends PigeonInternalProxyApiBaseClass { /// Constructs [ClassWithApiRequirement] without creating the associated native object. /// /// This should only be used by subclasses created by this library or to - /// create copies for an [PigeonInternalInstanceManager]. + /// create copies for an [PigeonInstanceManager]. @protected ClassWithApiRequirement.pigeon_detached({ super.pigeon_binaryMessenger, @@ -5142,12 +5138,12 @@ class ClassWithApiRequirement extends PigeonInternalProxyApiBaseClass { static void pigeon_setUpMessageHandlers({ bool pigeon_clearHandlers = false, BinaryMessenger? pigeon_binaryMessenger, - PigeonInternalInstanceManager? pigeon_instanceManager, + PigeonInstanceManager? pigeon_instanceManager, ClassWithApiRequirement Function()? pigeon_newInstance, }) { final _PigeonInternalProxyApiBaseCodec pigeonChannelCodec = _PigeonInternalProxyApiBaseCodec( - pigeon_instanceManager ?? PigeonInternalInstanceManager.instance); + pigeon_instanceManager ?? PigeonInstanceManager.instance); final BinaryMessenger? binaryMessenger = pigeon_binaryMessenger; { final BasicMessageChannel< @@ -5167,7 +5163,7 @@ class ClassWithApiRequirement extends PigeonInternalProxyApiBaseClass { assert(arg_pigeon_instanceIdentifier != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance was null, expected non-null int.'); try { - (pigeon_instanceManager ?? PigeonInternalInstanceManager.instance) + (pigeon_instanceManager ?? PigeonInstanceManager.instance) .addHostCreatedInstance( pigeon_newInstance?.call() ?? ClassWithApiRequirement.pigeon_detached( diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index dcf9839b8822..8ea60b4b558f 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -102,7 +102,7 @@ class ProxyApiTestsPigeonInstanceManager( // Host uses identifiers >= 2^16 and Dart is expected to use values n where, // 0 <= n < 2^16. private const val minHostCreatedIdentifier: Long = 65536 - private const val tag = "PigeonInternalInstanceManager" + private const val tag = "PigeonInstanceManager" /** * Instantiate a new manager with a listener for garbage collected weak references. @@ -259,7 +259,7 @@ class ProxyApiTestsPigeonInstanceManager( } } -/** Generated API for managing the Dart and native `PigeonInternalInstanceManager`s. */ +/** Generated API for managing the Dart and native `InstanceManager`s. */ private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { companion object { /** The codec used by ProxyApiTestsPigeonInstanceManagerApi. */ @@ -277,7 +277,7 @@ private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryM val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManagerApi.removeStrongReference", + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference", codec) if (instanceManager != null) { channel.setMessageHandler { message, reply -> @@ -300,7 +300,7 @@ private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryM val channel = BasicMessageChannel( binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManagerApi.clear", + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.clear", codec) if (instanceManager != null) { channel.setMessageHandler { _, reply -> @@ -322,7 +322,7 @@ private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryM fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) { val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManagerApi.removeStrongReference" + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) channel.send(listOf(identifierArg)) { if (it is List<*>) { From f0aa519bda1f79a4e2f64293d174d65663c6b04e Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Sat, 17 Aug 2024 16:22:59 -0400 Subject: [PATCH 61/77] fix tests --- .../test/instance_manager_test.dart | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/test/instance_manager_test.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/test/instance_manager_test.dart index 1b64950e0a97..f28cb077dea0 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/test/instance_manager_test.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/test/instance_manager_test.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This file specifically tests the test PigeonInternalInstanceManager generated by core_tests. +// This file specifically tests the test PigeonInstanceManager generated by core_tests. import 'package:flutter_test/flutter_test.dart'; import 'package:shared_test_plugin_code/src/generated/proxy_api_tests.gen.dart'; @@ -10,8 +10,8 @@ import 'package:shared_test_plugin_code/src/generated/proxy_api_tests.gen.dart'; void main() { group('InstanceManager', () { test('addHostCreatedInstance', () { - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager(onWeakReferenceRemoved: (_) {}); + final PigeonInstanceManager instanceManager = + PigeonInstanceManager(onWeakReferenceRemoved: (_) {}); final CopyableObject object = CopyableObject( pigeon_instanceManager: instanceManager, @@ -27,8 +27,8 @@ void main() { }); test('addHostCreatedInstance prevents already used objects and ids', () { - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager(onWeakReferenceRemoved: (_) {}); + final PigeonInstanceManager instanceManager = + PigeonInstanceManager(onWeakReferenceRemoved: (_) {}); final CopyableObject object = CopyableObject( pigeon_instanceManager: instanceManager, @@ -51,8 +51,8 @@ void main() { }); test('addFlutterCreatedInstance', () { - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager(onWeakReferenceRemoved: (_) {}); + final PigeonInstanceManager instanceManager = + PigeonInstanceManager(onWeakReferenceRemoved: (_) {}); final CopyableObject object = CopyableObject( pigeon_instanceManager: instanceManager, @@ -70,9 +70,8 @@ void main() { test('removeWeakReference', () { int? weakInstanceId; - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager( - onWeakReferenceRemoved: (int instanceId) { + final PigeonInstanceManager instanceManager = + PigeonInstanceManager(onWeakReferenceRemoved: (int instanceId) { weakInstanceId = instanceId; }); @@ -91,8 +90,8 @@ void main() { }); test('removeWeakReference removes only weak reference', () { - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager(onWeakReferenceRemoved: (_) {}); + final PigeonInstanceManager instanceManager = + PigeonInstanceManager(onWeakReferenceRemoved: (_) {}); final CopyableObject object = CopyableObject( pigeon_instanceManager: instanceManager, @@ -108,8 +107,8 @@ void main() { }); test('removeStrongReference', () { - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager(onWeakReferenceRemoved: (_) {}); + final PigeonInstanceManager instanceManager = + PigeonInstanceManager(onWeakReferenceRemoved: (_) {}); final CopyableObject object = CopyableObject( pigeon_instanceManager: instanceManager, @@ -122,8 +121,8 @@ void main() { }); test('removeStrongReference removes only strong reference', () { - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager(onWeakReferenceRemoved: (_) {}); + final PigeonInstanceManager instanceManager = + PigeonInstanceManager(onWeakReferenceRemoved: (_) {}); final CopyableObject object = CopyableObject( pigeon_instanceManager: instanceManager, @@ -138,8 +137,8 @@ void main() { }); test('getInstance can add a new weak reference', () { - final PigeonInternalInstanceManager instanceManager = - PigeonInternalInstanceManager(onWeakReferenceRemoved: (_) {}); + final PigeonInstanceManager instanceManager = + PigeonInstanceManager(onWeakReferenceRemoved: (_) {}); final CopyableObject object = CopyableObject( pigeon_instanceManager: instanceManager, From ccb1783bdf0c92effa3ae04ce1ca552585e90a47 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Sat, 17 Aug 2024 16:43:03 -0400 Subject: [PATCH 62/77] fix unit tests --- packages/pigeon/test/dart/proxy_api_test.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/pigeon/test/dart/proxy_api_test.dart b/packages/pigeon/test/dart/proxy_api_test.dart index 8e7f230f7ed3..fd1d887189e3 100644 --- a/packages/pigeon/test/dart/proxy_api_test.dart +++ b/packages/pigeon/test/dart/proxy_api_test.dart @@ -80,7 +80,7 @@ void main() { final String collapsedCode = _collapseNewlineAndIndentation(code); // Instance Manager - expect(code, contains(r'class PigeonInternalInstanceManager')); + expect(code, contains(r'class PigeonInstanceManager')); expect(code, contains(r'class _PigeonInternalInstanceManagerApi')); // Base Api class @@ -158,13 +158,13 @@ void main() { expect( code, contains( - 'dev.flutter.pigeon.$DEFAULT_PACKAGE_NAME.PigeonInternalInstanceManagerApi.removeStrongReference', + 'dev.flutter.pigeon.$DEFAULT_PACKAGE_NAME.PigeonInternalInstanceManager.removeStrongReference', ), ); expect( collapsedCode, contains( - '(instanceManager ?? PigeonInternalInstanceManager.instance) .remove(arg_identifier!);', + '(instanceManager ?? PigeonInstanceManager.instance) .remove(arg_identifier!);', ), ); @@ -172,7 +172,7 @@ void main() { expect( code, contains( - 'dev.flutter.pigeon.$DEFAULT_PACKAGE_NAME.PigeonInternalInstanceManagerApi.clear', + 'dev.flutter.pigeon.$DEFAULT_PACKAGE_NAME.PigeonInternalInstanceManager.clear', ), ); }); @@ -890,7 +890,7 @@ void main() { collapsedCode, contains( r'static Future doSomething({ BinaryMessenger? pigeon_binaryMessenger, ' - r'PigeonInternalInstanceManager? pigeon_instanceManager, })', + r'PigeonInstanceManager? pigeon_instanceManager, })', ), ); expect( From 0a2a64351b5637563ff0ae8a54700d5d9ef8f868 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Sat, 17 Aug 2024 18:21:43 -0400 Subject: [PATCH 63/77] fix log name --- packages/pigeon/lib/kotlin_generator.dart | 2 +- .../main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index d114e9837b5a..5e777947978e 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -1368,7 +1368,7 @@ if (wrapped == null) { api.removeStrongReference(identifier) { if (it.isFailure) { Log.e( - "${classNamePrefix}ProxyApiRegistrar", + "${proxyApiClassNamePrefix}ProxyApiRegistrar", "Failed to remove Dart strong reference with identifier: \$identifier" ) } diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 8ea60b4b558f..c0ef07c43af1 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -365,7 +365,7 @@ abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryM api.removeStrongReference(identifier) { if (it.isFailure) { Log.e( - "PigeonInternalProxyApiRegistrar", + "PigeonProxyApiRegistrar", "Failed to remove Dart strong reference with identifier: $identifier") } } From cc55be5728847cb03cf58b7e98a27853a03f2d7e Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 26 Aug 2024 15:48:56 -0400 Subject: [PATCH 64/77] regen code --- packages/pigeon/lib/dart_generator.dart | 3 +- .../example/test_plugin/ProxyApiTests.gen.kt | 46 ++++++++----------- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/packages/pigeon/lib/dart_generator.dart b/packages/pigeon/lib/dart_generator.dart index b7266e9d3079..1d0e5499cc57 100644 --- a/packages/pigeon/lib/dart_generator.dart +++ b/packages/pigeon/lib/dart_generator.dart @@ -630,7 +630,8 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; ], returnType: const TypeDeclaration.voidDeclaration(), channelName: makeRemoveStrongReferenceChannelName( - dartPackageName), + dartPackageName, + ), isMockHandler: false, isAsynchronous: false, nullHandlerExpression: diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index c0ef07c43af1..70a7de3d04ee 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -282,7 +282,7 @@ private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryM if (instanceManager != null) { channel.setMessageHandler { message, reply -> val args = message as List - val identifierArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val identifierArg = args[0] as Long val wrapped: List = try { instanceManager.remove(identifierArg) @@ -486,7 +486,7 @@ private open class ProxyApiTestsPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as Int?)?.let { ProxyApiTestEnum.ofRaw(it) } + return (readValue(buffer) as Long?)?.let { ProxyApiTestEnum.ofRaw(it.toInt()) } } else -> super.readValueOfType(type, buffer) } @@ -1021,10 +1021,9 @@ abstract class PigeonApiProxyApiTestClass( if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val pigeon_identifierArg = args[0] as Long val aBoolArg = args[1] as Boolean - val anIntArg = args[2].let { num -> if (num is Int) num.toLong() else num as Long } + val anIntArg = args[2] as Long val aDoubleArg = args[3] as Double val aStringArg = args[4] as String val aUint8ListArg = args[5] as ByteArray @@ -1033,8 +1032,7 @@ abstract class PigeonApiProxyApiTestClass( val anEnumArg = args[8] as ProxyApiTestEnum val aProxyApiArg = args[9] as com.example.test_plugin.ProxyApiSuperClass val aNullableBoolArg = args[10] as Boolean? - val aNullableIntArg = - args[11].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = args[11] as Long? val aNullableDoubleArg = args[12] as Double? val aNullableStringArg = args[13] as String? val aNullableUint8ListArg = args[14] as ByteArray? @@ -1043,7 +1041,7 @@ abstract class PigeonApiProxyApiTestClass( val aNullableEnumArg = args[17] as ProxyApiTestEnum? val aNullableProxyApiArg = args[18] as com.example.test_plugin.ProxyApiSuperClass? val boolParamArg = args[19] as Boolean - val intParamArg = args[20].let { num -> if (num is Int) num.toLong() else num as Long } + val intParamArg = args[20] as Long val doubleParamArg = args[21] as Double val stringParamArg = args[22] as String val aUint8ListParamArg = args[23] as ByteArray @@ -1052,8 +1050,7 @@ abstract class PigeonApiProxyApiTestClass( val enumParamArg = args[26] as ProxyApiTestEnum val proxyApiParamArg = args[27] as com.example.test_plugin.ProxyApiSuperClass val nullableBoolParamArg = args[28] as Boolean? - val nullableIntParamArg = - args[29].let { num -> if (num is Int) num.toLong() else num as Long? } + val nullableIntParamArg = args[29] as Long? val nullableDoubleParamArg = args[30] as Double? val nullableStringParamArg = args[31] as String? val nullableUint8ListParamArg = args[32] as ByteArray? @@ -1122,8 +1119,7 @@ abstract class PigeonApiProxyApiTestClass( channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val pigeon_identifierArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long } + val pigeon_identifierArg = args[1] as Long val wrapped: List = try { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( @@ -1147,8 +1143,7 @@ abstract class PigeonApiProxyApiTestClass( if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val pigeon_identifierArg = args[0] as Long val wrapped: List = try { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( @@ -1263,7 +1258,7 @@ abstract class PigeonApiProxyApiTestClass( channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } + val anIntArg = args[1] as Long val wrapped: List = try { listOf(api.echoInt(pigeon_instanceArg, anIntArg)) @@ -1539,8 +1534,7 @@ abstract class PigeonApiProxyApiTestClass( channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aNullableIntArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = args[1] as Long? val wrapped: List = try { listOf(api.echoNullableInt(pigeon_instanceArg, aNullableIntArg)) @@ -1793,7 +1787,7 @@ abstract class PigeonApiProxyApiTestClass( channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } + val anIntArg = args[1] as Long api.echoAsyncInt(pigeon_instanceArg, anIntArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { @@ -2089,7 +2083,7 @@ abstract class PigeonApiProxyApiTestClass( channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val anIntArg = args[1] as Long? api.echoAsyncNullableInt(pigeon_instanceArg, anIntArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { @@ -2476,7 +2470,7 @@ abstract class PigeonApiProxyApiTestClass( channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } + val anIntArg = args[1] as Long api.callFlutterEchoInt(pigeon_instanceArg, anIntArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { @@ -2758,7 +2752,7 @@ abstract class PigeonApiProxyApiTestClass( channel.setMessageHandler { message, reply -> val args = message as List val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anIntArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val anIntArg = args[1] as Long? api.callFlutterEchoNullableInt(pigeon_instanceArg, anIntArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { @@ -3237,7 +3231,7 @@ abstract class PigeonApiProxyApiTestClass( "Flutter api returned null value for non-null return value.", ""))) } else { - val output = it[0].let { num -> if (num is Int) num.toLong() else num as Long } + val output = it[0] as Long callback(Result.success(output)) } } else { @@ -3662,7 +3656,7 @@ abstract class PigeonApiProxyApiTestClass( Result.failure( ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) } else { - val output = it[0].let { num -> if (num is Int) num.toLong() else num as Long? } + val output = it[0] as Long? callback(Result.success(output)) } } else { @@ -4007,8 +4001,7 @@ abstract class PigeonApiProxyApiSuperClass( if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val pigeon_identifierArg = args[0] as Long val wrapped: List = try { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( @@ -4182,8 +4175,7 @@ abstract class PigeonApiClassWithApiRequirement( if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val pigeon_identifierArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val pigeon_identifierArg = args[0] as Long val wrapped: List = try { api.pigeonRegistrar.instanceManager.addDartCreatedInstance( From 41fca507d2e5b9e017d232e6f07ae33847580c71 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 26 Aug 2024 19:53:08 -0400 Subject: [PATCH 65/77] try lowering version --- packages/pigeon/platform_tests/test_plugin/android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pigeon/platform_tests/test_plugin/android/build.gradle b/packages/pigeon/platform_tests/test_plugin/android/build.gradle index 51b83c6752bc..45bfa87d931b 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/build.gradle +++ b/packages/pigeon/platform_tests/test_plugin/android/build.gradle @@ -2,7 +2,7 @@ group 'com.example.test_plugin' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '2.0.20' + ext.kotlin_version = '2.0.10' repositories { google() mavenCentral() From 78e1e48d8df6cb845b3a54ad2d66d9444f3428e3 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 26 Aug 2024 20:59:30 -0400 Subject: [PATCH 66/77] fix codec name in instancemanagerapi --- packages/pigeon/lib/dart_generator.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pigeon/lib/dart_generator.dart b/packages/pigeon/lib/dart_generator.dart index 1d0e5499cc57..1746a120240b 100644 --- a/packages/pigeon/lib/dart_generator.dart +++ b/packages/pigeon/lib/dart_generator.dart @@ -584,7 +584,7 @@ final BinaryMessenger? ${varNamePrefix}binaryMessenger; ..type = cb.refer('MessageCodec') ..static = true ..modifier = cb.FieldModifier.constant - ..assignment = const cb.Code('StandardMessageCodec()'); + ..assignment = const cb.Code('$_pigeonCodec()'); }, ) ], From e8448752eaed2172f9e4faa9bb840245cac7660a Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:02:56 -0400 Subject: [PATCH 67/77] fix kotlin api too --- packages/pigeon/lib/kotlin_generator.dart | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index c46f0ca62933..aaeae4b1675e 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -673,10 +673,15 @@ if (wrapped == null) { ['The codec used by $instanceManagerApiName.'], _docCommentSpec, ); - indent.writeScoped('val codec: MessageCodec by lazy {', '}', - () { - indent.writeln('StandardMessageCodec()'); - }); + indent.writeScoped( + 'val codec: MessageCodec by lazy {', + '}', + () { + indent.writeln( + '${generatorOptions.fileSpecificClassNameComponent}$_codecName()', + ); + }, + ); indent.newln(); addDocumentationComments( From af2965fef60330265c200bcb95780ce967d69762 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:05:29 -0400 Subject: [PATCH 68/77] regen --- .../lib/src/generated/proxy_api_tests.gen.dart | 3 +-- .../main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart index 43a71775e53b..eb40693a844b 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart @@ -292,8 +292,7 @@ class _PigeonInternalInstanceManagerApi { final BinaryMessenger? pigeonVar_binaryMessenger; - static const MessageCodec pigeonChannelCodec = - StandardMessageCodec(); + static const MessageCodec pigeonChannelCodec = _PigeonCodec(); static void setUpMessageHandlers({ bool pigeon_clearHandlers = false, diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 70a7de3d04ee..f65de6cbb743 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -263,7 +263,7 @@ class ProxyApiTestsPigeonInstanceManager( private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { companion object { /** The codec used by ProxyApiTestsPigeonInstanceManagerApi. */ - val codec: MessageCodec by lazy { StandardMessageCodec() } + val codec: MessageCodec by lazy { ProxyApiTestsPigeonCodec() } /** * Sets up an instance of `ProxyApiTestsPigeonInstanceManagerApi` to handle messages from the From 25d4515791cff11554d868b655bf858fb268009a Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 27 Aug 2024 14:58:45 -0400 Subject: [PATCH 69/77] raise version again --- packages/pigeon/platform_tests/test_plugin/android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pigeon/platform_tests/test_plugin/android/build.gradle b/packages/pigeon/platform_tests/test_plugin/android/build.gradle index 45bfa87d931b..51b83c6752bc 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/build.gradle +++ b/packages/pigeon/platform_tests/test_plugin/android/build.gradle @@ -2,7 +2,7 @@ group 'com.example.test_plugin' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '2.0.10' + ext.kotlin_version = '2.0.20' repositories { google() mavenCentral() From 676eb05fabd5185c0a246ac4384b251b95ac29b2 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Tue, 27 Aug 2024 15:30:55 -0400 Subject: [PATCH 70/77] some docs --- packages/pigeon/lib/generator_tools.dart | 7 + .../kotlin/com/example/test_plugin/.gitignore | 3 +- .../example/test_plugin/ProxyApiTests.gen.kt | 4292 ----------------- 3 files changed, 9 insertions(+), 4293 deletions(-) delete mode 100644 packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index 55ff72c4c3b4..da92a84690b2 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -450,6 +450,13 @@ const List validTypes = [ ]; /// The dedicated key for accessing an InstanceManager in ProxyApi base codecs. +/// +/// Generated codecs override the `StandardMessageCodec` which reserves the byte +/// keys of 0-127, so this value is chosen because it is the lowest available +/// key. +/// +/// See https://api.flutter.dev/flutter/services/StandardMessageCodec/writeValue.html +/// for more information on keys in MessageCodecs. const int proxyApiCodecInstanceManagerKey = 128; /// Custom codecs' custom types are enumerations begin at this number to diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/.gitignore b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/.gitignore index 4ec9cb9997ad..2969275b55b5 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/.gitignore +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/.gitignore @@ -4,5 +4,6 @@ *.kt !TestPlugin.kt !CoreTests.gen.kt +# This contains the declaration of the test classes wrapped by the ProxyApi tests and the +# implemetations of their APIs. !ProxyApiTestApiImpls.kt -!ProxyApiTests.gen.kt diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt deleted file mode 100644 index f65de6cbb743..000000000000 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ /dev/null @@ -1,4292 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// -// Autogenerated from Pigeon, do not edit directly. -// See also: https://pub.dev/packages/pigeon -@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") - -package com.example.test_plugin - -import android.util.Log -import io.flutter.plugin.common.BasicMessageChannel -import io.flutter.plugin.common.BinaryMessenger -import io.flutter.plugin.common.MessageCodec -import io.flutter.plugin.common.StandardMessageCodec -import java.io.ByteArrayOutputStream -import java.nio.ByteBuffer - -private fun wrapResult(result: Any?): List { - return listOf(result) -} - -private fun wrapError(exception: Throwable): List { - return if (exception is ProxyApiTestsError) { - listOf(exception.code, exception.message, exception.details) - } else { - listOf( - exception.javaClass.simpleName, - exception.toString(), - "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)) - } -} - -private fun createConnectionError(channelName: String): ProxyApiTestsError { - return ProxyApiTestsError( - "channel-error", "Unable to establish connection on channel: '$channelName'.", "") -} - -/** - * Error class for passing custom error details to Flutter via a thrown PlatformException. - * - * @property code The error code. - * @property message The error message. - * @property details The error details. Must be a datatype supported by the api codec. - */ -class ProxyApiTestsError( - val code: String, - override val message: String? = null, - val details: Any? = null -) : Throwable() -/** - * Maintains instances used to communicate with the corresponding objects in Dart. - * - * Objects stored in this container are represented by an object in Dart that is also stored in an - * InstanceManager with the same identifier. - * - * When an instance is added with an identifier, either can be used to retrieve the other. - * - * Added instances are added as a weak reference and a strong reference. When the strong reference - * is removed with [remove] and the weak reference is deallocated, the - * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the - * strong reference is removed and then the identifier is retrieved with the intention to pass the - * identifier to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the - * instance is recreated. The strong reference will then need to be removed manually again. - */ -@Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") -class ProxyApiTestsPigeonInstanceManager( - private val finalizationListener: PigeonFinalizationListener -) { - /** Interface for listening when a weak reference of an instance is removed from the manager. */ - interface PigeonFinalizationListener { - fun onFinalize(identifier: Long) - } - - private val identifiers = java.util.WeakHashMap() - private val weakInstances = HashMap>() - private val strongInstances = HashMap() - private val referenceQueue = java.lang.ref.ReferenceQueue() - private val weakReferencesToIdentifiers = HashMap, Long>() - private val handler = android.os.Handler(android.os.Looper.getMainLooper()) - private var nextIdentifier: Long = minHostCreatedIdentifier - private var hasFinalizationListenerStopped = false - - /** - * Modifies the time interval used to define how often this instance removes garbage collected - * weak references to native Android objects that this instance was managing. - */ - var clearFinalizedWeakReferencesInterval: Long = 3000 - set(value) { - handler.removeCallbacks { this.releaseAllFinalizedInstances() } - field = value - releaseAllFinalizedInstances() - } - - init { - handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) - } - - companion object { - // Identifiers are locked to a specific range to avoid collisions with objects - // created simultaneously from Dart. - // Host uses identifiers >= 2^16 and Dart is expected to use values n where, - // 0 <= n < 2^16. - private const val minHostCreatedIdentifier: Long = 65536 - private const val tag = "PigeonInstanceManager" - - /** - * Instantiate a new manager with a listener for garbage collected weak references. - * - * When the manager is no longer needed, [stopFinalizationListener] must be called. - */ - fun create( - finalizationListener: PigeonFinalizationListener - ): ProxyApiTestsPigeonInstanceManager { - return ProxyApiTestsPigeonInstanceManager(finalizationListener) - } - } - - /** - * Removes `identifier` and return its associated strongly referenced instance, if present, from - * the manager. - */ - fun remove(identifier: Long): T? { - logWarningIfFinalizationListenerHasStopped() - return strongInstances.remove(identifier) as T? - } - - /** - * Retrieves the identifier paired with an instance, if present, otherwise `null`. - * - * If the manager contains a strong reference to `instance`, it will return the identifier - * associated with `instance`. If the manager contains only a weak reference to `instance`, a new - * strong reference to `instance` will be added and will need to be removed again with [remove]. - * - * If this method returns a nonnull identifier, this method also expects the Dart - * `ProxyApiTestsPigeonInstanceManager` to have, or recreate, a weak reference to the Dart - * instance the identifier is associated with. - */ - fun getIdentifierForStrongReference(instance: Any?): Long? { - logWarningIfFinalizationListenerHasStopped() - val identifier = identifiers[instance] - if (identifier != null) { - strongInstances[identifier] = instance!! - } - return identifier - } - - /** - * Adds a new instance that was instantiated from Dart. - * - * The same instance can be added multiple times, but each identifier must be unique. This allows - * two objects that are equivalent (e.g. the `equals` method returns true and their hashcodes are - * equal) to both be added. - * - * [identifier] must be >= 0 and unique. - */ - fun addDartCreatedInstance(instance: Any, identifier: Long) { - logWarningIfFinalizationListenerHasStopped() - addInstance(instance, identifier) - } - - /** - * Adds a new unique instance that was instantiated from the host platform. - * - * [identifier] must be >= 0 and unique. - */ - fun addHostCreatedInstance(instance: Any): Long { - logWarningIfFinalizationListenerHasStopped() - require(!containsInstance(instance)) { - "Instance of ${instance.javaClass} has already been added." - } - val identifier = nextIdentifier++ - addInstance(instance, identifier) - return identifier - } - - /** Retrieves the instance associated with identifier, if present, otherwise `null`. */ - fun getInstance(identifier: Long): T? { - logWarningIfFinalizationListenerHasStopped() - val instance = weakInstances[identifier] as java.lang.ref.WeakReference? - return instance?.get() - } - - /** Returns whether this manager contains the given `instance`. */ - fun containsInstance(instance: Any?): Boolean { - logWarningIfFinalizationListenerHasStopped() - return identifiers.containsKey(instance) - } - - /** - * Stops the periodic run of the [PigeonFinalizationListener] for instances that have been garbage - * collected. - * - * The InstanceManager can continue to be used, but the [PigeonFinalizationListener] will no - * longer be called and methods will log a warning. - */ - fun stopFinalizationListener() { - handler.removeCallbacks { this.releaseAllFinalizedInstances() } - hasFinalizationListenerStopped = true - } - - /** - * Removes all of the instances from this manager. - * - * The manager will be empty after this call returns. - */ - fun clear() { - identifiers.clear() - weakInstances.clear() - strongInstances.clear() - weakReferencesToIdentifiers.clear() - } - - /** - * Whether the [PigeonFinalizationListener] is still being called for instances that are garbage - * collected. - * - * See [stopFinalizationListener]. - */ - fun hasFinalizationListenerStopped(): Boolean { - return hasFinalizationListenerStopped - } - - private fun releaseAllFinalizedInstances() { - if (hasFinalizationListenerStopped()) { - return - } - var reference: java.lang.ref.WeakReference? - while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != - null) { - val identifier = weakReferencesToIdentifiers.remove(reference) - if (identifier != null) { - weakInstances.remove(identifier) - strongInstances.remove(identifier) - finalizationListener.onFinalize(identifier) - } - } - handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) - } - - private fun addInstance(instance: Any, identifier: Long) { - require(identifier >= 0) { "Identifier must be >= 0: $identifier" } - require(!weakInstances.containsKey(identifier)) { - "Identifier has already been added: $identifier" - } - val weakReference = java.lang.ref.WeakReference(instance, referenceQueue) - identifiers[instance] = identifier - weakInstances[identifier] = weakReference - weakReferencesToIdentifiers[weakReference] = identifier - strongInstances[identifier] = instance - } - - private fun logWarningIfFinalizationListenerHasStopped() { - if (hasFinalizationListenerStopped()) { - Log.w( - tag, - "The manager was used after calls to the PigeonFinalizationListener has been stopped.") - } - } -} - -/** Generated API for managing the Dart and native `InstanceManager`s. */ -private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { - companion object { - /** The codec used by ProxyApiTestsPigeonInstanceManagerApi. */ - val codec: MessageCodec by lazy { ProxyApiTestsPigeonCodec() } - - /** - * Sets up an instance of `ProxyApiTestsPigeonInstanceManagerApi` to handle messages from the - * `binaryMessenger`. - */ - fun setUpMessageHandlers( - binaryMessenger: BinaryMessenger, - instanceManager: ProxyApiTestsPigeonInstanceManager? - ) { - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference", - codec) - if (instanceManager != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val identifierArg = args[0] as Long - val wrapped: List = - try { - instanceManager.remove(identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.clear", - codec) - if (instanceManager != null) { - channel.setMessageHandler { _, reply -> - val wrapped: List = - try { - instanceManager.clear() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - } - } - - fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) { - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(identifierArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } -} -/** - * Provides implementations for each ProxyApi implementation and provides access to resources needed - * by any implementation. - */ -abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { - /** Whether APIs should ignore calling to Dart. */ - public var ignoreCallsToDart = false - val instanceManager: ProxyApiTestsPigeonInstanceManager - private var _codec: StandardMessageCodec? = null - val codec: StandardMessageCodec - get() { - if (_codec == null) { - _codec = ProxyApiTestsPigeonProxyApiBaseCodec(this) - } - return _codec!! - } - - init { - val api = ProxyApiTestsPigeonInstanceManagerApi(binaryMessenger) - instanceManager = - ProxyApiTestsPigeonInstanceManager.create( - object : ProxyApiTestsPigeonInstanceManager.PigeonFinalizationListener { - override fun onFinalize(identifier: Long) { - api.removeStrongReference(identifier) { - if (it.isFailure) { - Log.e( - "PigeonProxyApiRegistrar", - "Failed to remove Dart strong reference with identifier: $identifier") - } - } - } - }) - } - /** - * An implementation of [PigeonApiProxyApiTestClass] used to add a new Dart instance of - * `ProxyApiTestClass` to the Dart `InstanceManager`. - */ - abstract fun getPigeonApiProxyApiTestClass(): PigeonApiProxyApiTestClass - - /** - * An implementation of [PigeonApiProxyApiSuperClass] used to add a new Dart instance of - * `ProxyApiSuperClass` to the Dart `InstanceManager`. - */ - abstract fun getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass - - /** - * An implementation of [PigeonApiProxyApiInterface] used to add a new Dart instance of - * `ProxyApiInterface` to the Dart `InstanceManager`. - */ - open fun getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { - return PigeonApiProxyApiInterface(this) - } - - /** - * An implementation of [PigeonApiClassWithApiRequirement] used to add a new Dart instance of - * `ClassWithApiRequirement` to the Dart `InstanceManager`. - */ - abstract fun getPigeonApiClassWithApiRequirement(): PigeonApiClassWithApiRequirement - - fun setUp() { - ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager) - PigeonApiProxyApiTestClass.setUpMessageHandlers( - binaryMessenger, getPigeonApiProxyApiTestClass()) - PigeonApiProxyApiSuperClass.setUpMessageHandlers( - binaryMessenger, getPigeonApiProxyApiSuperClass()) - PigeonApiClassWithApiRequirement.setUpMessageHandlers( - binaryMessenger, getPigeonApiClassWithApiRequirement()) - } - - fun tearDown() { - ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null) - PigeonApiProxyApiTestClass.setUpMessageHandlers(binaryMessenger, null) - PigeonApiProxyApiSuperClass.setUpMessageHandlers(binaryMessenger, null) - PigeonApiClassWithApiRequirement.setUpMessageHandlers(binaryMessenger, null) - } -} - -private class ProxyApiTestsPigeonProxyApiBaseCodec( - val registrar: ProxyApiTestsPigeonProxyApiRegistrar -) : ProxyApiTestsPigeonCodec() { - override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { - return when (type) { - 128.toByte() -> { - return registrar.instanceManager.getInstance( - readValue(buffer).let { if (it is Int) it.toLong() else it as Long }) - } - else -> super.readValueOfType(type, buffer) - } - } - - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { - if (value is Boolean || - value is ByteArray || - value is Double || - value is DoubleArray || - value is FloatArray || - value is Int || - value is IntArray || - value is List<*> || - value is Long || - value is LongArray || - value is Map<*, *> || - value is String || - value is ProxyApiTestEnum || - value == null) { - super.writeValue(stream, value) - return - } - - if (value is ProxyApiTestClass) { - registrar.getPigeonApiProxyApiTestClass().pigeon_newInstance(value) {} - } else if (value is com.example.test_plugin.ProxyApiSuperClass) { - registrar.getPigeonApiProxyApiSuperClass().pigeon_newInstance(value) {} - } else if (value is ProxyApiInterface) { - registrar.getPigeonApiProxyApiInterface().pigeon_newInstance(value) {} - } else if (android.os.Build.VERSION.SDK_INT >= 25 && value is ClassWithApiRequirement) { - registrar.getPigeonApiClassWithApiRequirement().pigeon_newInstance(value) {} - } - - when { - registrar.instanceManager.containsInstance(value) -> { - stream.write(128) - writeValue(stream, registrar.instanceManager.getIdentifierForStrongReference(value)) - } - else -> - throw IllegalArgumentException( - "Unsupported value: '$value' of type '${value.javaClass.name}'") - } - } -} - -enum class ProxyApiTestEnum(val raw: Int) { - ONE(0), - TWO(1), - THREE(2); - - companion object { - fun ofRaw(raw: Int): ProxyApiTestEnum? { - return values().firstOrNull { it.raw == raw } - } - } -} - -private open class ProxyApiTestsPigeonCodec : StandardMessageCodec() { - override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { - return when (type) { - 129.toByte() -> { - return (readValue(buffer) as Long?)?.let { ProxyApiTestEnum.ofRaw(it.toInt()) } - } - else -> super.readValueOfType(type, buffer) - } - } - - override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { - when (value) { - is ProxyApiTestEnum -> { - stream.write(129) - writeValue(stream, value.raw) - } - else -> super.writeValue(stream, value) - } - } -} - -/** - * The core ProxyApi test class that each supported host language must implement in platform_tests - * integration tests. - */ -@Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiTestClass( - open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar -) { - abstract fun pigeon_defaultConstructor( - aBool: Boolean, - anInt: Long, - aDouble: Double, - aString: String, - aUint8List: ByteArray, - aList: List, - aMap: Map, - anEnum: ProxyApiTestEnum, - aProxyApi: com.example.test_plugin.ProxyApiSuperClass, - aNullableBool: Boolean?, - aNullableInt: Long?, - aNullableDouble: Double?, - aNullableString: String?, - aNullableUint8List: ByteArray?, - aNullableList: List?, - aNullableMap: Map?, - aNullableEnum: ProxyApiTestEnum?, - aNullableProxyApi: com.example.test_plugin.ProxyApiSuperClass?, - boolParam: Boolean, - intParam: Long, - doubleParam: Double, - stringParam: String, - aUint8ListParam: ByteArray, - listParam: List, - mapParam: Map, - enumParam: ProxyApiTestEnum, - proxyApiParam: com.example.test_plugin.ProxyApiSuperClass, - nullableBoolParam: Boolean?, - nullableIntParam: Long?, - nullableDoubleParam: Double?, - nullableStringParam: String?, - nullableUint8ListParam: ByteArray?, - nullableListParam: List?, - nullableMapParam: Map?, - nullableEnumParam: ProxyApiTestEnum?, - nullableProxyApiParam: com.example.test_plugin.ProxyApiSuperClass? - ): ProxyApiTestClass - - abstract fun attachedField( - pigeon_instance: ProxyApiTestClass - ): com.example.test_plugin.ProxyApiSuperClass - - abstract fun staticAttachedField(): com.example.test_plugin.ProxyApiSuperClass - - abstract fun aBool(pigeon_instance: ProxyApiTestClass): Boolean - - abstract fun anInt(pigeon_instance: ProxyApiTestClass): Long - - abstract fun aDouble(pigeon_instance: ProxyApiTestClass): Double - - abstract fun aString(pigeon_instance: ProxyApiTestClass): String - - abstract fun aUint8List(pigeon_instance: ProxyApiTestClass): ByteArray - - abstract fun aList(pigeon_instance: ProxyApiTestClass): List - - abstract fun aMap(pigeon_instance: ProxyApiTestClass): Map - - abstract fun anEnum(pigeon_instance: ProxyApiTestClass): ProxyApiTestEnum - - abstract fun aProxyApi( - pigeon_instance: ProxyApiTestClass - ): com.example.test_plugin.ProxyApiSuperClass - - abstract fun aNullableBool(pigeon_instance: ProxyApiTestClass): Boolean? - - abstract fun aNullableInt(pigeon_instance: ProxyApiTestClass): Long? - - abstract fun aNullableDouble(pigeon_instance: ProxyApiTestClass): Double? - - abstract fun aNullableString(pigeon_instance: ProxyApiTestClass): String? - - abstract fun aNullableUint8List(pigeon_instance: ProxyApiTestClass): ByteArray? - - abstract fun aNullableList(pigeon_instance: ProxyApiTestClass): List? - - abstract fun aNullableMap(pigeon_instance: ProxyApiTestClass): Map? - - abstract fun aNullableEnum(pigeon_instance: ProxyApiTestClass): ProxyApiTestEnum? - - abstract fun aNullableProxyApi( - pigeon_instance: ProxyApiTestClass - ): com.example.test_plugin.ProxyApiSuperClass? - - /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ - abstract fun noop(pigeon_instance: ProxyApiTestClass) - - /** Returns an error, to test error handling. */ - abstract fun throwError(pigeon_instance: ProxyApiTestClass): Any? - - /** Returns an error from a void function, to test error handling. */ - abstract fun throwErrorFromVoid(pigeon_instance: ProxyApiTestClass) - - /** Returns a Flutter error, to test error handling. */ - abstract fun throwFlutterError(pigeon_instance: ProxyApiTestClass): Any? - - /** Returns passed in int. */ - abstract fun echoInt(pigeon_instance: ProxyApiTestClass, anInt: Long): Long - - /** Returns passed in double. */ - abstract fun echoDouble(pigeon_instance: ProxyApiTestClass, aDouble: Double): Double - - /** Returns the passed in boolean. */ - abstract fun echoBool(pigeon_instance: ProxyApiTestClass, aBool: Boolean): Boolean - - /** Returns the passed in string. */ - abstract fun echoString(pigeon_instance: ProxyApiTestClass, aString: String): String - - /** Returns the passed in Uint8List. */ - abstract fun echoUint8List(pigeon_instance: ProxyApiTestClass, aUint8List: ByteArray): ByteArray - - /** Returns the passed in generic Object. */ - abstract fun echoObject(pigeon_instance: ProxyApiTestClass, anObject: Any): Any - - /** Returns the passed list, to test serialization and deserialization. */ - abstract fun echoList(pigeon_instance: ProxyApiTestClass, aList: List): List - - /** Returns the passed list with ProxyApis, to test serialization and deserialization. */ - abstract fun echoProxyApiList( - pigeon_instance: ProxyApiTestClass, - aList: List - ): List - - /** Returns the passed map, to test serialization and deserialization. */ - abstract fun echoMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map - ): Map - - /** Returns the passed map with ProxyApis, to test serialization and deserialization. */ - abstract fun echoProxyApiMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map - ): Map - - /** Returns the passed enum to test serialization and deserialization. */ - abstract fun echoEnum( - pigeon_instance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum - ): ProxyApiTestEnum - - /** Returns the passed ProxyApi to test serialization and deserialization. */ - abstract fun echoProxyApi( - pigeon_instance: ProxyApiTestClass, - aProxyApi: com.example.test_plugin.ProxyApiSuperClass - ): com.example.test_plugin.ProxyApiSuperClass - - /** Returns passed in int. */ - abstract fun echoNullableInt(pigeon_instance: ProxyApiTestClass, aNullableInt: Long?): Long? - - /** Returns passed in double. */ - abstract fun echoNullableDouble( - pigeon_instance: ProxyApiTestClass, - aNullableDouble: Double? - ): Double? - - /** Returns the passed in boolean. */ - abstract fun echoNullableBool( - pigeon_instance: ProxyApiTestClass, - aNullableBool: Boolean? - ): Boolean? - - /** Returns the passed in string. */ - abstract fun echoNullableString( - pigeon_instance: ProxyApiTestClass, - aNullableString: String? - ): String? - - /** Returns the passed in Uint8List. */ - abstract fun echoNullableUint8List( - pigeon_instance: ProxyApiTestClass, - aNullableUint8List: ByteArray? - ): ByteArray? - - /** Returns the passed in generic Object. */ - abstract fun echoNullableObject(pigeon_instance: ProxyApiTestClass, aNullableObject: Any?): Any? - - /** Returns the passed list, to test serialization and deserialization. */ - abstract fun echoNullableList( - pigeon_instance: ProxyApiTestClass, - aNullableList: List? - ): List? - - /** Returns the passed map, to test serialization and deserialization. */ - abstract fun echoNullableMap( - pigeon_instance: ProxyApiTestClass, - aNullableMap: Map? - ): Map? - - abstract fun echoNullableEnum( - pigeon_instance: ProxyApiTestClass, - aNullableEnum: ProxyApiTestEnum? - ): ProxyApiTestEnum? - - /** Returns the passed ProxyApi to test serialization and deserialization. */ - abstract fun echoNullableProxyApi( - pigeon_instance: ProxyApiTestClass, - aNullableProxyApi: com.example.test_plugin.ProxyApiSuperClass? - ): com.example.test_plugin.ProxyApiSuperClass? - - /** - * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous - * calling. - */ - abstract fun noopAsync(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) - - /** Returns passed in int asynchronously. */ - abstract fun echoAsyncInt( - pigeon_instance: ProxyApiTestClass, - anInt: Long, - callback: (Result) -> Unit - ) - - /** Returns passed in double asynchronously. */ - abstract fun echoAsyncDouble( - pigeon_instance: ProxyApiTestClass, - aDouble: Double, - callback: (Result) -> Unit - ) - - /** Returns the passed in boolean asynchronously. */ - abstract fun echoAsyncBool( - pigeon_instance: ProxyApiTestClass, - aBool: Boolean, - callback: (Result) -> Unit - ) - - /** Returns the passed string asynchronously. */ - abstract fun echoAsyncString( - pigeon_instance: ProxyApiTestClass, - aString: String, - callback: (Result) -> Unit - ) - - /** Returns the passed in Uint8List asynchronously. */ - abstract fun echoAsyncUint8List( - pigeon_instance: ProxyApiTestClass, - aUint8List: ByteArray, - callback: (Result) -> Unit - ) - - /** Returns the passed in generic Object asynchronously. */ - abstract fun echoAsyncObject( - pigeon_instance: ProxyApiTestClass, - anObject: Any, - callback: (Result) -> Unit - ) - - /** Returns the passed list, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncList( - pigeon_instance: ProxyApiTestClass, - aList: List, - callback: (Result>) -> Unit - ) - - /** Returns the passed map, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map, - callback: (Result>) -> Unit - ) - - /** Returns the passed enum, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncEnum( - pigeon_instance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum, - callback: (Result) -> Unit - ) - - /** Responds with an error from an async function returning a value. */ - abstract fun throwAsyncError(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) - - /** Responds with an error from an async void function. */ - abstract fun throwAsyncErrorFromVoid( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit - ) - - /** Responds with a Flutter error from an async function returning a value. */ - abstract fun throwAsyncFlutterError( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit - ) - - /** Returns passed in int asynchronously. */ - abstract fun echoAsyncNullableInt( - pigeon_instance: ProxyApiTestClass, - anInt: Long?, - callback: (Result) -> Unit - ) - - /** Returns passed in double asynchronously. */ - abstract fun echoAsyncNullableDouble( - pigeon_instance: ProxyApiTestClass, - aDouble: Double?, - callback: (Result) -> Unit - ) - - /** Returns the passed in boolean asynchronously. */ - abstract fun echoAsyncNullableBool( - pigeon_instance: ProxyApiTestClass, - aBool: Boolean?, - callback: (Result) -> Unit - ) - - /** Returns the passed string asynchronously. */ - abstract fun echoAsyncNullableString( - pigeon_instance: ProxyApiTestClass, - aString: String?, - callback: (Result) -> Unit - ) - - /** Returns the passed in Uint8List asynchronously. */ - abstract fun echoAsyncNullableUint8List( - pigeon_instance: ProxyApiTestClass, - aUint8List: ByteArray?, - callback: (Result) -> Unit - ) - - /** Returns the passed in generic Object asynchronously. */ - abstract fun echoAsyncNullableObject( - pigeon_instance: ProxyApiTestClass, - anObject: Any?, - callback: (Result) -> Unit - ) - - /** Returns the passed list, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncNullableList( - pigeon_instance: ProxyApiTestClass, - aList: List?, - callback: (Result?>) -> Unit - ) - - /** Returns the passed map, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncNullableMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map?, - callback: (Result?>) -> Unit - ) - - /** Returns the passed enum, to test asynchronous serialization and deserialization. */ - abstract fun echoAsyncNullableEnum( - pigeon_instance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum?, - callback: (Result) -> Unit - ) - - abstract fun staticNoop() - - abstract fun echoStaticString(aString: String): String - - abstract fun staticAsyncNoop(callback: (Result) -> Unit) - - abstract fun callFlutterNoop(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) - - abstract fun callFlutterThrowError( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit - ) - - abstract fun callFlutterThrowErrorFromVoid( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoBool( - pigeon_instance: ProxyApiTestClass, - aBool: Boolean, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoInt( - pigeon_instance: ProxyApiTestClass, - anInt: Long, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoDouble( - pigeon_instance: ProxyApiTestClass, - aDouble: Double, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoString( - pigeon_instance: ProxyApiTestClass, - aString: String, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoUint8List( - pigeon_instance: ProxyApiTestClass, - aUint8List: ByteArray, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoList( - pigeon_instance: ProxyApiTestClass, - aList: List, - callback: (Result>) -> Unit - ) - - abstract fun callFlutterEchoProxyApiList( - pigeon_instance: ProxyApiTestClass, - aList: List, - callback: (Result>) -> Unit - ) - - abstract fun callFlutterEchoMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map, - callback: (Result>) -> Unit - ) - - abstract fun callFlutterEchoProxyApiMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map, - callback: (Result>) -> Unit - ) - - abstract fun callFlutterEchoEnum( - pigeon_instance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoProxyApi( - pigeon_instance: ProxyApiTestClass, - aProxyApi: com.example.test_plugin.ProxyApiSuperClass, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoNullableBool( - pigeon_instance: ProxyApiTestClass, - aBool: Boolean?, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoNullableInt( - pigeon_instance: ProxyApiTestClass, - anInt: Long?, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoNullableDouble( - pigeon_instance: ProxyApiTestClass, - aDouble: Double?, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoNullableString( - pigeon_instance: ProxyApiTestClass, - aString: String?, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoNullableUint8List( - pigeon_instance: ProxyApiTestClass, - aUint8List: ByteArray?, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoNullableList( - pigeon_instance: ProxyApiTestClass, - aList: List?, - callback: (Result?>) -> Unit - ) - - abstract fun callFlutterEchoNullableMap( - pigeon_instance: ProxyApiTestClass, - aMap: Map?, - callback: (Result?>) -> Unit - ) - - abstract fun callFlutterEchoNullableEnum( - pigeon_instance: ProxyApiTestClass, - anEnum: ProxyApiTestEnum?, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoNullableProxyApi( - pigeon_instance: ProxyApiTestClass, - aProxyApi: com.example.test_plugin.ProxyApiSuperClass?, - callback: (Result) -> Unit - ) - - abstract fun callFlutterNoopAsync( - pigeon_instance: ProxyApiTestClass, - callback: (Result) -> Unit - ) - - abstract fun callFlutterEchoAsyncString( - pigeon_instance: ProxyApiTestClass, - aString: String, - callback: (Result) -> Unit - ) - - companion object { - @Suppress("LocalVariableName") - fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiTestClass?) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_defaultConstructor", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_identifierArg = args[0] as Long - val aBoolArg = args[1] as Boolean - val anIntArg = args[2] as Long - val aDoubleArg = args[3] as Double - val aStringArg = args[4] as String - val aUint8ListArg = args[5] as ByteArray - val aListArg = args[6] as List - val aMapArg = args[7] as Map - val anEnumArg = args[8] as ProxyApiTestEnum - val aProxyApiArg = args[9] as com.example.test_plugin.ProxyApiSuperClass - val aNullableBoolArg = args[10] as Boolean? - val aNullableIntArg = args[11] as Long? - val aNullableDoubleArg = args[12] as Double? - val aNullableStringArg = args[13] as String? - val aNullableUint8ListArg = args[14] as ByteArray? - val aNullableListArg = args[15] as List? - val aNullableMapArg = args[16] as Map? - val aNullableEnumArg = args[17] as ProxyApiTestEnum? - val aNullableProxyApiArg = args[18] as com.example.test_plugin.ProxyApiSuperClass? - val boolParamArg = args[19] as Boolean - val intParamArg = args[20] as Long - val doubleParamArg = args[21] as Double - val stringParamArg = args[22] as String - val aUint8ListParamArg = args[23] as ByteArray - val listParamArg = args[24] as List - val mapParamArg = args[25] as Map - val enumParamArg = args[26] as ProxyApiTestEnum - val proxyApiParamArg = args[27] as com.example.test_plugin.ProxyApiSuperClass - val nullableBoolParamArg = args[28] as Boolean? - val nullableIntParamArg = args[29] as Long? - val nullableDoubleParamArg = args[30] as Double? - val nullableStringParamArg = args[31] as String? - val nullableUint8ListParamArg = args[32] as ByteArray? - val nullableListParamArg = args[33] as List? - val nullableMapParamArg = args[34] as Map? - val nullableEnumParamArg = args[35] as ProxyApiTestEnum? - val nullableProxyApiParamArg = args[36] as com.example.test_plugin.ProxyApiSuperClass? - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.pigeon_defaultConstructor( - aBoolArg, - anIntArg, - aDoubleArg, - aStringArg, - aUint8ListArg, - aListArg, - aMapArg, - anEnumArg, - aProxyApiArg, - aNullableBoolArg, - aNullableIntArg, - aNullableDoubleArg, - aNullableStringArg, - aNullableUint8ListArg, - aNullableListArg, - aNullableMapArg, - aNullableEnumArg, - aNullableProxyApiArg, - boolParamArg, - intParamArg, - doubleParamArg, - stringParamArg, - aUint8ListParamArg, - listParamArg, - mapParamArg, - enumParamArg, - proxyApiParamArg, - nullableBoolParamArg, - nullableIntParamArg, - nullableDoubleParamArg, - nullableStringParamArg, - nullableUint8ListParamArg, - nullableListParamArg, - nullableMapParamArg, - nullableEnumParamArg, - nullableProxyApiParamArg), - pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.attachedField", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val pigeon_identifierArg = args[1] as Long - val wrapped: List = - try { - api.pigeonRegistrar.instanceManager.addDartCreatedInstance( - api.attachedField(pigeon_instanceArg), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAttachedField", - 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.staticAttachedField(), pigeon_identifierArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noop", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val wrapped: List = - try { - api.noop(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwError", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val wrapped: List = - try { - listOf(api.throwError(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwErrorFromVoid", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val wrapped: List = - try { - api.throwErrorFromVoid(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwFlutterError", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val wrapped: List = - try { - listOf(api.throwFlutterError(pigeon_instanceArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoInt", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anIntArg = args[1] as Long - val wrapped: List = - try { - listOf(api.echoInt(pigeon_instanceArg, anIntArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoDouble", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aDoubleArg = args[1] as Double - val wrapped: List = - try { - listOf(api.echoDouble(pigeon_instanceArg, aDoubleArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoBool", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aBoolArg = args[1] as Boolean - val wrapped: List = - try { - listOf(api.echoBool(pigeon_instanceArg, aBoolArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoString", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aStringArg = args[1] as String - val wrapped: List = - try { - listOf(api.echoString(pigeon_instanceArg, aStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoUint8List", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aUint8ListArg = args[1] as ByteArray - val wrapped: List = - try { - listOf(api.echoUint8List(pigeon_instanceArg, aUint8ListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoObject", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anObjectArg = args[1] as Any - val wrapped: List = - try { - listOf(api.echoObject(pigeon_instanceArg, anObjectArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoList", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aListArg = args[1] as List - val wrapped: List = - try { - listOf(api.echoList(pigeon_instanceArg, aListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiList", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aListArg = args[1] as List - val wrapped: List = - try { - listOf(api.echoProxyApiList(pigeon_instanceArg, aListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoMap", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aMapArg = args[1] as Map - val wrapped: List = - try { - listOf(api.echoMap(pigeon_instanceArg, aMapArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiMap", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aMapArg = args[1] as Map - val wrapped: List = - try { - listOf(api.echoProxyApiMap(pigeon_instanceArg, aMapArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoEnum", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anEnumArg = args[1] as ProxyApiTestEnum - val wrapped: List = - try { - listOf(api.echoEnum(pigeon_instanceArg, anEnumArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApi", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass - val wrapped: List = - try { - listOf(api.echoProxyApi(pigeon_instanceArg, aProxyApiArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableInt", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aNullableIntArg = args[1] as Long? - val wrapped: List = - try { - listOf(api.echoNullableInt(pigeon_instanceArg, aNullableIntArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableDouble", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aNullableDoubleArg = args[1] as Double? - val wrapped: List = - try { - listOf(api.echoNullableDouble(pigeon_instanceArg, aNullableDoubleArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableBool", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aNullableBoolArg = args[1] as Boolean? - val wrapped: List = - try { - listOf(api.echoNullableBool(pigeon_instanceArg, aNullableBoolArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableString", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aNullableStringArg = args[1] as String? - val wrapped: List = - try { - listOf(api.echoNullableString(pigeon_instanceArg, aNullableStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableUint8List", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aNullableUint8ListArg = args[1] as ByteArray? - val wrapped: List = - try { - listOf(api.echoNullableUint8List(pigeon_instanceArg, aNullableUint8ListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableObject", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aNullableObjectArg = args[1] - val wrapped: List = - try { - listOf(api.echoNullableObject(pigeon_instanceArg, aNullableObjectArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableList", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aNullableListArg = args[1] as List? - val wrapped: List = - try { - listOf(api.echoNullableList(pigeon_instanceArg, aNullableListArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableMap", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aNullableMapArg = args[1] as Map? - val wrapped: List = - try { - listOf(api.echoNullableMap(pigeon_instanceArg, aNullableMapArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableEnum", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aNullableEnumArg = args[1] as ProxyApiTestEnum? - val wrapped: List = - try { - listOf(api.echoNullableEnum(pigeon_instanceArg, aNullableEnumArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableProxyApi", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aNullableProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass? - val wrapped: List = - try { - listOf(api.echoNullableProxyApi(pigeon_instanceArg, aNullableProxyApiArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noopAsync", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - api.noopAsync(pigeon_instanceArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - reply.reply(wrapResult(null)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncInt", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anIntArg = args[1] as Long - api.echoAsyncInt(pigeon_instanceArg, anIntArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncDouble", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aDoubleArg = args[1] as Double - api.echoAsyncDouble(pigeon_instanceArg, aDoubleArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncBool", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aBoolArg = args[1] as Boolean - api.echoAsyncBool(pigeon_instanceArg, aBoolArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncString", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aStringArg = args[1] as String - api.echoAsyncString(pigeon_instanceArg, aStringArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncUint8List", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aUint8ListArg = args[1] as ByteArray - api.echoAsyncUint8List(pigeon_instanceArg, aUint8ListArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncObject", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anObjectArg = args[1] as Any - api.echoAsyncObject(pigeon_instanceArg, anObjectArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncList", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aListArg = args[1] as List - api.echoAsyncList(pigeon_instanceArg, aListArg) { result: Result> -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncMap", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aMapArg = args[1] as Map - api.echoAsyncMap(pigeon_instanceArg, aMapArg) { result: Result> -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncEnum", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anEnumArg = args[1] as ProxyApiTestEnum - api.echoAsyncEnum(pigeon_instanceArg, anEnumArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncError", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - api.throwAsyncError(pigeon_instanceArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncErrorFromVoid", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - api.throwAsyncErrorFromVoid(pigeon_instanceArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - reply.reply(wrapResult(null)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncFlutterError", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - api.throwAsyncFlutterError(pigeon_instanceArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableInt", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anIntArg = args[1] as Long? - api.echoAsyncNullableInt(pigeon_instanceArg, anIntArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableDouble", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aDoubleArg = args[1] as Double? - api.echoAsyncNullableDouble(pigeon_instanceArg, aDoubleArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableBool", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aBoolArg = args[1] as Boolean? - api.echoAsyncNullableBool(pigeon_instanceArg, aBoolArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableString", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aStringArg = args[1] as String? - api.echoAsyncNullableString(pigeon_instanceArg, aStringArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableUint8List", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aUint8ListArg = args[1] as ByteArray? - api.echoAsyncNullableUint8List(pigeon_instanceArg, aUint8ListArg) { - result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableObject", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anObjectArg = args[1] - api.echoAsyncNullableObject(pigeon_instanceArg, anObjectArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableList", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aListArg = args[1] as List? - api.echoAsyncNullableList(pigeon_instanceArg, aListArg) { result: Result?> -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableMap", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aMapArg = args[1] as Map? - api.echoAsyncNullableMap(pigeon_instanceArg, aMapArg) { - result: Result?> -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableEnum", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anEnumArg = args[1] as ProxyApiTestEnum? - api.echoAsyncNullableEnum(pigeon_instanceArg, anEnumArg) { - result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticNoop", - codec) - if (api != null) { - channel.setMessageHandler { _, reply -> - val wrapped: List = - try { - api.staticNoop() - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoStaticString", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val aStringArg = args[0] as String - val wrapped: List = - try { - listOf(api.echoStaticString(aStringArg)) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAsyncNoop", - codec) - if (api != null) { - channel.setMessageHandler { _, reply -> - api.staticAsyncNoop { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - reply.reply(wrapResult(null)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoop", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - api.callFlutterNoop(pigeon_instanceArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - reply.reply(wrapResult(null)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowError", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - api.callFlutterThrowError(pigeon_instanceArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowErrorFromVoid", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - api.callFlutterThrowErrorFromVoid(pigeon_instanceArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - reply.reply(wrapResult(null)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoBool", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aBoolArg = args[1] as Boolean - api.callFlutterEchoBool(pigeon_instanceArg, aBoolArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoInt", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anIntArg = args[1] as Long - api.callFlutterEchoInt(pigeon_instanceArg, anIntArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoDouble", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aDoubleArg = args[1] as Double - api.callFlutterEchoDouble(pigeon_instanceArg, aDoubleArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoString", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aStringArg = args[1] as String - api.callFlutterEchoString(pigeon_instanceArg, aStringArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoUint8List", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aUint8ListArg = args[1] as ByteArray - api.callFlutterEchoUint8List(pigeon_instanceArg, aUint8ListArg) { - result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoList", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aListArg = args[1] as List - api.callFlutterEchoList(pigeon_instanceArg, aListArg) { result: Result> -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiList", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aListArg = args[1] as List - api.callFlutterEchoProxyApiList(pigeon_instanceArg, aListArg) { - result: Result> -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoMap", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aMapArg = args[1] as Map - api.callFlutterEchoMap(pigeon_instanceArg, aMapArg) { result: Result> - -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiMap", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aMapArg = args[1] as Map - api.callFlutterEchoProxyApiMap(pigeon_instanceArg, aMapArg) { - result: Result> -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoEnum", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anEnumArg = args[1] as ProxyApiTestEnum - api.callFlutterEchoEnum(pigeon_instanceArg, anEnumArg) { - result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApi", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass - api.callFlutterEchoProxyApi(pigeon_instanceArg, aProxyApiArg) { - result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableBool", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aBoolArg = args[1] as Boolean? - api.callFlutterEchoNullableBool(pigeon_instanceArg, aBoolArg) { result: Result - -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableInt", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anIntArg = args[1] as Long? - api.callFlutterEchoNullableInt(pigeon_instanceArg, anIntArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableDouble", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aDoubleArg = args[1] as Double? - api.callFlutterEchoNullableDouble(pigeon_instanceArg, aDoubleArg) { - result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableString", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aStringArg = args[1] as String? - api.callFlutterEchoNullableString(pigeon_instanceArg, aStringArg) { - result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableUint8List", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aUint8ListArg = args[1] as ByteArray? - api.callFlutterEchoNullableUint8List(pigeon_instanceArg, aUint8ListArg) { - result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableList", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aListArg = args[1] as List? - api.callFlutterEchoNullableList(pigeon_instanceArg, aListArg) { - result: Result?> -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableMap", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aMapArg = args[1] as Map? - api.callFlutterEchoNullableMap(pigeon_instanceArg, aMapArg) { - result: Result?> -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableEnum", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val anEnumArg = args[1] as ProxyApiTestEnum? - api.callFlutterEchoNullableEnum(pigeon_instanceArg, anEnumArg) { - result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableProxyApi", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass? - api.callFlutterEchoNullableProxyApi(pigeon_instanceArg, aProxyApiArg) { - result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoopAsync", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - api.callFlutterNoopAsync(pigeon_instanceArg) { result: Result -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - reply.reply(wrapResult(null)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoAsyncString", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ProxyApiTestClass - val aStringArg = args[1] as String - api.callFlutterEchoAsyncString(pigeon_instanceArg, aStringArg) { result: Result - -> - val error = result.exceptionOrNull() - if (error != null) { - reply.reply(wrapError(error)) - } else { - val data = result.getOrNull() - reply.reply(wrapResult(data)) - } - } - } - } else { - channel.setMessageHandler(null) - } - } - } - } - - @Suppress("LocalVariableName", "FunctionName") - /** Creates a Dart instance of ProxyApiTestClass and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("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 aBoolArg = aBool(pigeon_instanceArg) - val anIntArg = anInt(pigeon_instanceArg) - val aDoubleArg = aDouble(pigeon_instanceArg) - val aStringArg = aString(pigeon_instanceArg) - val aUint8ListArg = aUint8List(pigeon_instanceArg) - val aListArg = aList(pigeon_instanceArg) - val aMapArg = aMap(pigeon_instanceArg) - val anEnumArg = anEnum(pigeon_instanceArg) - val aProxyApiArg = aProxyApi(pigeon_instanceArg) - val aNullableBoolArg = aNullableBool(pigeon_instanceArg) - val aNullableIntArg = aNullableInt(pigeon_instanceArg) - val aNullableDoubleArg = aNullableDouble(pigeon_instanceArg) - val aNullableStringArg = aNullableString(pigeon_instanceArg) - val aNullableUint8ListArg = aNullableUint8List(pigeon_instanceArg) - val aNullableListArg = aNullableList(pigeon_instanceArg) - val aNullableMapArg = aNullableMap(pigeon_instanceArg) - val aNullableEnumArg = aNullableEnum(pigeon_instanceArg) - val aNullableProxyApiArg = aNullableProxyApi(pigeon_instanceArg) - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send( - listOf( - pigeon_identifierArg, - aBoolArg, - anIntArg, - aDoubleArg, - aStringArg, - aUint8ListArg, - aListArg, - aMapArg, - anEnumArg, - aProxyApiArg, - aNullableBoolArg, - aNullableIntArg, - aNullableDoubleArg, - aNullableStringArg, - aNullableUint8ListArg, - aNullableListArg, - aNullableMapArg, - aNullableEnumArg, - aNullableProxyApiArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ - fun flutterNoop(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoop" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Responds with an error from an async function returning a value. */ - fun flutterThrowError(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowError" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - val output = it[0] - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Responds with an error from an async void function. */ - fun flutterThrowErrorFromVoid( - pigeon_instanceArg: ProxyApiTestClass, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowErrorFromVoid" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed boolean, to test serialization and deserialization. */ - fun flutterEchoBool( - pigeon_instanceArg: ProxyApiTestClass, - aBoolArg: Boolean, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoBool" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aBoolArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) - } else { - val output = it[0] as Boolean - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed int, to test serialization and deserialization. */ - fun flutterEchoInt( - pigeon_instanceArg: ProxyApiTestClass, - anIntArg: Long, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoInt" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, anIntArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) - } else { - val output = it[0] as Long - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed double, to test serialization and deserialization. */ - fun flutterEchoDouble( - pigeon_instanceArg: ProxyApiTestClass, - aDoubleArg: Double, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoDouble" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aDoubleArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) - } else { - val output = it[0] as Double - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed string, to test serialization and deserialization. */ - fun flutterEchoString( - pigeon_instanceArg: ProxyApiTestClass, - aStringArg: String, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoString" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aStringArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) - } else { - val output = it[0] as String - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed byte list, to test serialization and deserialization. */ - fun flutterEchoUint8List( - pigeon_instanceArg: ProxyApiTestClass, - aListArg: ByteArray, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoUint8List" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aListArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) - } else { - val output = it[0] as ByteArray - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed list, to test serialization and deserialization. */ - fun flutterEchoList( - pigeon_instanceArg: ProxyApiTestClass, - aListArg: List, - callback: (Result>) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoList" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aListArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) - } else { - val output = it[0] as List - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed list with ProxyApis, to test serialization and deserialization. */ - fun flutterEchoProxyApiList( - pigeon_instanceArg: ProxyApiTestClass, - aListArg: List, - callback: (Result>) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiList" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aListArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) - } else { - val output = it[0] as List - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed map, to test serialization and deserialization. */ - fun flutterEchoMap( - pigeon_instanceArg: ProxyApiTestClass, - aMapArg: Map, - callback: (Result>) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoMap" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aMapArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) - } else { - val output = it[0] as Map - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed map with ProxyApis, to test serialization and deserialization. */ - fun flutterEchoProxyApiMap( - pigeon_instanceArg: ProxyApiTestClass, - aMapArg: Map, - callback: (Result>) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiMap" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aMapArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) - } else { - val output = it[0] as Map - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed enum to test serialization and deserialization. */ - fun flutterEchoEnum( - pigeon_instanceArg: ProxyApiTestClass, - anEnumArg: ProxyApiTestEnum, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoEnum" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, anEnumArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) - } else { - val output = it[0] as ProxyApiTestEnum - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed ProxyApi to test serialization and deserialization. */ - fun flutterEchoProxyApi( - pigeon_instanceArg: ProxyApiTestClass, - aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApi" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aProxyApiArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) - } else { - val output = it[0] as com.example.test_plugin.ProxyApiSuperClass - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed boolean, to test serialization and deserialization. */ - fun flutterEchoNullableBool( - pigeon_instanceArg: ProxyApiTestClass, - aBoolArg: Boolean?, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableBool" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aBoolArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - val output = it[0] as Boolean? - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed int, to test serialization and deserialization. */ - fun flutterEchoNullableInt( - pigeon_instanceArg: ProxyApiTestClass, - anIntArg: Long?, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableInt" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, anIntArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - val output = it[0] as Long? - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed double, to test serialization and deserialization. */ - fun flutterEchoNullableDouble( - pigeon_instanceArg: ProxyApiTestClass, - aDoubleArg: Double?, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableDouble" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aDoubleArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - val output = it[0] as Double? - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed string, to test serialization and deserialization. */ - fun flutterEchoNullableString( - pigeon_instanceArg: ProxyApiTestClass, - aStringArg: String?, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableString" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aStringArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - val output = it[0] as String? - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed byte list, to test serialization and deserialization. */ - fun flutterEchoNullableUint8List( - pigeon_instanceArg: ProxyApiTestClass, - aListArg: ByteArray?, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableUint8List" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aListArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - val output = it[0] as ByteArray? - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed list, to test serialization and deserialization. */ - fun flutterEchoNullableList( - pigeon_instanceArg: ProxyApiTestClass, - aListArg: List?, - callback: (Result?>) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableList" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aListArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - val output = it[0] as List? - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed map, to test serialization and deserialization. */ - fun flutterEchoNullableMap( - pigeon_instanceArg: ProxyApiTestClass, - aMapArg: Map?, - callback: (Result?>) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableMap" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aMapArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - val output = it[0] as Map? - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed enum to test serialization and deserialization. */ - fun flutterEchoNullableEnum( - pigeon_instanceArg: ProxyApiTestClass, - anEnumArg: ProxyApiTestEnum?, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableEnum" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, anEnumArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - val output = it[0] as ProxyApiTestEnum? - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed ProxyApi to test serialization and deserialization. */ - fun flutterEchoNullableProxyApi( - pigeon_instanceArg: ProxyApiTestClass, - aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass?, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableProxyApi" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aProxyApiArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - val output = it[0] as com.example.test_plugin.ProxyApiSuperClass? - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** - * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous - * calling. - */ - fun flutterNoopAsync(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoopAsync" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - /** Returns the passed in generic Object asynchronously. */ - fun flutterEchoAsyncString( - pigeon_instanceArg: ProxyApiTestClass, - aStringArg: String, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoAsyncString" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg, aStringArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else if (it[0] == null) { - callback( - Result.failure( - ProxyApiTestsError( - "null-error", - "Flutter api returned null value for non-null return value.", - ""))) - } else { - val output = it[0] as String - callback(Result.success(output)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - @Suppress("FunctionName") - /** An implementation of [PigeonApiProxyApiSuperClass] used to access callback methods */ - fun pigeon_getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass { - return pigeonRegistrar.getPigeonApiProxyApiSuperClass() - } - - @Suppress("FunctionName") - /** An implementation of [PigeonApiProxyApiInterface] used to access callback methods */ - fun pigeon_getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { - return pigeonRegistrar.getPigeonApiProxyApiInterface() - } -} -/** ProxyApi to serve as a super class to the core ProxyApi class. */ -@Suppress("UNCHECKED_CAST") -abstract class PigeonApiProxyApiSuperClass( - open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar -) { - abstract fun pigeon_defaultConstructor(): com.example.test_plugin.ProxyApiSuperClass - - abstract fun aSuperMethod(pigeon_instance: com.example.test_plugin.ProxyApiSuperClass) - - companion object { - @Suppress("LocalVariableName") - fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiSuperClass?) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.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) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.aSuperMethod", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as com.example.test_plugin.ProxyApiSuperClass - val wrapped: List = - try { - api.aSuperMethod(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - } - } - - @Suppress("LocalVariableName", "FunctionName") - /** Creates a Dart instance of ProxyApiSuperClass and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance( - pigeon_instanceArg: com.example.test_plugin.ProxyApiSuperClass, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("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.pigeon_integration_tests.ProxyApiSuperClass.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } -} -/** ProxyApi to serve as an interface to the core ProxyApi class. */ -@Suppress("UNCHECKED_CAST") -open class PigeonApiProxyApiInterface( - open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar -) { - @Suppress("LocalVariableName", "FunctionName") - /** Creates a Dart instance of ProxyApiInterface and attaches it to [pigeon_instanceArg]. */ - fun pigeon_newInstance(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("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.pigeon_integration_tests.ProxyApiInterface.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } - - fun anInterfaceMethod(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) - return - } - val binaryMessenger = pigeonRegistrar.binaryMessenger - val codec = pigeonRegistrar.codec - val channelName = - "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.anInterfaceMethod" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_instanceArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } -} - -@Suppress("UNCHECKED_CAST") -abstract class PigeonApiClassWithApiRequirement( - open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar -) { - @androidx.annotation.RequiresApi(api = 25) - abstract fun pigeon_defaultConstructor(): ClassWithApiRequirement - - @androidx.annotation.RequiresApi(api = 25) - abstract fun aMethod(pigeon_instance: ClassWithApiRequirement) - - companion object { - @Suppress("LocalVariableName") - fun setUpMessageHandlers( - binaryMessenger: BinaryMessenger, - api: PigeonApiClassWithApiRequirement? - ) { - val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec() - if (android.os.Build.VERSION.SDK_INT >= 25) { - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.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) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - } else { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", - codec) - if (api != null) { - channel.setMessageHandler { _, reply -> - reply.reply( - wrapError( - UnsupportedOperationException( - "Call references class `ClassWithApiRequirement`, which requires api version 25."))) - } - } else { - channel.setMessageHandler(null) - } - } - if (android.os.Build.VERSION.SDK_INT >= 25) { - run { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", - codec) - if (api != null) { - channel.setMessageHandler { message, reply -> - val args = message as List - val pigeon_instanceArg = args[0] as ClassWithApiRequirement - val wrapped: List = - try { - api.aMethod(pigeon_instanceArg) - listOf(null) - } catch (exception: Throwable) { - wrapError(exception) - } - reply.reply(wrapped) - } - } else { - channel.setMessageHandler(null) - } - } - } else { - val channel = - BasicMessageChannel( - binaryMessenger, - "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", - codec) - if (api != null) { - channel.setMessageHandler { _, reply -> - reply.reply( - wrapError( - UnsupportedOperationException( - "Call references class `ClassWithApiRequirement`, which requires api version 25."))) - } - } else { - channel.setMessageHandler(null) - } - } - } - } - - @Suppress("LocalVariableName", "FunctionName") - /** Creates a Dart instance of ClassWithApiRequirement and attaches it to [pigeon_instanceArg]. */ - @androidx.annotation.RequiresApi(api = 25) - fun pigeon_newInstance( - pigeon_instanceArg: ClassWithApiRequirement, - callback: (Result) -> Unit - ) { - if (pigeonRegistrar.ignoreCallsToDart) { - callback( - Result.failure( - ProxyApiTestsError("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.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance" - val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(pigeon_identifierArg)) { - if (it is List<*>) { - if (it.size > 1) { - callback( - Result.failure( - ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) - } else { - callback(Result.success(Unit)) - } - } else { - callback(Result.failure(createConnectionError(channelName))) - } - } - } -} From d79c8f093a992f39e69034d045ddf29335c0c7c5 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Wed, 28 Aug 2024 23:28:05 -0400 Subject: [PATCH 71/77] review comments --- packages/pigeon/lib/generator_tools.dart | 2 +- packages/pigeon/lib/kotlin_generator.dart | 30 +++++++++-------------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index da92a84690b2..0cd32b202f11 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -78,7 +78,7 @@ class Indent { String input, { bool leadingSpace = true, bool trailingNewline = true, - bool trimIndentation = false, + bool trimIndentation = true, }) { final List lines = input.split('\n'); diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index aaeae4b1675e..dcdd272f30f2 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -659,7 +659,7 @@ if (wrapped == null) { addDocumentationComments( indent, [ - 'Generated API for managing the Dart and native `InstanceManager`s.', + ' Generated API for managing the Dart and native `InstanceManager`s.', ], _docCommentSpec, ); @@ -670,7 +670,7 @@ if (wrapped == null) { indent.writeScoped('companion object {', '}', () { addDocumentationComments( indent, - ['The codec used by $instanceManagerApiName.'], + [' The codec used by $instanceManagerApiName.'], _docCommentSpec, ); indent.writeScoped( @@ -687,8 +687,8 @@ if (wrapped == null) { addDocumentationComments( indent, [ - 'Sets up an instance of `$instanceManagerApiName` to handle messages from the', - '`binaryMessenger`.', + ' Sets up an instance of `$instanceManagerApiName` to handle messages from the', + ' `binaryMessenger`.', ], _docCommentSpec, ); @@ -811,13 +811,11 @@ if (wrapped == null) { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { $proxyApiCodecInstanceManagerKey.toByte() -> { - return registrar.instanceManager.getInstance( - readValue(buffer).let { if (it is Int) it.toLong() else it as Long }) + return registrar.instanceManager.getInstance(readValue(buffer) as Long) } else -> super.readValueOfType(type, buffer) } }''', - trimIndentation: true, ); indent.newln(); @@ -868,7 +866,6 @@ if (wrapped == null) { ${index > 0 ? ' else ' : ''}if (${versionCheck}value is $className) { registrar.get$hostProxyApiPrefix${api.name}().${classMemberNamePrefix}newInstance(value) { } }''', - trimIndentation: true, ); }, ); @@ -883,7 +880,6 @@ if (wrapped == null) { } else -> throw IllegalArgumentException("Unsupported value: '\$value' of type '\${value.javaClass.name}'") }''', - trimIndentation: true, ); }, ); @@ -960,6 +956,7 @@ if (wrapped == null) { kotlinApiName: kotlinApiName, dartPackageName: dartPackageName, fullKotlinClassName: fullKotlinClassName, + generatorOptions: generatorOptions, ); }); indent.newln(); @@ -1339,8 +1336,8 @@ if (wrapped == null) { addDocumentationComments( indent, [ - 'Provides implementations for each ProxyApi implementation and provides access to resources', - 'needed by any implementation.', + ' Provides implementations for each ProxyApi implementation and provides access to resources', + ' needed by any implementation.', ], _docCommentSpec, ); @@ -1357,8 +1354,8 @@ if (wrapped == null) { indent.format( ''' val instanceManager: $instanceManagerName - private var _codec: StandardMessageCodec? = null - val codec: StandardMessageCodec + private var _codec: ${proxyApiCodecName(generatorOptions)}? = null + val codec: ${proxyApiCodecName(generatorOptions)} get() { if (_codec == null) { _codec = ${proxyApiCodecName(generatorOptions)}(this) @@ -1383,7 +1380,6 @@ if (wrapped == null) { } ) }''', - trimIndentation: true, ); for (final AstProxyApi api in allProxyApis) { _writeMethodDeclaration( @@ -1580,6 +1576,7 @@ if (wrapped == null) { required String kotlinApiName, required String dartPackageName, required String fullKotlinClassName, + required KotlinOptions generatorOptions, }) { indent.writeln('@Suppress("LocalVariableName")'); indent.writeScoped( @@ -1587,7 +1584,7 @@ if (wrapped == null) { '}', () { indent.writeln( - 'val codec = api?.pigeonRegistrar?.codec ?: StandardMessageCodec()', + 'val codec = api?.pigeonRegistrar?.codec ?: ${generatorOptions.fileSpecificClassNameComponent}$_codecName()', ); void writeWithApiCheckIfNecessary( List types, { @@ -1624,7 +1621,6 @@ if (wrapped == null) { } else { channel.setMessageHandler(null) }''', - trimIndentation: true, ); }); } else { @@ -1820,7 +1816,6 @@ if (wrapped == null) { Result.failure( $errorClassName("ignore-calls-error", "Calls to Dart are being ignored.", ""))) return''', - trimIndentation: true, ); }, ); @@ -1926,7 +1921,6 @@ if (wrapped == null) { Result.failure( $errorClassName("ignore-calls-error", "Calls to Dart are being ignored.", ""))) return''', - trimIndentation: true, ); }, ); From f4ac560580f6e685ec380d119cafc4388bc1b053 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Wed, 28 Aug 2024 23:30:28 -0400 Subject: [PATCH 72/77] fix other comments locations --- packages/pigeon/lib/kotlin_generator.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index dcdd272f30f2..ec6c68576315 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -1390,8 +1390,8 @@ if (wrapped == null) { isOpen: !api.hasAnyHostMessageCalls() && api.unattachedFields.isEmpty, documentationComments: [ - 'An implementation of [$hostProxyApiPrefix${api.name}] used to add a new Dart instance of', - '`${api.name}` to the Dart `InstanceManager`.' + ' An implementation of [$hostProxyApiPrefix${api.name}] used to add a new Dart instance of', + ' `${api.name}` to the Dart `InstanceManager`.' ], returnType: TypeDeclaration( baseName: '$hostProxyApiPrefix${api.name}', @@ -1777,7 +1777,7 @@ if (wrapped == null) { name: newInstanceMethodName, returnType: const TypeDeclaration.voidDeclaration(), documentationComments: [ - 'Creates a Dart instance of ${api.name} and attaches it to [${classMemberNamePrefix}instanceArg].', + ' Creates a Dart instance of ${api.name} and attaches it to [${classMemberNamePrefix}instanceArg].', ], channelName: makeChannelNameWithStrings( apiName: api.name, @@ -1955,7 +1955,7 @@ if (wrapped == null) { indent, name: '${classMemberNamePrefix}get$apiName', documentationComments: [ - 'An implementation of [$apiName] used to access callback methods', + ' An implementation of [$apiName] used to access callback methods', ], returnType: TypeDeclaration(baseName: apiName, isNullable: false), parameters: [], From f70c2f12c1689993de44ddf3c7f8ebb318ecd5cc Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 29 Aug 2024 00:50:29 -0400 Subject: [PATCH 73/77] include gen file actually --- .../kotlin/com/example/test_plugin/.gitignore | 2 + .../example/test_plugin/ProxyApiTests.gen.kt | 4291 +++++++++++++++++ 2 files changed, 4293 insertions(+) create mode 100644 packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/.gitignore b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/.gitignore index 2969275b55b5..5f3fcaf31604 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/.gitignore +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/.gitignore @@ -7,3 +7,5 @@ # This contains the declaration of the test classes wrapped by the ProxyApi tests and the # implemetations of their APIs. !ProxyApiTestApiImpls.kt +# Including this makes it easier to review code generation changes. +!ProxyApiTests.gen.kt diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt new file mode 100644 index 000000000000..5858dd63d82d --- /dev/null +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -0,0 +1,4291 @@ +// 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, do not edit directly. +// See also: https://pub.dev/packages/pigeon +@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") + +package com.example.test_plugin + +import android.util.Log +import io.flutter.plugin.common.BasicMessageChannel +import io.flutter.plugin.common.BinaryMessenger +import io.flutter.plugin.common.MessageCodec +import io.flutter.plugin.common.StandardMessageCodec +import java.io.ByteArrayOutputStream +import java.nio.ByteBuffer + +private fun wrapResult(result: Any?): List { + return listOf(result) +} + +private fun wrapError(exception: Throwable): List { + return if (exception is ProxyApiTestsError) { + listOf(exception.code, exception.message, exception.details) + } else { + listOf( + exception.javaClass.simpleName, + exception.toString(), + "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)) + } +} + +private fun createConnectionError(channelName: String): ProxyApiTestsError { + return ProxyApiTestsError( + "channel-error", "Unable to establish connection on channel: '$channelName'.", "") +} + +/** + * Error class for passing custom error details to Flutter via a thrown PlatformException. + * + * @property code The error code. + * @property message The error message. + * @property details The error details. Must be a datatype supported by the api codec. + */ +class ProxyApiTestsError( + val code: String, + override val message: String? = null, + val details: Any? = null +) : Throwable() +/** + * Maintains instances used to communicate with the corresponding objects in Dart. + * + * Objects stored in this container are represented by an object in Dart that is also stored in an + * InstanceManager with the same identifier. + * + * When an instance is added with an identifier, either can be used to retrieve the other. + * + * Added instances are added as a weak reference and a strong reference. When the strong reference + * is removed with [remove] and the weak reference is deallocated, the + * `finalizationListener.onFinalize` is called with the instance's identifier. However, if the + * strong reference is removed and then the identifier is retrieved with the intention to pass the + * identifier to Dart (e.g. calling [getIdentifierForStrongReference]), the strong reference to the + * instance is recreated. The strong reference will then need to be removed manually again. + */ +@Suppress("UNCHECKED_CAST", "MemberVisibilityCanBePrivate") +class ProxyApiTestsPigeonInstanceManager( + private val finalizationListener: PigeonFinalizationListener +) { + /** Interface for listening when a weak reference of an instance is removed from the manager. */ + interface PigeonFinalizationListener { + fun onFinalize(identifier: Long) + } + + private val identifiers = java.util.WeakHashMap() + private val weakInstances = HashMap>() + private val strongInstances = HashMap() + private val referenceQueue = java.lang.ref.ReferenceQueue() + private val weakReferencesToIdentifiers = HashMap, Long>() + private val handler = android.os.Handler(android.os.Looper.getMainLooper()) + private var nextIdentifier: Long = minHostCreatedIdentifier + private var hasFinalizationListenerStopped = false + + /** + * Modifies the time interval used to define how often this instance removes garbage collected + * weak references to native Android objects that this instance was managing. + */ + var clearFinalizedWeakReferencesInterval: Long = 3000 + set(value) { + handler.removeCallbacks { this.releaseAllFinalizedInstances() } + field = value + releaseAllFinalizedInstances() + } + + init { + handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) + } + + companion object { + // Identifiers are locked to a specific range to avoid collisions with objects + // created simultaneously from Dart. + // Host uses identifiers >= 2^16 and Dart is expected to use values n where, + // 0 <= n < 2^16. + private const val minHostCreatedIdentifier: Long = 65536 + private const val tag = "PigeonInstanceManager" + + /** + * Instantiate a new manager with a listener for garbage collected weak references. + * + * When the manager is no longer needed, [stopFinalizationListener] must be called. + */ + fun create( + finalizationListener: PigeonFinalizationListener + ): ProxyApiTestsPigeonInstanceManager { + return ProxyApiTestsPigeonInstanceManager(finalizationListener) + } + } + + /** + * Removes `identifier` and return its associated strongly referenced instance, if present, from + * the manager. + */ + fun remove(identifier: Long): T? { + logWarningIfFinalizationListenerHasStopped() + return strongInstances.remove(identifier) as T? + } + + /** + * Retrieves the identifier paired with an instance, if present, otherwise `null`. + * + * If the manager contains a strong reference to `instance`, it will return the identifier + * associated with `instance`. If the manager contains only a weak reference to `instance`, a new + * strong reference to `instance` will be added and will need to be removed again with [remove]. + * + * If this method returns a nonnull identifier, this method also expects the Dart + * `ProxyApiTestsPigeonInstanceManager` to have, or recreate, a weak reference to the Dart + * instance the identifier is associated with. + */ + fun getIdentifierForStrongReference(instance: Any?): Long? { + logWarningIfFinalizationListenerHasStopped() + val identifier = identifiers[instance] + if (identifier != null) { + strongInstances[identifier] = instance!! + } + return identifier + } + + /** + * Adds a new instance that was instantiated from Dart. + * + * The same instance can be added multiple times, but each identifier must be unique. This allows + * two objects that are equivalent (e.g. the `equals` method returns true and their hashcodes are + * equal) to both be added. + * + * [identifier] must be >= 0 and unique. + */ + fun addDartCreatedInstance(instance: Any, identifier: Long) { + logWarningIfFinalizationListenerHasStopped() + addInstance(instance, identifier) + } + + /** + * Adds a new unique instance that was instantiated from the host platform. + * + * [identifier] must be >= 0 and unique. + */ + fun addHostCreatedInstance(instance: Any): Long { + logWarningIfFinalizationListenerHasStopped() + require(!containsInstance(instance)) { + "Instance of ${instance.javaClass} has already been added." + } + val identifier = nextIdentifier++ + addInstance(instance, identifier) + return identifier + } + + /** Retrieves the instance associated with identifier, if present, otherwise `null`. */ + fun getInstance(identifier: Long): T? { + logWarningIfFinalizationListenerHasStopped() + val instance = weakInstances[identifier] as java.lang.ref.WeakReference? + return instance?.get() + } + + /** Returns whether this manager contains the given `instance`. */ + fun containsInstance(instance: Any?): Boolean { + logWarningIfFinalizationListenerHasStopped() + return identifiers.containsKey(instance) + } + + /** + * Stops the periodic run of the [PigeonFinalizationListener] for instances that have been garbage + * collected. + * + * The InstanceManager can continue to be used, but the [PigeonFinalizationListener] will no + * longer be called and methods will log a warning. + */ + fun stopFinalizationListener() { + handler.removeCallbacks { this.releaseAllFinalizedInstances() } + hasFinalizationListenerStopped = true + } + + /** + * Removes all of the instances from this manager. + * + * The manager will be empty after this call returns. + */ + fun clear() { + identifiers.clear() + weakInstances.clear() + strongInstances.clear() + weakReferencesToIdentifiers.clear() + } + + /** + * Whether the [PigeonFinalizationListener] is still being called for instances that are garbage + * collected. + * + * See [stopFinalizationListener]. + */ + fun hasFinalizationListenerStopped(): Boolean { + return hasFinalizationListenerStopped + } + + private fun releaseAllFinalizedInstances() { + if (hasFinalizationListenerStopped()) { + return + } + var reference: java.lang.ref.WeakReference? + while ((referenceQueue.poll() as java.lang.ref.WeakReference?).also { reference = it } != + null) { + val identifier = weakReferencesToIdentifiers.remove(reference) + if (identifier != null) { + weakInstances.remove(identifier) + strongInstances.remove(identifier) + finalizationListener.onFinalize(identifier) + } + } + handler.postDelayed({ releaseAllFinalizedInstances() }, clearFinalizedWeakReferencesInterval) + } + + private fun addInstance(instance: Any, identifier: Long) { + require(identifier >= 0) { "Identifier must be >= 0: $identifier" } + require(!weakInstances.containsKey(identifier)) { + "Identifier has already been added: $identifier" + } + val weakReference = java.lang.ref.WeakReference(instance, referenceQueue) + identifiers[instance] = identifier + weakInstances[identifier] = weakReference + weakReferencesToIdentifiers[weakReference] = identifier + strongInstances[identifier] = instance + } + + private fun logWarningIfFinalizationListenerHasStopped() { + if (hasFinalizationListenerStopped()) { + Log.w( + tag, + "The manager was used after calls to the PigeonFinalizationListener has been stopped.") + } + } +} + +/** Generated API for managing the Dart and native `InstanceManager`s. */ +private class ProxyApiTestsPigeonInstanceManagerApi(val binaryMessenger: BinaryMessenger) { + companion object { + /** The codec used by ProxyApiTestsPigeonInstanceManagerApi. */ + val codec: MessageCodec by lazy { ProxyApiTestsPigeonCodec() } + + /** + * Sets up an instance of `ProxyApiTestsPigeonInstanceManagerApi` to handle messages from the + * `binaryMessenger`. + */ + fun setUpMessageHandlers( + binaryMessenger: BinaryMessenger, + instanceManager: ProxyApiTestsPigeonInstanceManager? + ) { + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference", + codec) + if (instanceManager != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val identifierArg = args[0] as Long + val wrapped: List = + try { + instanceManager.remove(identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.clear", + codec) + if (instanceManager != null) { + channel.setMessageHandler { _, reply -> + val wrapped: List = + try { + instanceManager.clear() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + fun removeStrongReference(identifierArg: Long, callback: (Result) -> Unit) { + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.PigeonInternalInstanceManager.removeStrongReference" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } +} +/** + * Provides implementations for each ProxyApi implementation and provides access to resources needed + * by any implementation. + */ +abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryMessenger) { + /** Whether APIs should ignore calling to Dart. */ + public var ignoreCallsToDart = false + val instanceManager: ProxyApiTestsPigeonInstanceManager + private var _codec: ProxyApiTestsPigeonProxyApiBaseCodec? = null + val codec: ProxyApiTestsPigeonProxyApiBaseCodec + get() { + if (_codec == null) { + _codec = ProxyApiTestsPigeonProxyApiBaseCodec(this) + } + return _codec!! + } + + init { + val api = ProxyApiTestsPigeonInstanceManagerApi(binaryMessenger) + instanceManager = + ProxyApiTestsPigeonInstanceManager.create( + object : ProxyApiTestsPigeonInstanceManager.PigeonFinalizationListener { + override fun onFinalize(identifier: Long) { + api.removeStrongReference(identifier) { + if (it.isFailure) { + Log.e( + "PigeonProxyApiRegistrar", + "Failed to remove Dart strong reference with identifier: $identifier") + } + } + } + }) + } + /** + * An implementation of [PigeonApiProxyApiTestClass] used to add a new Dart instance of + * `ProxyApiTestClass` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiProxyApiTestClass(): PigeonApiProxyApiTestClass + + /** + * An implementation of [PigeonApiProxyApiSuperClass] used to add a new Dart instance of + * `ProxyApiSuperClass` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass + + /** + * An implementation of [PigeonApiProxyApiInterface] used to add a new Dart instance of + * `ProxyApiInterface` to the Dart `InstanceManager`. + */ + open fun getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { + return PigeonApiProxyApiInterface(this) + } + + /** + * An implementation of [PigeonApiClassWithApiRequirement] used to add a new Dart instance of + * `ClassWithApiRequirement` to the Dart `InstanceManager`. + */ + abstract fun getPigeonApiClassWithApiRequirement(): PigeonApiClassWithApiRequirement + + fun setUp() { + ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, instanceManager) + PigeonApiProxyApiTestClass.setUpMessageHandlers( + binaryMessenger, getPigeonApiProxyApiTestClass()) + PigeonApiProxyApiSuperClass.setUpMessageHandlers( + binaryMessenger, getPigeonApiProxyApiSuperClass()) + PigeonApiClassWithApiRequirement.setUpMessageHandlers( + binaryMessenger, getPigeonApiClassWithApiRequirement()) + } + + fun tearDown() { + ProxyApiTestsPigeonInstanceManagerApi.setUpMessageHandlers(binaryMessenger, null) + PigeonApiProxyApiTestClass.setUpMessageHandlers(binaryMessenger, null) + PigeonApiProxyApiSuperClass.setUpMessageHandlers(binaryMessenger, null) + PigeonApiClassWithApiRequirement.setUpMessageHandlers(binaryMessenger, null) + } +} + +private class ProxyApiTestsPigeonProxyApiBaseCodec( + val registrar: ProxyApiTestsPigeonProxyApiRegistrar +) : ProxyApiTestsPigeonCodec() { + override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { + return when (type) { + 128.toByte() -> { + return registrar.instanceManager.getInstance(readValue(buffer) as Long) + } + else -> super.readValueOfType(type, buffer) + } + } + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + if (value is Boolean || + value is ByteArray || + value is Double || + value is DoubleArray || + value is FloatArray || + value is Int || + value is IntArray || + value is List<*> || + value is Long || + value is LongArray || + value is Map<*, *> || + value is String || + value is ProxyApiTestEnum || + value == null) { + super.writeValue(stream, value) + return + } + + if (value is ProxyApiTestClass) { + registrar.getPigeonApiProxyApiTestClass().pigeon_newInstance(value) {} + } else if (value is com.example.test_plugin.ProxyApiSuperClass) { + registrar.getPigeonApiProxyApiSuperClass().pigeon_newInstance(value) {} + } else if (value is ProxyApiInterface) { + registrar.getPigeonApiProxyApiInterface().pigeon_newInstance(value) {} + } else if (android.os.Build.VERSION.SDK_INT >= 25 && value is ClassWithApiRequirement) { + registrar.getPigeonApiClassWithApiRequirement().pigeon_newInstance(value) {} + } + + when { + registrar.instanceManager.containsInstance(value) -> { + stream.write(128) + writeValue(stream, registrar.instanceManager.getIdentifierForStrongReference(value)) + } + else -> + throw IllegalArgumentException( + "Unsupported value: '$value' of type '${value.javaClass.name}'") + } + } +} + +enum class ProxyApiTestEnum(val raw: Int) { + ONE(0), + TWO(1), + THREE(2); + + companion object { + fun ofRaw(raw: Int): ProxyApiTestEnum? { + return values().firstOrNull { it.raw == raw } + } + } +} + +private open class ProxyApiTestsPigeonCodec : StandardMessageCodec() { + override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { + return when (type) { + 129.toByte() -> { + return (readValue(buffer) as Long?)?.let { ProxyApiTestEnum.ofRaw(it.toInt()) } + } + else -> super.readValueOfType(type, buffer) + } + } + + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + when (value) { + is ProxyApiTestEnum -> { + stream.write(129) + writeValue(stream, value.raw) + } + else -> super.writeValue(stream, value) + } + } +} + +/** + * The core ProxyApi test class that each supported host language must implement in platform_tests + * integration tests. + */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiProxyApiTestClass( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar +) { + abstract fun pigeon_defaultConstructor( + aBool: Boolean, + anInt: Long, + aDouble: Double, + aString: String, + aUint8List: ByteArray, + aList: List, + aMap: Map, + anEnum: ProxyApiTestEnum, + aProxyApi: com.example.test_plugin.ProxyApiSuperClass, + aNullableBool: Boolean?, + aNullableInt: Long?, + aNullableDouble: Double?, + aNullableString: String?, + aNullableUint8List: ByteArray?, + aNullableList: List?, + aNullableMap: Map?, + aNullableEnum: ProxyApiTestEnum?, + aNullableProxyApi: com.example.test_plugin.ProxyApiSuperClass?, + boolParam: Boolean, + intParam: Long, + doubleParam: Double, + stringParam: String, + aUint8ListParam: ByteArray, + listParam: List, + mapParam: Map, + enumParam: ProxyApiTestEnum, + proxyApiParam: com.example.test_plugin.ProxyApiSuperClass, + nullableBoolParam: Boolean?, + nullableIntParam: Long?, + nullableDoubleParam: Double?, + nullableStringParam: String?, + nullableUint8ListParam: ByteArray?, + nullableListParam: List?, + nullableMapParam: Map?, + nullableEnumParam: ProxyApiTestEnum?, + nullableProxyApiParam: com.example.test_plugin.ProxyApiSuperClass? + ): ProxyApiTestClass + + abstract fun attachedField( + pigeon_instance: ProxyApiTestClass + ): com.example.test_plugin.ProxyApiSuperClass + + abstract fun staticAttachedField(): com.example.test_plugin.ProxyApiSuperClass + + abstract fun aBool(pigeon_instance: ProxyApiTestClass): Boolean + + abstract fun anInt(pigeon_instance: ProxyApiTestClass): Long + + abstract fun aDouble(pigeon_instance: ProxyApiTestClass): Double + + abstract fun aString(pigeon_instance: ProxyApiTestClass): String + + abstract fun aUint8List(pigeon_instance: ProxyApiTestClass): ByteArray + + abstract fun aList(pigeon_instance: ProxyApiTestClass): List + + abstract fun aMap(pigeon_instance: ProxyApiTestClass): Map + + abstract fun anEnum(pigeon_instance: ProxyApiTestClass): ProxyApiTestEnum + + abstract fun aProxyApi( + pigeon_instance: ProxyApiTestClass + ): com.example.test_plugin.ProxyApiSuperClass + + abstract fun aNullableBool(pigeon_instance: ProxyApiTestClass): Boolean? + + abstract fun aNullableInt(pigeon_instance: ProxyApiTestClass): Long? + + abstract fun aNullableDouble(pigeon_instance: ProxyApiTestClass): Double? + + abstract fun aNullableString(pigeon_instance: ProxyApiTestClass): String? + + abstract fun aNullableUint8List(pigeon_instance: ProxyApiTestClass): ByteArray? + + abstract fun aNullableList(pigeon_instance: ProxyApiTestClass): List? + + abstract fun aNullableMap(pigeon_instance: ProxyApiTestClass): Map? + + abstract fun aNullableEnum(pigeon_instance: ProxyApiTestClass): ProxyApiTestEnum? + + abstract fun aNullableProxyApi( + pigeon_instance: ProxyApiTestClass + ): com.example.test_plugin.ProxyApiSuperClass? + + /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ + abstract fun noop(pigeon_instance: ProxyApiTestClass) + + /** Returns an error, to test error handling. */ + abstract fun throwError(pigeon_instance: ProxyApiTestClass): Any? + + /** Returns an error from a void function, to test error handling. */ + abstract fun throwErrorFromVoid(pigeon_instance: ProxyApiTestClass) + + /** Returns a Flutter error, to test error handling. */ + abstract fun throwFlutterError(pigeon_instance: ProxyApiTestClass): Any? + + /** Returns passed in int. */ + abstract fun echoInt(pigeon_instance: ProxyApiTestClass, anInt: Long): Long + + /** Returns passed in double. */ + abstract fun echoDouble(pigeon_instance: ProxyApiTestClass, aDouble: Double): Double + + /** Returns the passed in boolean. */ + abstract fun echoBool(pigeon_instance: ProxyApiTestClass, aBool: Boolean): Boolean + + /** Returns the passed in string. */ + abstract fun echoString(pigeon_instance: ProxyApiTestClass, aString: String): String + + /** Returns the passed in Uint8List. */ + abstract fun echoUint8List(pigeon_instance: ProxyApiTestClass, aUint8List: ByteArray): ByteArray + + /** Returns the passed in generic Object. */ + abstract fun echoObject(pigeon_instance: ProxyApiTestClass, anObject: Any): Any + + /** Returns the passed list, to test serialization and deserialization. */ + abstract fun echoList(pigeon_instance: ProxyApiTestClass, aList: List): List + + /** Returns the passed list with ProxyApis, to test serialization and deserialization. */ + abstract fun echoProxyApiList( + pigeon_instance: ProxyApiTestClass, + aList: List + ): List + + /** Returns the passed map, to test serialization and deserialization. */ + abstract fun echoMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map + ): Map + + /** Returns the passed map with ProxyApis, to test serialization and deserialization. */ + abstract fun echoProxyApiMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map + ): Map + + /** Returns the passed enum to test serialization and deserialization. */ + abstract fun echoEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum + ): ProxyApiTestEnum + + /** Returns the passed ProxyApi to test serialization and deserialization. */ + abstract fun echoProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: com.example.test_plugin.ProxyApiSuperClass + ): com.example.test_plugin.ProxyApiSuperClass + + /** Returns passed in int. */ + abstract fun echoNullableInt(pigeon_instance: ProxyApiTestClass, aNullableInt: Long?): Long? + + /** Returns passed in double. */ + abstract fun echoNullableDouble( + pigeon_instance: ProxyApiTestClass, + aNullableDouble: Double? + ): Double? + + /** Returns the passed in boolean. */ + abstract fun echoNullableBool( + pigeon_instance: ProxyApiTestClass, + aNullableBool: Boolean? + ): Boolean? + + /** Returns the passed in string. */ + abstract fun echoNullableString( + pigeon_instance: ProxyApiTestClass, + aNullableString: String? + ): String? + + /** Returns the passed in Uint8List. */ + abstract fun echoNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aNullableUint8List: ByteArray? + ): ByteArray? + + /** Returns the passed in generic Object. */ + abstract fun echoNullableObject(pigeon_instance: ProxyApiTestClass, aNullableObject: Any?): Any? + + /** Returns the passed list, to test serialization and deserialization. */ + abstract fun echoNullableList( + pigeon_instance: ProxyApiTestClass, + aNullableList: List? + ): List? + + /** Returns the passed map, to test serialization and deserialization. */ + abstract fun echoNullableMap( + pigeon_instance: ProxyApiTestClass, + aNullableMap: Map? + ): Map? + + abstract fun echoNullableEnum( + pigeon_instance: ProxyApiTestClass, + aNullableEnum: ProxyApiTestEnum? + ): ProxyApiTestEnum? + + /** Returns the passed ProxyApi to test serialization and deserialization. */ + abstract fun echoNullableProxyApi( + pigeon_instance: ProxyApiTestClass, + aNullableProxyApi: com.example.test_plugin.ProxyApiSuperClass? + ): com.example.test_plugin.ProxyApiSuperClass? + + /** + * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous + * calling. + */ + abstract fun noopAsync(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) + + /** Returns passed in int asynchronously. */ + abstract fun echoAsyncInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long, + callback: (Result) -> Unit + ) + + /** Returns passed in double asynchronously. */ + abstract fun echoAsyncDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double, + callback: (Result) -> Unit + ) + + /** Returns the passed in boolean asynchronously. */ + abstract fun echoAsyncBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean, + callback: (Result) -> Unit + ) + + /** Returns the passed string asynchronously. */ + abstract fun echoAsyncString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) + + /** Returns the passed in Uint8List asynchronously. */ + abstract fun echoAsyncUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray, + callback: (Result) -> Unit + ) + + /** Returns the passed in generic Object asynchronously. */ + abstract fun echoAsyncObject( + pigeon_instance: ProxyApiTestClass, + anObject: Any, + callback: (Result) -> Unit + ) + + /** Returns the passed list, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) + + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) + + /** Returns the passed enum, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, + callback: (Result) -> Unit + ) + + /** Responds with an error from an async function returning a value. */ + abstract fun throwAsyncError(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) + + /** Responds with an error from an async void function. */ + abstract fun throwAsyncErrorFromVoid( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + /** Responds with a Flutter error from an async function returning a value. */ + abstract fun throwAsyncFlutterError( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + /** Returns passed in int asynchronously. */ + abstract fun echoAsyncNullableInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long?, + callback: (Result) -> Unit + ) + + /** Returns passed in double asynchronously. */ + abstract fun echoAsyncNullableDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double?, + callback: (Result) -> Unit + ) + + /** Returns the passed in boolean asynchronously. */ + abstract fun echoAsyncNullableBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean?, + callback: (Result) -> Unit + ) + + /** Returns the passed string asynchronously. */ + abstract fun echoAsyncNullableString( + pigeon_instance: ProxyApiTestClass, + aString: String?, + callback: (Result) -> Unit + ) + + /** Returns the passed in Uint8List asynchronously. */ + abstract fun echoAsyncNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray?, + callback: (Result) -> Unit + ) + + /** Returns the passed in generic Object asynchronously. */ + abstract fun echoAsyncNullableObject( + pigeon_instance: ProxyApiTestClass, + anObject: Any?, + callback: (Result) -> Unit + ) + + /** Returns the passed list, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncNullableList( + pigeon_instance: ProxyApiTestClass, + aList: List?, + callback: (Result?>) -> Unit + ) + + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncNullableMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map?, + callback: (Result?>) -> Unit + ) + + /** Returns the passed enum, to test asynchronous serialization and deserialization. */ + abstract fun echoAsyncNullableEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, + callback: (Result) -> Unit + ) + + abstract fun staticNoop() + + abstract fun echoStaticString(aString: String): String + + abstract fun staticAsyncNoop(callback: (Result) -> Unit) + + abstract fun callFlutterNoop(pigeon_instance: ProxyApiTestClass, callback: (Result) -> Unit) + + abstract fun callFlutterThrowError( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + abstract fun callFlutterThrowErrorFromVoid( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) + + abstract fun callFlutterEchoProxyApiList( + pigeon_instance: ProxyApiTestClass, + aList: List, + callback: (Result>) -> Unit + ) + + abstract fun callFlutterEchoMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) + + abstract fun callFlutterEchoProxyApiMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map, + callback: (Result>) -> Unit + ) + + abstract fun callFlutterEchoEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: com.example.test_plugin.ProxyApiSuperClass, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableBool( + pigeon_instance: ProxyApiTestClass, + aBool: Boolean?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableInt( + pigeon_instance: ProxyApiTestClass, + anInt: Long?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableDouble( + pigeon_instance: ProxyApiTestClass, + aDouble: Double?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableString( + pigeon_instance: ProxyApiTestClass, + aString: String?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableUint8List( + pigeon_instance: ProxyApiTestClass, + aUint8List: ByteArray?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableList( + pigeon_instance: ProxyApiTestClass, + aList: List?, + callback: (Result?>) -> Unit + ) + + abstract fun callFlutterEchoNullableMap( + pigeon_instance: ProxyApiTestClass, + aMap: Map?, + callback: (Result?>) -> Unit + ) + + abstract fun callFlutterEchoNullableEnum( + pigeon_instance: ProxyApiTestClass, + anEnum: ProxyApiTestEnum?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoNullableProxyApi( + pigeon_instance: ProxyApiTestClass, + aProxyApi: com.example.test_plugin.ProxyApiSuperClass?, + callback: (Result) -> Unit + ) + + abstract fun callFlutterNoopAsync( + pigeon_instance: ProxyApiTestClass, + callback: (Result) -> Unit + ) + + abstract fun callFlutterEchoAsyncString( + pigeon_instance: ProxyApiTestClass, + aString: String, + callback: (Result) -> Unit + ) + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiTestClass?) { + val codec = api?.pigeonRegistrar?.codec ?: ProxyApiTestsPigeonCodec() + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_defaultConstructor", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_identifierArg = args[0] as Long + val aBoolArg = args[1] as Boolean + val anIntArg = args[2] as Long + val aDoubleArg = args[3] as Double + val aStringArg = args[4] as String + val aUint8ListArg = args[5] as ByteArray + val aListArg = args[6] as List + val aMapArg = args[7] as Map + val anEnumArg = args[8] as ProxyApiTestEnum + val aProxyApiArg = args[9] as com.example.test_plugin.ProxyApiSuperClass + val aNullableBoolArg = args[10] as Boolean? + val aNullableIntArg = args[11] as Long? + val aNullableDoubleArg = args[12] as Double? + val aNullableStringArg = args[13] as String? + val aNullableUint8ListArg = args[14] as ByteArray? + val aNullableListArg = args[15] as List? + val aNullableMapArg = args[16] as Map? + val aNullableEnumArg = args[17] as ProxyApiTestEnum? + val aNullableProxyApiArg = args[18] as com.example.test_plugin.ProxyApiSuperClass? + val boolParamArg = args[19] as Boolean + val intParamArg = args[20] as Long + val doubleParamArg = args[21] as Double + val stringParamArg = args[22] as String + val aUint8ListParamArg = args[23] as ByteArray + val listParamArg = args[24] as List + val mapParamArg = args[25] as Map + val enumParamArg = args[26] as ProxyApiTestEnum + val proxyApiParamArg = args[27] as com.example.test_plugin.ProxyApiSuperClass + val nullableBoolParamArg = args[28] as Boolean? + val nullableIntParamArg = args[29] as Long? + val nullableDoubleParamArg = args[30] as Double? + val nullableStringParamArg = args[31] as String? + val nullableUint8ListParamArg = args[32] as ByteArray? + val nullableListParamArg = args[33] as List? + val nullableMapParamArg = args[34] as Map? + val nullableEnumParamArg = args[35] as ProxyApiTestEnum? + val nullableProxyApiParamArg = args[36] as com.example.test_plugin.ProxyApiSuperClass? + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.pigeon_defaultConstructor( + aBoolArg, + anIntArg, + aDoubleArg, + aStringArg, + aUint8ListArg, + aListArg, + aMapArg, + anEnumArg, + aProxyApiArg, + aNullableBoolArg, + aNullableIntArg, + aNullableDoubleArg, + aNullableStringArg, + aNullableUint8ListArg, + aNullableListArg, + aNullableMapArg, + aNullableEnumArg, + aNullableProxyApiArg, + boolParamArg, + intParamArg, + doubleParamArg, + stringParamArg, + aUint8ListParamArg, + listParamArg, + mapParamArg, + enumParamArg, + proxyApiParamArg, + nullableBoolParamArg, + nullableIntParamArg, + nullableDoubleParamArg, + nullableStringParamArg, + nullableUint8ListParamArg, + nullableListParamArg, + nullableMapParamArg, + nullableEnumParamArg, + nullableProxyApiParamArg), + pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.attachedField", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val pigeon_identifierArg = args[1] as Long + val wrapped: List = + try { + api.pigeonRegistrar.instanceManager.addDartCreatedInstance( + api.attachedField(pigeon_instanceArg), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAttachedField", + 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.staticAttachedField(), pigeon_identifierArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noop", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val wrapped: List = + try { + api.noop(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwError", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val wrapped: List = + try { + listOf(api.throwError(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwErrorFromVoid", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val wrapped: List = + try { + api.throwErrorFromVoid(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwFlutterError", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val wrapped: List = + try { + listOf(api.throwFlutterError(pigeon_instanceArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoInt", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anIntArg = args[1] as Long + val wrapped: List = + try { + listOf(api.echoInt(pigeon_instanceArg, anIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoDouble", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aDoubleArg = args[1] as Double + val wrapped: List = + try { + listOf(api.echoDouble(pigeon_instanceArg, aDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoBool", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aBoolArg = args[1] as Boolean + val wrapped: List = + try { + listOf(api.echoBool(pigeon_instanceArg, aBoolArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoString", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String + val wrapped: List = + try { + listOf(api.echoString(pigeon_instanceArg, aStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoUint8List", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aUint8ListArg = args[1] as ByteArray + val wrapped: List = + try { + listOf(api.echoUint8List(pigeon_instanceArg, aUint8ListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoObject", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anObjectArg = args[1] as Any + val wrapped: List = + try { + listOf(api.echoObject(pigeon_instanceArg, anObjectArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoList", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List + val wrapped: List = + try { + listOf(api.echoList(pigeon_instanceArg, aListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiList", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List + val wrapped: List = + try { + listOf(api.echoProxyApiList(pigeon_instanceArg, aListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoMap", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map + val wrapped: List = + try { + listOf(api.echoMap(pigeon_instanceArg, aMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApiMap", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map + val wrapped: List = + try { + listOf(api.echoProxyApiMap(pigeon_instanceArg, aMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoEnum", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anEnumArg = args[1] as ProxyApiTestEnum + val wrapped: List = + try { + listOf(api.echoEnum(pigeon_instanceArg, anEnumArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoProxyApi", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass + val wrapped: List = + try { + listOf(api.echoProxyApi(pigeon_instanceArg, aProxyApiArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableInt", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableIntArg = args[1] as Long? + val wrapped: List = + try { + listOf(api.echoNullableInt(pigeon_instanceArg, aNullableIntArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableDouble", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableDoubleArg = args[1] as Double? + val wrapped: List = + try { + listOf(api.echoNullableDouble(pigeon_instanceArg, aNullableDoubleArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableBool", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableBoolArg = args[1] as Boolean? + val wrapped: List = + try { + listOf(api.echoNullableBool(pigeon_instanceArg, aNullableBoolArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableString", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableStringArg = args[1] as String? + val wrapped: List = + try { + listOf(api.echoNullableString(pigeon_instanceArg, aNullableStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableUint8List", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableUint8ListArg = args[1] as ByteArray? + val wrapped: List = + try { + listOf(api.echoNullableUint8List(pigeon_instanceArg, aNullableUint8ListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableObject", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableObjectArg = args[1] + val wrapped: List = + try { + listOf(api.echoNullableObject(pigeon_instanceArg, aNullableObjectArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableList", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableListArg = args[1] as List? + val wrapped: List = + try { + listOf(api.echoNullableList(pigeon_instanceArg, aNullableListArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableMap", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableMapArg = args[1] as Map? + val wrapped: List = + try { + listOf(api.echoNullableMap(pigeon_instanceArg, aNullableMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableEnum", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableEnumArg = args[1] as ProxyApiTestEnum? + val wrapped: List = + try { + listOf(api.echoNullableEnum(pigeon_instanceArg, aNullableEnumArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoNullableProxyApi", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aNullableProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass? + val wrapped: List = + try { + listOf(api.echoNullableProxyApi(pigeon_instanceArg, aNullableProxyApiArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.noopAsync", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.noopAsync(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncInt", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anIntArg = args[1] as Long + api.echoAsyncInt(pigeon_instanceArg, anIntArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncDouble", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aDoubleArg = args[1] as Double + api.echoAsyncDouble(pigeon_instanceArg, aDoubleArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncBool", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aBoolArg = args[1] as Boolean + api.echoAsyncBool(pigeon_instanceArg, aBoolArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncString", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String + api.echoAsyncString(pigeon_instanceArg, aStringArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncUint8List", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aUint8ListArg = args[1] as ByteArray + api.echoAsyncUint8List(pigeon_instanceArg, aUint8ListArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncObject", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anObjectArg = args[1] as Any + api.echoAsyncObject(pigeon_instanceArg, anObjectArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncList", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List + api.echoAsyncList(pigeon_instanceArg, aListArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncMap", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map + api.echoAsyncMap(pigeon_instanceArg, aMapArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncEnum", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anEnumArg = args[1] as ProxyApiTestEnum + api.echoAsyncEnum(pigeon_instanceArg, anEnumArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncError", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.throwAsyncError(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncErrorFromVoid", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.throwAsyncErrorFromVoid(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.throwAsyncFlutterError", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.throwAsyncFlutterError(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableInt", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anIntArg = args[1] as Long? + api.echoAsyncNullableInt(pigeon_instanceArg, anIntArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableDouble", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aDoubleArg = args[1] as Double? + api.echoAsyncNullableDouble(pigeon_instanceArg, aDoubleArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableBool", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aBoolArg = args[1] as Boolean? + api.echoAsyncNullableBool(pigeon_instanceArg, aBoolArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableString", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String? + api.echoAsyncNullableString(pigeon_instanceArg, aStringArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableUint8List", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aUint8ListArg = args[1] as ByteArray? + api.echoAsyncNullableUint8List(pigeon_instanceArg, aUint8ListArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableObject", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anObjectArg = args[1] + api.echoAsyncNullableObject(pigeon_instanceArg, anObjectArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableList", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List? + api.echoAsyncNullableList(pigeon_instanceArg, aListArg) { result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableMap", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map? + api.echoAsyncNullableMap(pigeon_instanceArg, aMapArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoAsyncNullableEnum", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anEnumArg = args[1] as ProxyApiTestEnum? + api.echoAsyncNullableEnum(pigeon_instanceArg, anEnumArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticNoop", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + val wrapped: List = + try { + api.staticNoop() + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.echoStaticString", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val aStringArg = args[0] as String + val wrapped: List = + try { + listOf(api.echoStaticString(aStringArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.staticAsyncNoop", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + api.staticAsyncNoop { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoop", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.callFlutterNoop(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowError", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.callFlutterThrowError(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterThrowErrorFromVoid", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.callFlutterThrowErrorFromVoid(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoBool", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aBoolArg = args[1] as Boolean + api.callFlutterEchoBool(pigeon_instanceArg, aBoolArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoInt", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anIntArg = args[1] as Long + api.callFlutterEchoInt(pigeon_instanceArg, anIntArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoDouble", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aDoubleArg = args[1] as Double + api.callFlutterEchoDouble(pigeon_instanceArg, aDoubleArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoString", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String + api.callFlutterEchoString(pigeon_instanceArg, aStringArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoUint8List", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aUint8ListArg = args[1] as ByteArray + api.callFlutterEchoUint8List(pigeon_instanceArg, aUint8ListArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoList", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List + api.callFlutterEchoList(pigeon_instanceArg, aListArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiList", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List + api.callFlutterEchoProxyApiList(pigeon_instanceArg, aListArg) { + result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoMap", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map + api.callFlutterEchoMap(pigeon_instanceArg, aMapArg) { result: Result> + -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApiMap", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map + api.callFlutterEchoProxyApiMap(pigeon_instanceArg, aMapArg) { + result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoEnum", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anEnumArg = args[1] as ProxyApiTestEnum + api.callFlutterEchoEnum(pigeon_instanceArg, anEnumArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoProxyApi", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass + api.callFlutterEchoProxyApi(pigeon_instanceArg, aProxyApiArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableBool", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aBoolArg = args[1] as Boolean? + api.callFlutterEchoNullableBool(pigeon_instanceArg, aBoolArg) { result: Result + -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableInt", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anIntArg = args[1] as Long? + api.callFlutterEchoNullableInt(pigeon_instanceArg, anIntArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableDouble", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aDoubleArg = args[1] as Double? + api.callFlutterEchoNullableDouble(pigeon_instanceArg, aDoubleArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableString", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String? + api.callFlutterEchoNullableString(pigeon_instanceArg, aStringArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableUint8List", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aUint8ListArg = args[1] as ByteArray? + api.callFlutterEchoNullableUint8List(pigeon_instanceArg, aUint8ListArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableList", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aListArg = args[1] as List? + api.callFlutterEchoNullableList(pigeon_instanceArg, aListArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableMap", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aMapArg = args[1] as Map? + api.callFlutterEchoNullableMap(pigeon_instanceArg, aMapArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableEnum", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val anEnumArg = args[1] as ProxyApiTestEnum? + api.callFlutterEchoNullableEnum(pigeon_instanceArg, anEnumArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoNullableProxyApi", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aProxyApiArg = args[1] as com.example.test_plugin.ProxyApiSuperClass? + api.callFlutterEchoNullableProxyApi(pigeon_instanceArg, aProxyApiArg) { + result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterNoopAsync", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + api.callFlutterNoopAsync(pigeon_instanceArg) { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.callFlutterEchoAsyncString", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ProxyApiTestClass + val aStringArg = args[1] as String + api.callFlutterEchoAsyncString(pigeon_instanceArg, aStringArg) { result: Result + -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of ProxyApiTestClass and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("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 aBoolArg = aBool(pigeon_instanceArg) + val anIntArg = anInt(pigeon_instanceArg) + val aDoubleArg = aDouble(pigeon_instanceArg) + val aStringArg = aString(pigeon_instanceArg) + val aUint8ListArg = aUint8List(pigeon_instanceArg) + val aListArg = aList(pigeon_instanceArg) + val aMapArg = aMap(pigeon_instanceArg) + val anEnumArg = anEnum(pigeon_instanceArg) + val aProxyApiArg = aProxyApi(pigeon_instanceArg) + val aNullableBoolArg = aNullableBool(pigeon_instanceArg) + val aNullableIntArg = aNullableInt(pigeon_instanceArg) + val aNullableDoubleArg = aNullableDouble(pigeon_instanceArg) + val aNullableStringArg = aNullableString(pigeon_instanceArg) + val aNullableUint8ListArg = aNullableUint8List(pigeon_instanceArg) + val aNullableListArg = aNullableList(pigeon_instanceArg) + val aNullableMapArg = aNullableMap(pigeon_instanceArg) + val aNullableEnumArg = aNullableEnum(pigeon_instanceArg) + val aNullableProxyApiArg = aNullableProxyApi(pigeon_instanceArg) + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send( + listOf( + pigeon_identifierArg, + aBoolArg, + anIntArg, + aDoubleArg, + aStringArg, + aUint8ListArg, + aListArg, + aMapArg, + anEnumArg, + aProxyApiArg, + aNullableBoolArg, + aNullableIntArg, + aNullableDoubleArg, + aNullableStringArg, + aNullableUint8ListArg, + aNullableListArg, + aNullableMapArg, + aNullableEnumArg, + aNullableProxyApiArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** A no-op function taking no arguments and returning no value, to sanity test basic calling. */ + fun flutterNoop(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoop" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Responds with an error from an async function returning a value. */ + fun flutterThrowError(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowError" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Responds with an error from an async void function. */ + fun flutterThrowErrorFromVoid( + pigeon_instanceArg: ProxyApiTestClass, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterThrowErrorFromVoid" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed boolean, to test serialization and deserialization. */ + fun flutterEchoBool( + pigeon_instanceArg: ProxyApiTestClass, + aBoolArg: Boolean, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoBool" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aBoolArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Boolean + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed int, to test serialization and deserialization. */ + fun flutterEchoInt( + pigeon_instanceArg: ProxyApiTestClass, + anIntArg: Long, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoInt" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, anIntArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Long + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed double, to test serialization and deserialization. */ + fun flutterEchoDouble( + pigeon_instanceArg: ProxyApiTestClass, + aDoubleArg: Double, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoDouble" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aDoubleArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Double + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed string, to test serialization and deserialization. */ + fun flutterEchoString( + pigeon_instanceArg: ProxyApiTestClass, + aStringArg: String, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoString" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aStringArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as String + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed byte list, to test serialization and deserialization. */ + fun flutterEchoUint8List( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: ByteArray, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoUint8List" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as ByteArray + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed list, to test serialization and deserialization. */ + fun flutterEchoList( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: List, + callback: (Result>) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoList" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as List + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed list with ProxyApis, to test serialization and deserialization. */ + fun flutterEchoProxyApiList( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: List, + callback: (Result>) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiList" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as List + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed map, to test serialization and deserialization. */ + fun flutterEchoMap( + pigeon_instanceArg: ProxyApiTestClass, + aMapArg: Map, + callback: (Result>) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoMap" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Map + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed map with ProxyApis, to test serialization and deserialization. */ + fun flutterEchoProxyApiMap( + pigeon_instanceArg: ProxyApiTestClass, + aMapArg: Map, + callback: (Result>) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApiMap" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Map + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed enum to test serialization and deserialization. */ + fun flutterEchoEnum( + pigeon_instanceArg: ProxyApiTestClass, + anEnumArg: ProxyApiTestEnum, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoEnum" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, anEnumArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as ProxyApiTestEnum + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed ProxyApi to test serialization and deserialization. */ + fun flutterEchoProxyApi( + pigeon_instanceArg: ProxyApiTestClass, + aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoProxyApi" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aProxyApiArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as com.example.test_plugin.ProxyApiSuperClass + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed boolean, to test serialization and deserialization. */ + fun flutterEchoNullableBool( + pigeon_instanceArg: ProxyApiTestClass, + aBoolArg: Boolean?, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableBool" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aBoolArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as Boolean? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed int, to test serialization and deserialization. */ + fun flutterEchoNullableInt( + pigeon_instanceArg: ProxyApiTestClass, + anIntArg: Long?, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableInt" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, anIntArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as Long? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed double, to test serialization and deserialization. */ + fun flutterEchoNullableDouble( + pigeon_instanceArg: ProxyApiTestClass, + aDoubleArg: Double?, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableDouble" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aDoubleArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as Double? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed string, to test serialization and deserialization. */ + fun flutterEchoNullableString( + pigeon_instanceArg: ProxyApiTestClass, + aStringArg: String?, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableString" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aStringArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as String? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed byte list, to test serialization and deserialization. */ + fun flutterEchoNullableUint8List( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: ByteArray?, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableUint8List" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as ByteArray? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed list, to test serialization and deserialization. */ + fun flutterEchoNullableList( + pigeon_instanceArg: ProxyApiTestClass, + aListArg: List?, + callback: (Result?>) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableList" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aListArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as List? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed map, to test serialization and deserialization. */ + fun flutterEchoNullableMap( + pigeon_instanceArg: ProxyApiTestClass, + aMapArg: Map?, + callback: (Result?>) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableMap" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as Map? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed enum to test serialization and deserialization. */ + fun flutterEchoNullableEnum( + pigeon_instanceArg: ProxyApiTestClass, + anEnumArg: ProxyApiTestEnum?, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableEnum" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, anEnumArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as ProxyApiTestEnum? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed ProxyApi to test serialization and deserialization. */ + fun flutterEchoNullableProxyApi( + pigeon_instanceArg: ProxyApiTestClass, + aProxyApiArg: com.example.test_plugin.ProxyApiSuperClass?, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoNullableProxyApi" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aProxyApiArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as com.example.test_plugin.ProxyApiSuperClass? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** + * A no-op function taking no arguments and returning no value, to sanity test basic asynchronous + * calling. + */ + fun flutterNoopAsync(pigeon_instanceArg: ProxyApiTestClass, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterNoopAsync" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + /** Returns the passed in generic Object asynchronously. */ + fun flutterEchoAsyncString( + pigeon_instanceArg: ProxyApiTestClass, + aStringArg: String, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiTestClass.flutterEchoAsyncString" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg, aStringArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + ProxyApiTestsError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as String + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + @Suppress("FunctionName") + /** An implementation of [PigeonApiProxyApiSuperClass] used to access callback methods */ + fun pigeon_getPigeonApiProxyApiSuperClass(): PigeonApiProxyApiSuperClass { + return pigeonRegistrar.getPigeonApiProxyApiSuperClass() + } + + @Suppress("FunctionName") + /** An implementation of [PigeonApiProxyApiInterface] used to access callback methods */ + fun pigeon_getPigeonApiProxyApiInterface(): PigeonApiProxyApiInterface { + return pigeonRegistrar.getPigeonApiProxyApiInterface() + } +} +/** ProxyApi to serve as a super class to the core ProxyApi class. */ +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiProxyApiSuperClass( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar +) { + abstract fun pigeon_defaultConstructor(): com.example.test_plugin.ProxyApiSuperClass + + abstract fun aSuperMethod(pigeon_instance: com.example.test_plugin.ProxyApiSuperClass) + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiProxyApiSuperClass?) { + val codec = api?.pigeonRegistrar?.codec ?: ProxyApiTestsPigeonCodec() + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.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) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiSuperClass.aSuperMethod", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as com.example.test_plugin.ProxyApiSuperClass + val wrapped: List = + try { + api.aSuperMethod(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of ProxyApiSuperClass and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance( + pigeon_instanceArg: com.example.test_plugin.ProxyApiSuperClass, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("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.pigeon_integration_tests.ProxyApiSuperClass.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } +} +/** ProxyApi to serve as an interface to the core ProxyApi class. */ +@Suppress("UNCHECKED_CAST") +open class PigeonApiProxyApiInterface( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar +) { + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of ProxyApiInterface and attaches it to [pigeon_instanceArg]. */ + fun pigeon_newInstance(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("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.pigeon_integration_tests.ProxyApiInterface.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + + fun anInterfaceMethod(pigeon_instanceArg: ProxyApiInterface, callback: (Result) -> Unit) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("ignore-calls-error", "Calls to Dart are being ignored.", ""))) + return + } + val binaryMessenger = pigeonRegistrar.binaryMessenger + val codec = pigeonRegistrar.codec + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.ProxyApiInterface.anInterfaceMethod" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_instanceArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } +} + +@Suppress("UNCHECKED_CAST") +abstract class PigeonApiClassWithApiRequirement( + open val pigeonRegistrar: ProxyApiTestsPigeonProxyApiRegistrar +) { + @androidx.annotation.RequiresApi(api = 25) + abstract fun pigeon_defaultConstructor(): ClassWithApiRequirement + + @androidx.annotation.RequiresApi(api = 25) + abstract fun aMethod(pigeon_instance: ClassWithApiRequirement) + + companion object { + @Suppress("LocalVariableName") + fun setUpMessageHandlers( + binaryMessenger: BinaryMessenger, + api: PigeonApiClassWithApiRequirement? + ) { + val codec = api?.pigeonRegistrar?.codec ?: ProxyApiTestsPigeonCodec() + if (android.os.Build.VERSION.SDK_INT >= 25) { + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.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) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } else { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.pigeon_defaultConstructor", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + reply.reply( + wrapError( + UnsupportedOperationException( + "Call references class `ClassWithApiRequirement`, which requires api version 25."))) + } + } else { + channel.setMessageHandler(null) + } + } + if (android.os.Build.VERSION.SDK_INT >= 25) { + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val pigeon_instanceArg = args[0] as ClassWithApiRequirement + val wrapped: List = + try { + api.aMethod(pigeon_instanceArg) + listOf(null) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + } else { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.ClassWithApiRequirement.aMethod", + codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + reply.reply( + wrapError( + UnsupportedOperationException( + "Call references class `ClassWithApiRequirement`, which requires api version 25."))) + } + } else { + channel.setMessageHandler(null) + } + } + } + } + + @Suppress("LocalVariableName", "FunctionName") + /** Creates a Dart instance of ClassWithApiRequirement and attaches it to [pigeon_instanceArg]. */ + @androidx.annotation.RequiresApi(api = 25) + fun pigeon_newInstance( + pigeon_instanceArg: ClassWithApiRequirement, + callback: (Result) -> Unit + ) { + if (pigeonRegistrar.ignoreCallsToDart) { + callback( + Result.failure( + ProxyApiTestsError("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.pigeon_integration_tests.ClassWithApiRequirement.pigeon_newInstance" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(pigeon_identifierArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback( + Result.failure( + ProxyApiTestsError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + callback(Result.success(Unit)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } +} From c1f23ae39e47f47f8a9c2c253f196c9f60edec60 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:06:53 -0400 Subject: [PATCH 74/77] analyze error --- packages/pigeon/test/generator_tools_test.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/pigeon/test/generator_tools_test.dart b/packages/pigeon/test/generator_tools_test.dart index ea257c6db0d6..2ed9239b0a25 100644 --- a/packages/pigeon/test/generator_tools_test.dart +++ b/packages/pigeon/test/generator_tools_test.dart @@ -455,7 +455,6 @@ void main() { print('hello'); }''', - trimIndentation: true, ); expect(buffer.toString(), ''' From b9588796e785c6bcf0a67f929e125bb90b6dadc8 Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:08:49 -0400 Subject: [PATCH 75/77] codec is not private since it is used in registrar --- packages/pigeon/lib/kotlin_generator.dart | 2 +- .../main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index ec6c68576315..4db345054de8 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -802,7 +802,7 @@ if (wrapped == null) { ); indent.writeScoped( - 'private class ${proxyApiCodecName(generatorOptions)}(val registrar: ${proxyApiRegistrarName(generatorOptions)}) : ' + 'class ${proxyApiCodecName(generatorOptions)}(val registrar: ${proxyApiRegistrarName(generatorOptions)}) : ' '${generatorOptions.fileSpecificClassNameComponent}$_codecName() {', '}', () { diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 5858dd63d82d..5360c25b68a2 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -416,9 +416,8 @@ abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryM } } -private class ProxyApiTestsPigeonProxyApiBaseCodec( - val registrar: ProxyApiTestsPigeonProxyApiRegistrar -) : ProxyApiTestsPigeonCodec() { +class ProxyApiTestsPigeonProxyApiBaseCodec(val registrar: ProxyApiTestsPigeonProxyApiRegistrar) : + ProxyApiTestsPigeonCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { From 98d088f0047a567e255fb5953d2ab3c0d38d61db Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:29:50 -0400 Subject: [PATCH 76/77] fix unit test --- packages/pigeon/test/kotlin/proxy_api_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pigeon/test/kotlin/proxy_api_test.dart b/packages/pigeon/test/kotlin/proxy_api_test.dart index d6ddd35377bf..5e1797f6961f 100644 --- a/packages/pigeon/test/kotlin/proxy_api_test.dart +++ b/packages/pigeon/test/kotlin/proxy_api_test.dart @@ -110,7 +110,7 @@ void main() { expect( code, contains( - 'private class MyFilePigeonProxyApiBaseCodec(val registrar: MyFilePigeonProxyApiRegistrar) : MyFilePigeonCodec()')); + 'class MyFilePigeonProxyApiBaseCodec(val registrar: MyFilePigeonProxyApiRegistrar) : MyFilePigeonCodec()')); // Proxy API class expect( From 923e21e06bb920627fe89a63aa833de2930153cf Mon Sep 17 00:00:00 2001 From: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:47:17 -0400 Subject: [PATCH 77/77] use messagecodec instead --- packages/pigeon/lib/kotlin_generator.dart | 6 +++--- .../kotlin/com/example/test_plugin/ProxyApiTests.gen.kt | 9 +++++---- packages/pigeon/test/kotlin/proxy_api_test.dart | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 4db345054de8..3b5ff62aa822 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -802,7 +802,7 @@ if (wrapped == null) { ); indent.writeScoped( - 'class ${proxyApiCodecName(generatorOptions)}(val registrar: ${proxyApiRegistrarName(generatorOptions)}) : ' + 'private class ${proxyApiCodecName(generatorOptions)}(val registrar: ${proxyApiRegistrarName(generatorOptions)}) : ' '${generatorOptions.fileSpecificClassNameComponent}$_codecName() {', '}', () { @@ -1354,8 +1354,8 @@ if (wrapped == null) { indent.format( ''' val instanceManager: $instanceManagerName - private var _codec: ${proxyApiCodecName(generatorOptions)}? = null - val codec: ${proxyApiCodecName(generatorOptions)} + private var _codec: MessageCodec? = null + val codec: MessageCodec get() { if (_codec == null) { _codec = ${proxyApiCodecName(generatorOptions)}(this) diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt index 5360c25b68a2..184a5b00f599 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/ProxyApiTests.gen.kt @@ -347,8 +347,8 @@ abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryM /** Whether APIs should ignore calling to Dart. */ public var ignoreCallsToDart = false val instanceManager: ProxyApiTestsPigeonInstanceManager - private var _codec: ProxyApiTestsPigeonProxyApiBaseCodec? = null - val codec: ProxyApiTestsPigeonProxyApiBaseCodec + private var _codec: MessageCodec? = null + val codec: MessageCodec get() { if (_codec == null) { _codec = ProxyApiTestsPigeonProxyApiBaseCodec(this) @@ -416,8 +416,9 @@ abstract class ProxyApiTestsPigeonProxyApiRegistrar(val binaryMessenger: BinaryM } } -class ProxyApiTestsPigeonProxyApiBaseCodec(val registrar: ProxyApiTestsPigeonProxyApiRegistrar) : - ProxyApiTestsPigeonCodec() { +private class ProxyApiTestsPigeonProxyApiBaseCodec( + val registrar: ProxyApiTestsPigeonProxyApiRegistrar +) : ProxyApiTestsPigeonCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 128.toByte() -> { diff --git a/packages/pigeon/test/kotlin/proxy_api_test.dart b/packages/pigeon/test/kotlin/proxy_api_test.dart index 5e1797f6961f..d6ddd35377bf 100644 --- a/packages/pigeon/test/kotlin/proxy_api_test.dart +++ b/packages/pigeon/test/kotlin/proxy_api_test.dart @@ -110,7 +110,7 @@ void main() { expect( code, contains( - 'class MyFilePigeonProxyApiBaseCodec(val registrar: MyFilePigeonProxyApiRegistrar) : MyFilePigeonCodec()')); + 'private class MyFilePigeonProxyApiBaseCodec(val registrar: MyFilePigeonProxyApiRegistrar) : MyFilePigeonCodec()')); // Proxy API class expect(