From f8c54650c05aaed374939cf7de7dde35ea08a17a Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Wed, 15 Feb 2023 13:52:33 -0500 Subject: [PATCH 01/10] Fold in async_handlers.dart --- packages/pigeon/pigeons/async_handlers.dart | 23 ---- packages/pigeon/pigeons/core_tests.dart | 31 +++++ .../CoreTests.java | 116 +++++++++++++++++ .../AsyncTest.java | 23 ++-- .../ios/RunnerTests/AsyncHandlersTest.m | 96 +++++++------- .../ios/Classes/CoreTests.gen.h | 19 +++ .../ios/Classes/CoreTests.gen.m | 68 ++++++++++ .../lib/core_tests.gen.dart | 100 +++++++++++++++ .../lib/integration_tests.dart | 8 ++ .../lib/src/generated/core_tests.gen.dart | 100 +++++++++++++++ .../com/example/test_plugin/CoreTests.gen.kt | 77 ++++++++++++ .../example/test_plugin/AsyncHandlersTest.kt | 57 +++++---- .../ios/RunnerTests/AsyncHandlersTest.swift | 52 ++++---- .../ios/Classes/CoreTests.gen.swift | 63 ++++++++++ .../macos/Classes/CoreTests.gen.swift | 63 ++++++++++ .../windows/pigeon/core_tests.gen.cpp | 118 ++++++++++++++++++ .../windows/pigeon/core_tests.gen.h | 41 ++++++ packages/pigeon/tool/shared/generation.dart | 1 - packages/pigeon/tool/shared/test_suites.dart | 1 - 19 files changed, 918 insertions(+), 139 deletions(-) delete mode 100644 packages/pigeon/pigeons/async_handlers.dart diff --git a/packages/pigeon/pigeons/async_handlers.dart b/packages/pigeon/pigeons/async_handlers.dart deleted file mode 100644 index 1e7f570fa47..00000000000 --- a/packages/pigeon/pigeons/async_handlers.dart +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:pigeon/pigeon.dart'; - -class Value { - int? number; -} - -@HostApi() -abstract class Api2Host { - @async - Value calculate(Value value); - @async - void voidVoid(); -} - -@FlutterApi() -abstract class Api2Flutter { - @async - Value calculate(Value value); -} diff --git a/packages/pigeon/pigeons/core_tests.dart b/packages/pigeon/pigeons/core_tests.dart index a5a38c7334a..09e48da3bcb 100644 --- a/packages/pigeon/pigeons/core_tests.dart +++ b/packages/pigeon/pigeons/core_tests.dart @@ -538,6 +538,22 @@ abstract class FlutterIntegrationCoreApi { @ObjCSelector('echoNullableMap:') @SwiftFunction('echoNullable(_:)') Map? echoNullableMap(Map? aMap); + + // ========== Async tests ========== + // These are minimal since async FlutterApi only changes Dart generation. + // Currently they aren't integration tested, but having them here ensures + // analysis coverage. + + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. + @async + void noopAsync(); + + /// Returns the passed in generic Object asynchronously. + @async + @ObjCSelector('echoAsyncString:') + @SwiftFunction('echoAsync(_:)') + String echoAsyncString(String aString); } /// An API that can be implemented for minimal, compile-only tests. @@ -545,3 +561,18 @@ abstract class FlutterIntegrationCoreApi { abstract class HostTrivialApi { void noop(); } + +/// A simple API implemented in some unit tests. +// +// This is separate from HostIntegrationCoreApi to avoid having to update a +// lot of unit tests every time we add something to the integration test API. +// TODO(stuartmorgan): Restructure the unit tests to reduce the number of +// different HostApis we define. +@HostApi() +abstract class HostSmallApi { + @async + @ObjCSelector('echoString:') + String echo(String aString); + @async + void voidVoid(); +} 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 695c203d0f6..14d254a7b8b 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 @@ -3453,6 +3453,33 @@ public void echoNullableMap( callback.reply(output); }); } + /** + * A no-op function taking no arguments and returning no value, to sanity test basic + * asynchronous calling. + */ + public void noopAsync(Reply callback) { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync", + getCodec()); + channel.send(null, channelReply -> callback.reply(null)); + } + /** Returns the passed in generic Object asynchronously. */ + public void echoAsyncString(@NonNull String aStringArg, Reply callback) { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString", + getCodec()); + channel.send( + new ArrayList(Collections.singletonList(aStringArg)), + channelReply -> { + @SuppressWarnings("ConstantConditions") + String output = (String) channelReply; + callback.reply(output); + }); + } } /** * An API that can be implemented for minimal, compile-only tests. @@ -3492,4 +3519,93 @@ static void setup(BinaryMessenger binaryMessenger, HostTrivialApi api) { } } } + /** + * A simple API implemented in some unit tests. + * + *

Generated interface from Pigeon that represents a handler of messages from Flutter. + */ + public interface HostSmallApi { + + void echo(@NonNull String aString, Result result); + + void voidVoid(Result result); + + /** The codec used by HostSmallApi. */ + static MessageCodec getCodec() { + return new StandardMessageCodec(); + } + /** Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. */ + static void setup(BinaryMessenger binaryMessenger, HostSmallApi api) { + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, "dev.flutter.pigeon.HostSmallApi.echo", getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList(); + try { + ArrayList args = (ArrayList) message; + assert args != null; + String aStringArg = (String) args.get(0); + if (aStringArg == null) { + throw new NullPointerException("aStringArg unexpectedly null."); + } + Result resultCallback = + new Result() { + public void success(String result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.echo(aStringArg, resultCallback); + } catch (Error | RuntimeException exception) { + ArrayList wrappedError = wrapError(exception); + reply.reply(wrappedError); + } + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, "dev.flutter.pigeon.HostSmallApi.voidVoid", getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList(); + try { + Result resultCallback = + new Result() { + public void success(Void result) { + wrapped.add(0, null); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.voidVoid(resultCallback); + } catch (Error | RuntimeException exception) { + ArrayList wrappedError = wrapError(exception); + reply.reply(wrappedError); + } + }); + } else { + channel.setMessageHandler(null); + } + } + } + } } diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/AsyncTest.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/AsyncTest.java index 786aef3bf9b..29d2d2d51c4 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/AsyncTest.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/AsyncTest.java @@ -7,7 +7,8 @@ import static org.junit.Assert.*; import static org.mockito.Mockito.*; -import com.example.alternate_language_test_plugin.AsyncHandlers.*; +import androidx.annotation.NonNull; +import com.example.alternate_language_test_plugin.CoreTests.*; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.MessageCodec; import java.nio.ByteBuffer; @@ -16,9 +17,9 @@ import org.mockito.ArgumentCaptor; public class AsyncTest { - class Success implements Api2Host { + class Success implements HostSmallApi { @Override - public void calculate(Value value, Result result) { + public void echo(@NonNull String value, Result result) { result.success(value); } @@ -28,9 +29,9 @@ public void voidVoid(Result result) { } } - class Error implements Api2Host { + class Error implements HostSmallApi { @Override - public void calculate(Value value, Result result) { + public void echo(@NonNull String value, Result result) { result.error(new Exception("error")); } @@ -44,12 +45,12 @@ public void voidVoid(Result result) { public void asyncSuccess() { Success api = new Success(); BinaryMessenger binaryMessenger = mock(BinaryMessenger.class); - Api2Host.setup(binaryMessenger, api); + HostSmallApi.setup(binaryMessenger, api); ArgumentCaptor handler = ArgumentCaptor.forClass(BinaryMessenger.BinaryMessageHandler.class); - verify(binaryMessenger).setMessageHandler(eq("dev.flutter.pigeon.Api2Host.calculate"), any()); + verify(binaryMessenger).setMessageHandler(eq("dev.flutter.pigeon.HostSmallApi.echo"), any()); verify(binaryMessenger) - .setMessageHandler(eq("dev.flutter.pigeon.Api2Host.voidVoid"), handler.capture()); + .setMessageHandler(eq("dev.flutter.pigeon.HostSmallApi.voidVoid"), handler.capture()); MessageCodec codec = Pigeon.AndroidApi.getCodec(); ByteBuffer message = codec.encodeMessage(null); Boolean[] didCall = {false}; @@ -71,12 +72,12 @@ public void asyncSuccess() { public void asyncError() { Error api = new Error(); BinaryMessenger binaryMessenger = mock(BinaryMessenger.class); - Api2Host.setup(binaryMessenger, api); + HostSmallApi.setup(binaryMessenger, api); ArgumentCaptor handler = ArgumentCaptor.forClass(BinaryMessenger.BinaryMessageHandler.class); - verify(binaryMessenger).setMessageHandler(eq("dev.flutter.pigeon.Api2Host.calculate"), any()); + verify(binaryMessenger).setMessageHandler(eq("dev.flutter.pigeon.HostSmallApi.echo"), any()); verify(binaryMessenger) - .setMessageHandler(eq("dev.flutter.pigeon.Api2Host.voidVoid"), handler.capture()); + .setMessageHandler(eq("dev.flutter.pigeon.HostSmallApi.voidVoid"), handler.capture()); MessageCodec codec = Pigeon.AndroidApi.getCodec(); ByteBuffer message = codec.encodeMessage(null); Boolean[] didCall = {false}; diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/RunnerTests/AsyncHandlersTest.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/RunnerTests/AsyncHandlersTest.m index e72da1d274b..35b9dc80162 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/RunnerTests/AsyncHandlersTest.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/RunnerTests/AsyncHandlersTest.m @@ -10,26 +10,18 @@ #import "MockBinaryMessenger.h" /////////////////////////////////////////////////////////////////////////////////////////// -@interface Value () -+ (Value *)fromList:(NSArray *)list; -- (NSArray *)toList; -@end - -/////////////////////////////////////////////////////////////////////////////////////////// -@interface MockApi2Host : NSObject -@property(nonatomic, copy) NSNumber *output; +@interface MockHostSmallApi : NSObject +@property(nonatomic, copy) NSString *output; @property(nonatomic, retain) FlutterError *voidVoidError; @end /////////////////////////////////////////////////////////////////////////////////////////// -@implementation MockApi2Host +@implementation MockHostSmallApi -- (void)calculateValue:(Value *)input - completion:(nonnull void (^)(Value *_Nullable, FlutterError *_Nullable))completion { +- (void)echoString:(NSString *)value + completion:(nonnull void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { if (self.output) { - Value *output = [[Value alloc] init]; - output.number = self.output; - completion(output, nil); + completion(self.output, nil); } else { completion(nil, [FlutterError errorWithCode:@"hey" message:@"ho" details:nil]); } @@ -50,15 +42,15 @@ @implementation AsyncHandlersTest - (void)testAsyncHost2Flutter { MockBinaryMessenger *binaryMessenger = - [[MockBinaryMessenger alloc] initWithCodec:Api2FlutterGetCodec()]; - binaryMessenger.result = [Value makeWithNumber:@(2)]; - Api2Flutter *api2Flutter = [[Api2Flutter alloc] initWithBinaryMessenger:binaryMessenger]; - Value *input = [[Value alloc] init]; - input.number = @(1); - XCTestExpectation *expectation = [self expectationWithDescription:@"calculate callback"]; - [api2Flutter calculateValue:input - completion:^(Value *_Nonnull output, FlutterError *_Nullable error) { - XCTAssertEqual(output.number.intValue, 2); + [[MockBinaryMessenger alloc] initWithCodec:FlutterIntegrationCoreApiGetCodec()]; + NSString *value = @"Test"; + binaryMessenger.result = value; + FlutterIntegrationCoreApi *flutterApi = + [[FlutterIntegrationCoreApi alloc] initWithBinaryMessenger:binaryMessenger]; + XCTestExpectation *expectation = [self expectationWithDescription:@"echo callback"]; + [flutterApi echoAsyncString:value + completion:^(NSString *_Nonnull output, FlutterError *_Nullable error) { + XCTAssertEqualObjects(output, value); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:1.0 handler:nil]; @@ -66,11 +58,10 @@ - (void)testAsyncHost2Flutter { - (void)testAsyncFlutter2HostVoidVoid { MockBinaryMessenger *binaryMessenger = - [[MockBinaryMessenger alloc] initWithCodec:Api2HostGetCodec()]; - MockApi2Host *mockApi2Host = [[MockApi2Host alloc] init]; - mockApi2Host.output = @(2); - Api2HostSetup(binaryMessenger, mockApi2Host); - NSString *channelName = @"dev.flutter.pigeon.Api2Host.voidVoid"; + [[MockBinaryMessenger alloc] initWithCodec:HostSmallApiGetCodec()]; + MockHostSmallApi *mockHostSmallApi = [[MockHostSmallApi alloc] init]; + HostSmallApiSetup(binaryMessenger, mockHostSmallApi); + NSString *channelName = @"dev.flutter.pigeon.HostSmallApi.voidVoid"; XCTAssertNotNil(binaryMessenger.handlers[channelName]); XCTestExpectation *expectation = [self expectationWithDescription:@"voidvoid callback"]; @@ -84,18 +75,20 @@ - (void)testAsyncFlutter2HostVoidVoid { - (void)testAsyncFlutter2HostVoidVoidError { MockBinaryMessenger *binaryMessenger = - [[MockBinaryMessenger alloc] initWithCodec:Api2HostGetCodec()]; - MockApi2Host *mockApi2Host = [[MockApi2Host alloc] init]; - mockApi2Host.voidVoidError = [FlutterError errorWithCode:@"code" message:@"message" details:nil]; - Api2HostSetup(binaryMessenger, mockApi2Host); - NSString *channelName = @"dev.flutter.pigeon.Api2Host.voidVoid"; + [[MockBinaryMessenger alloc] initWithCodec:HostSmallApiGetCodec()]; + MockHostSmallApi *mockHostSmallApi = [[MockHostSmallApi alloc] init]; + mockHostSmallApi.voidVoidError = [FlutterError errorWithCode:@"code" + message:@"message" + details:nil]; + HostSmallApiSetup(binaryMessenger, mockHostSmallApi); + NSString *channelName = @"dev.flutter.pigeon.HostSmallApi.voidVoid"; XCTAssertNotNil(binaryMessenger.handlers[channelName]); XCTestExpectation *expectation = [self expectationWithDescription:@"voidvoid callback"]; binaryMessenger.handlers[channelName](nil, ^(NSData *data) { NSArray *outputList = [binaryMessenger.codec decode:data]; XCTAssertNotNil(outputList); - XCTAssertEqualObjects(outputList[0], mockApi2Host.voidVoidError.code); + XCTAssertEqualObjects(outputList[0], mockHostSmallApi.voidVoidError.code); [expectation fulfill]; }); [self waitForExpectationsWithTimeout:1.0 handler:nil]; @@ -103,21 +96,20 @@ - (void)testAsyncFlutter2HostVoidVoidError { - (void)testAsyncFlutter2Host { MockBinaryMessenger *binaryMessenger = - [[MockBinaryMessenger alloc] initWithCodec:Api2HostGetCodec()]; - MockApi2Host *mockApi2Host = [[MockApi2Host alloc] init]; - mockApi2Host.output = @(2); - Api2HostSetup(binaryMessenger, mockApi2Host); - NSString *channelName = @"dev.flutter.pigeon.Api2Host.calculate"; + [[MockBinaryMessenger alloc] initWithCodec:HostSmallApiGetCodec()]; + MockHostSmallApi *mockHostSmallApi = [[MockHostSmallApi alloc] init]; + NSString *value = @"Test"; + mockHostSmallApi.output = value; + HostSmallApiSetup(binaryMessenger, mockHostSmallApi); + NSString *channelName = @"dev.flutter.pigeon.HostSmallApi.echo"; XCTAssertNotNil(binaryMessenger.handlers[channelName]); - Value *input = [[Value alloc] init]; - input.number = @(1); - NSData *inputEncoded = [binaryMessenger.codec encode:@[ input ]]; - XCTestExpectation *expectation = [self expectationWithDescription:@"calculate callback"]; + NSData *inputEncoded = [binaryMessenger.codec encode:@[ value ]]; + XCTestExpectation *expectation = [self expectationWithDescription:@"echo callback"]; binaryMessenger.handlers[channelName](inputEncoded, ^(NSData *data) { NSArray *outputList = [binaryMessenger.codec decode:data]; - Value *output = outputList[0]; - XCTAssertEqual(output.number.intValue, 2); + NSString *output = outputList[0]; + XCTAssertEqualObjects(output, value); [expectation fulfill]; }); [self waitForExpectationsWithTimeout:1.0 handler:nil]; @@ -125,16 +117,14 @@ - (void)testAsyncFlutter2Host { - (void)testAsyncFlutter2HostError { MockBinaryMessenger *binaryMessenger = - [[MockBinaryMessenger alloc] initWithCodec:Api2HostGetCodec()]; - MockApi2Host *mockApi2Host = [[MockApi2Host alloc] init]; - Api2HostSetup(binaryMessenger, mockApi2Host); - NSString *channelName = @"dev.flutter.pigeon.Api2Host.calculate"; + [[MockBinaryMessenger alloc] initWithCodec:HostSmallApiGetCodec()]; + MockHostSmallApi *mockHostSmallApi = [[MockHostSmallApi alloc] init]; + HostSmallApiSetup(binaryMessenger, mockHostSmallApi); + NSString *channelName = @"dev.flutter.pigeon.HostSmallApi.echo"; XCTAssertNotNil(binaryMessenger.handlers[channelName]); - Value *input = [[Value alloc] init]; - input.number = @(1); - NSData *inputEncoded = [binaryMessenger.codec encode:@[ [input toList] ]]; - XCTestExpectation *expectation = [self expectationWithDescription:@"calculate callback"]; + NSData *inputEncoded = [binaryMessenger.codec encode:@[ @"Test" ]]; + XCTestExpectation *expectation = [self expectationWithDescription:@"echo callback"]; binaryMessenger.handlers[channelName](inputEncoded, ^(NSData *data) { NSArray *outputList = [binaryMessenger.codec decode:data]; XCTAssertNotNil(outputList); 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 8672344ed68..15c8ea3d5d8 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 @@ -388,6 +388,12 @@ NSObject *FlutterIntegrationCoreApiGetCodec(void); - (void)echoNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_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; @end /// The codec used by HostTrivialApi. @@ -401,4 +407,17 @@ NSObject *HostTrivialApiGetCodec(void); extern void HostTrivialApiSetup(id binaryMessenger, NSObject *_Nullable api); +/// The codec used by HostSmallApi. +NSObject *HostSmallApiGetCodec(void); + +/// A simple API implemented in some unit tests. +@protocol HostSmallApi +- (void)echoString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)voidVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; +@end + +extern void HostSmallApiSetup(id binaryMessenger, + NSObject *_Nullable api); + 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 263b4608e33..4eb21171520 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 @@ -2022,6 +2022,28 @@ - (void)echoNullableMap:(nullable NSDictionary *)arg_aMap completion(output, nil); }]; } +- (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil + reply:^(id reply) { + completion(nil); + }]; +} +- (void)echoAsyncString:(NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(id reply) { + NSString *output = reply; + completion(output, nil); + }]; +} @end NSObject *HostTrivialApiGetCodec() { @@ -2050,3 +2072,49 @@ void HostTrivialApiSetup(id binaryMessenger, } } } +NSObject *HostSmallApiGetCodec() { + static FlutterStandardMessageCodec *sSharedObject = nil; + sSharedObject = [FlutterStandardMessageCodec sharedInstance]; + return sSharedObject; +} + +void HostSmallApiSetup(id binaryMessenger, NSObject *api) { + { + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] initWithName:@"dev.flutter.pigeon.HostSmallApi.echo" + binaryMessenger:binaryMessenger + codec:HostSmallApiGetCodec()]; + if (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)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] initWithName:@"dev.flutter.pigeon.HostSmallApi.voidVoid" + binaryMessenger:binaryMessenger + codec:HostSmallApiGetCodec()]; + if (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)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } +} diff --git a/packages/pigeon/platform_tests/flutter_null_safe_unit_tests/lib/core_tests.gen.dart b/packages/pigeon/platform_tests/flutter_null_safe_unit_tests/lib/core_tests.gen.dart index 0766a11069a..010dedde06d 100644 --- a/packages/pigeon/platform_tests/flutter_null_safe_unit_tests/lib/core_tests.gen.dart +++ b/packages/pigeon/platform_tests/flutter_null_safe_unit_tests/lib/core_tests.gen.dart @@ -1986,6 +1986,13 @@ abstract class FlutterIntegrationCoreApi { /// Returns the passed map, to test serialization and deserialization. Map? echoNullableMap(Map? aMap); + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. + Future noopAsync(); + + /// Returns the passed in generic Object asynchronously. + Future echoAsyncString(String aString); + static void setup(FlutterIntegrationCoreApi? api, {BinaryMessenger? binaryMessenger}) { { @@ -2354,6 +2361,39 @@ abstract class FlutterIntegrationCoreApi { }); } } + { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync', codec, + binaryMessenger: binaryMessenger); + if (api == null) { + channel.setMessageHandler(null); + } else { + channel.setMessageHandler((Object? message) async { + // ignore message + await api.noopAsync(); + return; + }); + } + } + { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString', codec, + binaryMessenger: binaryMessenger); + if (api == null) { + channel.setMessageHandler(null); + } else { + channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString was null.'); + final List args = (message as List?)!; + final String? arg_aString = (args[0] as String?); + assert(arg_aString != null, + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString was null, expected non-null String.'); + final String output = await api.echoAsyncString(arg_aString!); + return output; + }); + } + } } } @@ -2389,3 +2429,63 @@ class HostTrivialApi { } } } + +/// A simple API implemented in some unit tests. +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}) + : _binaryMessenger = binaryMessenger; + final BinaryMessenger? _binaryMessenger; + + static const MessageCodec codec = StandardMessageCodec(); + + Future echo(String arg_aString) async { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.HostSmallApi.echo', codec, + binaryMessenger: _binaryMessenger); + final List? replyList = + await channel.send([arg_aString]) as List?; + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel.', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (replyList[0] as String?)!; + } + } + + Future voidVoid() async { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.HostSmallApi.voidVoid', codec, + binaryMessenger: _binaryMessenger); + final List? replyList = await channel.send(null) as List?; + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel.', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else { + return; + } + } +} 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 b789e4a7d76..fbc87c570b9 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 @@ -1368,4 +1368,12 @@ class _FlutterApiTestImplementation implements FlutterIntegrationCoreApi { @override Uint8List? echoNullableUint8List(Uint8List? aList) => aList; + + @override + Future noopAsync() async {} + + @override + Future echoAsyncString(String aString) async { + return aString; + } } 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 0766a11069a..010dedde06d 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 @@ -1986,6 +1986,13 @@ abstract class FlutterIntegrationCoreApi { /// Returns the passed map, to test serialization and deserialization. Map? echoNullableMap(Map? aMap); + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. + Future noopAsync(); + + /// Returns the passed in generic Object asynchronously. + Future echoAsyncString(String aString); + static void setup(FlutterIntegrationCoreApi? api, {BinaryMessenger? binaryMessenger}) { { @@ -2354,6 +2361,39 @@ abstract class FlutterIntegrationCoreApi { }); } } + { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync', codec, + binaryMessenger: binaryMessenger); + if (api == null) { + channel.setMessageHandler(null); + } else { + channel.setMessageHandler((Object? message) async { + // ignore message + await api.noopAsync(); + return; + }); + } + } + { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString', codec, + binaryMessenger: binaryMessenger); + if (api == null) { + channel.setMessageHandler(null); + } else { + channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString was null.'); + final List args = (message as List?)!; + final String? arg_aString = (args[0] as String?); + assert(arg_aString != null, + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString was null, expected non-null String.'); + final String output = await api.echoAsyncString(arg_aString!); + return output; + }); + } + } } } @@ -2389,3 +2429,63 @@ class HostTrivialApi { } } } + +/// A simple API implemented in some unit tests. +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}) + : _binaryMessenger = binaryMessenger; + final BinaryMessenger? _binaryMessenger; + + static const MessageCodec codec = StandardMessageCodec(); + + Future echo(String arg_aString) async { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.HostSmallApi.echo', codec, + binaryMessenger: _binaryMessenger); + final List? replyList = + await channel.send([arg_aString]) as List?; + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel.', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else if (replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (replyList[0] as String?)!; + } + } + + Future voidVoid() async { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.HostSmallApi.voidVoid', codec, + binaryMessenger: _binaryMessenger); + final List? replyList = await channel.send(null) as List?; + if (replyList == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel.', + ); + } else if (replyList.length > 1) { + throw PlatformException( + code: replyList[0]! as String, + message: replyList[1] as String?, + details: replyList[2], + ); + } else { + return; + } + } +} 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 1af54e1b812..072e8827a94 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 @@ -1824,6 +1824,24 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { callback(result) } } + /** + * A no-op function taking no arguments and returning no value, to sanity + * test basic asynchronous calling. + */ + fun noopAsync(callback: () -> Unit) { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync", codec) + channel.send(null) { + callback() + } + } + /** Returns the passed in generic Object asynchronously. */ + fun echoAsyncString(aStringArg: String, callback: (String) -> Unit) { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString", codec) + channel.send(listOf(aStringArg)) { + val result = it as String + callback(result) + } + } } /** * An API that can be implemented for minimal, compile-only tests. @@ -1861,3 +1879,62 @@ interface HostTrivialApi { } } } +/** + * A simple API implemented in some unit tests. + * + * Generated interface from Pigeon that represents a handler of messages from Flutter. + */ +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 { + StandardMessageCodec() + } + /** Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. */ + @Suppress("UNCHECKED_CAST") + fun setUp(binaryMessenger: BinaryMessenger, api: HostSmallApi?) { + run { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.HostSmallApi.echo", codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + var wrapped = listOf() + val args = message as List + val aStringArg = args[0] as String + api.echo(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.HostSmallApi.voidVoid", codec) + if (api != null) { + channel.setMessageHandler { _, reply -> + var wrapped = listOf() + api.voidVoid() { result: Result -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + reply.reply(wrapResult(null)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + } + } +} diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/AsyncHandlersTest.kt b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/AsyncHandlersTest.kt index 7deea92db47..97c3bc5d91a 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/AsyncHandlersTest.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/AsyncHandlersTest.kt @@ -18,53 +18,60 @@ internal class AsyncHandlersTest: TestCase() { @Test fun testAsyncHost2Flutter() { val binaryMessenger = mockk() - val api = Api2Flutter(binaryMessenger) + val api = FlutterIntegrationCoreApi(binaryMessenger) - val input = Value(1) - val output = Value(2) + val value = "Test" every { binaryMessenger.send(any(), any(), any()) } answers { - val codec = Api2Flutter.codec + val codec = FlutterIntegrationCoreApi.codec val message = arg(1) val reply = arg(2) message.position(0) - val replyData = codec.encodeMessage(output) + val replyData = codec.encodeMessage(value) replyData?.position(0) reply.reply(replyData) } var didCall = false - api.calculate(input) { + api.echoAsyncString(value) { didCall = true - assertEquals(it, output) + assertEquals(it, value) } assertTrue(didCall) - verify { binaryMessenger.send("dev.flutter.pigeon.Api2Flutter.calculate", any(), any()) } + verify { + binaryMessenger.send( + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString", + any(), + any() + ) + } } @Test - fun testAsyncFlutter2HostCalculate() { + fun testAsyncFlutter2HostEcho() { val binaryMessenger = mockk() - val api = mockk() + val api = mockk() val handlerSlot = slot() - val input = Value(1) - val output = Value(2) - val channelName = "dev.flutter.pigeon.Api2Host.calculate" + val input = "Test" + val output = input + val channelName = "dev.flutter.pigeon.HostSmallApi.echo" - every { binaryMessenger.setMessageHandler("dev.flutter.pigeon.Api2Host.voidVoid", any()) } returns Unit + every { + binaryMessenger.setMessageHandler("dev.flutter.pigeon.HostSmallApi.voidVoid", any()) + } returns Unit every { binaryMessenger.setMessageHandler(channelName, capture(handlerSlot)) } returns Unit - every { api.calculate(any(), any()) } answers { - val callback = arg<(Result) -> Unit>(1) + every { api.echo(any(), any()) } answers { + val callback = arg<(Result) -> Unit>(1) callback(Result.success(output)) } - Api2Host.setUp(binaryMessenger, api) + HostSmallApi.setUp(binaryMessenger, api) - val codec = Api2Host.codec + val codec = HostSmallApi.codec val message = codec.encodeMessage(listOf(input)) message?.rewind() handlerSlot.captured.onMessage(message) { @@ -79,28 +86,30 @@ internal class AsyncHandlersTest: TestCase() { } verify { binaryMessenger.setMessageHandler(channelName, handlerSlot.captured) } - verify { api.calculate(input, any()) } + verify { api.echo(input, any()) } } @Test fun asyncFlutter2HostVoidVoid() { val binaryMessenger = mockk() - val api = mockk() + val api = mockk() val handlerSlot = slot() - val channelName = "dev.flutter.pigeon.Api2Host.voidVoid" + val channelName = "dev.flutter.pigeon.HostSmallApi.voidVoid" every { binaryMessenger.setMessageHandler(channelName, capture(handlerSlot)) } returns Unit - every { binaryMessenger.setMessageHandler("dev.flutter.pigeon.Api2Host.calculate", any()) } returns Unit + every { + binaryMessenger.setMessageHandler("dev.flutter.pigeon.HostSmallApi.echo", any()) + } returns Unit every { api.voidVoid(any()) } answers { val callback = arg<() -> Unit>(0) callback() } - Api2Host.setUp(binaryMessenger, api) + HostSmallApi.setUp(binaryMessenger, api) - val codec = Api2Host.codec + val codec = HostSmallApi.codec val message = codec.encodeMessage(null) handlerSlot.captured.onMessage(message) { it?.rewind() diff --git a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/AsyncHandlersTest.swift b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/AsyncHandlersTest.swift index b9f569114ef..ee64c085abe 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/AsyncHandlersTest.swift +++ b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/AsyncHandlersTest.swift @@ -1,14 +1,15 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import Flutter import XCTest @testable import test_plugin -class MockApi2Host: Api2Host { - var output: Int32? +class MockHostSmallApi: HostSmallApi { + var output: String? - func calculate(value: Value, completion: @escaping (Result) -> Void) { - completion(.success(Value(number: output))) + func echo(aString: String, completion: @escaping (Result) -> Void) { + completion(.success(output!)) } func voidVoid(completion: @escaping (Result) -> Void) { @@ -19,25 +20,24 @@ class MockApi2Host: Api2Host { class AsyncHandlersTest: XCTestCase { func testAsyncHost2Flutter() throws { - let binaryMessenger = MockBinaryMessenger(codec: Api2FlutterCodec.shared) - binaryMessenger.result = Value(number: 2) - let api2Flutter = Api2Flutter(binaryMessenger: binaryMessenger) - let input = Value(number: 1) + let value = "Test" + let binaryMessenger = MockBinaryMessenger(codec: FlutterIntegrationCoreApiCodec.shared) + binaryMessenger.result = value + let flutterApi = FlutterIntegrationCoreApi(binaryMessenger: binaryMessenger) - let expectation = XCTestExpectation(description: "calculate callback") - api2Flutter.calculate(value: input) { output in - XCTAssertEqual(output.number, 2) + let expectation = XCTestExpectation(description: "callback") + flutterApi.echo(value) { output in + XCTAssertEqual(output, value) expectation.fulfill() } wait(for: [expectation], timeout: 1.0) } func testAsyncFlutter2HostVoidVoid() throws { - let binaryMessenger = MockBinaryMessenger(codec: Api2HostCodec.shared) - let mockApi2Host = MockApi2Host() - mockApi2Host.output = 2 - Api2HostSetup.setUp(binaryMessenger: binaryMessenger, api: mockApi2Host) - let channelName = "dev.flutter.pigeon.Api2Host.voidVoid" + let binaryMessenger = MockBinaryMessenger(codec: FlutterStandardMessageCodec.sharedInstance()) + let mockHostSmallApi = MockHostSmallApi() + HostSmallApiSetup.setUp(binaryMessenger: binaryMessenger, api: mockHostSmallApi) + let channelName = "dev.flutter.pigeon.HostSmallApi.voidVoid" XCTAssertNotNil(binaryMessenger.handlers[channelName]) let expectation = XCTestExpectation(description: "voidvoid callback") @@ -50,21 +50,21 @@ class AsyncHandlersTest: XCTestCase { } func testAsyncFlutter2Host() throws { - let binaryMessenger = MockBinaryMessenger(codec: Api2HostCodec.shared) - let mockApi2Host = MockApi2Host() - mockApi2Host.output = 2 - Api2HostSetup.setUp(binaryMessenger: binaryMessenger, api: mockApi2Host) - let channelName = "dev.flutter.pigeon.Api2Host.calculate" + let binaryMessenger = MockBinaryMessenger(codec: FlutterStandardMessageCodec.sharedInstance()) + let mockHostSmallApi = MockHostSmallApi() + let value = "Test" + mockHostSmallApi.output = value + HostSmallApiSetup.setUp(binaryMessenger: binaryMessenger, api: mockHostSmallApi) + let channelName = "dev.flutter.pigeon.HostSmallApi.echo" XCTAssertNotNil(binaryMessenger.handlers[channelName]) - let input = Value(number: 1) - let inputEncoded = binaryMessenger.codec.encode([input]) + let inputEncoded = binaryMessenger.codec.encode([value]) - let expectation = XCTestExpectation(description: "calculate callback") + let expectation = XCTestExpectation(description: "echo callback") binaryMessenger.handlers[channelName]?(inputEncoded) { data in let outputList = binaryMessenger.codec.decode(data) as? [Any] - let output = outputList?.first as? Value - XCTAssertEqual(output?.number, 2) + let output = outputList?.first as? String + XCTAssertEqual(output, value) expectation.fulfill() } wait(for: [expectation], timeout: 1.0) 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 ad1b2c1344f..d460e1cbd1c 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 @@ -1658,6 +1658,22 @@ class FlutterIntegrationCoreApi { completion(result) } } + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. + func noopAsync(completion: @escaping () -> Void) { + let channel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync", binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage(nil) { _ in + completion() + } + } + /// Returns the passed in generic Object asynchronously. + func echoAsync(_ aStringArg: String, completion: @escaping (String) -> Void) { + let channel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString", binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aStringArg] as [Any?]) { response in + let result = response as! String + completion(result) + } + } } /// An API that can be implemented for minimal, compile-only tests. /// @@ -1686,3 +1702,50 @@ class HostTrivialApiSetup { } } } +/// A simple API implemented in some unit tests. +/// +/// Generated protocol from Pigeon that represents a handler of messages from Flutter. +protocol HostSmallApi { + func echo(aString: String, completion: @escaping (Result) -> Void) + func voidVoid(completion: @escaping (Result) -> Void) +} + +/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. +class HostSmallApiSetup { + /// The codec used by HostSmallApi. + /// Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: HostSmallApi?) { + let echoChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.HostSmallApi.echo", binaryMessenger: binaryMessenger) + if let api = api { + echoChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let aStringArg = args[0] as! String + api.echo(aString: aStringArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoChannel.setMessageHandler(nil) + } + let voidVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.HostSmallApi.voidVoid", binaryMessenger: binaryMessenger) + if let api = api { + voidVoidChannel.setMessageHandler { _, reply in + api.voidVoid() { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + voidVoidChannel.setMessageHandler(nil) + } + } +} 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 ad1b2c1344f..d460e1cbd1c 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 @@ -1658,6 +1658,22 @@ class FlutterIntegrationCoreApi { completion(result) } } + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. + func noopAsync(completion: @escaping () -> Void) { + let channel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync", binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage(nil) { _ in + completion() + } + } + /// Returns the passed in generic Object asynchronously. + func echoAsync(_ aStringArg: String, completion: @escaping (String) -> Void) { + let channel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString", binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([aStringArg] as [Any?]) { response in + let result = response as! String + completion(result) + } + } } /// An API that can be implemented for minimal, compile-only tests. /// @@ -1686,3 +1702,50 @@ class HostTrivialApiSetup { } } } +/// A simple API implemented in some unit tests. +/// +/// Generated protocol from Pigeon that represents a handler of messages from Flutter. +protocol HostSmallApi { + func echo(aString: String, completion: @escaping (Result) -> Void) + func voidVoid(completion: @escaping (Result) -> Void) +} + +/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. +class HostSmallApiSetup { + /// The codec used by HostSmallApi. + /// Sets up an instance of `HostSmallApi` to handle messages through the `binaryMessenger`. + static func setUp(binaryMessenger: FlutterBinaryMessenger, api: HostSmallApi?) { + let echoChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.HostSmallApi.echo", binaryMessenger: binaryMessenger) + if let api = api { + echoChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let aStringArg = args[0] as! String + api.echo(aString: aStringArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoChannel.setMessageHandler(nil) + } + let voidVoidChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.HostSmallApi.voidVoid", binaryMessenger: binaryMessenger) + if let api = api { + voidVoidChannel.setMessageHandler { _, reply in + api.voidVoid() { result in + switch result { + case .success: + reply(wrapResult(nil)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + voidVoidChannel.setMessageHandler(nil) + } + } +} 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 3d44397c4f3..90d1fed3b85 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 @@ -3355,6 +3355,41 @@ void FlutterIntegrationCoreApi::EchoNullableMap( on_success(return_value); }); } +void FlutterIntegrationCoreApi::NoopAsync( + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync", &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(); + channel->Send( + encoded_api_arguments, + [on_success = std::move(on_success), on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { on_success(); }); +} +void FlutterIntegrationCoreApi::EchoAsyncString( + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString", + &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(a_string_arg), + }); + channel->Send( + encoded_api_arguments, + [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& return_value = + std::get(encodable_return_value); + on_success(return_value); + }); +} /// The codec used by HostTrivialApi. const flutter::StandardMessageCodec& HostTrivialApi::GetCodec() { return flutter::StandardMessageCodec::GetInstance( @@ -3403,4 +3438,87 @@ EncodableValue HostTrivialApi::WrapError(const FlutterError& error) { error.details()}); } +/// The codec used by HostSmallApi. +const flutter::StandardMessageCodec& HostSmallApi::GetCodec() { + return flutter::StandardMessageCodec::GetInstance( + &flutter::StandardCodecSerializer::GetInstance()); +} + +// Sets up an instance of `HostSmallApi` to handle messages through the +// `binary_messenger`. +void HostSmallApi::SetUp(flutter::BinaryMessenger* binary_messenger, + HostSmallApi* api) { + { + auto channel = std::make_unique>( + binary_messenger, "dev.flutter.pigeon.HostSmallApi.echo", &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())); + } + }); + } else { + channel->SetMessageHandler(nullptr); + } + } + { + auto channel = std::make_unique>( + binary_messenger, "dev.flutter.pigeon.HostSmallApi.voidVoid", + &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())); + } + }); + } else { + channel->SetMessageHandler(nullptr); + } + } +} + +EncodableValue HostSmallApi::WrapError(std::string_view error_message) { + return EncodableValue( + EncodableList{EncodableValue(std::string(error_message)), + EncodableValue("Error"), EncodableValue()}); +} +EncodableValue HostSmallApi::WrapError(const FlutterError& error) { + return EncodableValue(EncodableList{EncodableValue(error.message()), + EncodableValue(error.code()), + error.details()}); +} + } // 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 2bc6fcda86c..127617f1e39 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 @@ -57,6 +57,7 @@ class ErrorOr { friend class HostIntegrationCoreApi; friend class FlutterIntegrationCoreApi; friend class HostTrivialApi; + friend class HostSmallApi; ErrorOr() = default; T TakeValue() && { return std::get(std::move(v_)); } @@ -111,6 +112,8 @@ class AllTypes { friend class FlutterIntegrationCoreApiCodecSerializer; friend class HostTrivialApi; friend class HostTrivialApiCodecSerializer; + friend class HostSmallApi; + friend class HostSmallApiCodecSerializer; friend class CoreTestsTest; bool a_bool_; int64_t an_int_; @@ -197,6 +200,8 @@ class AllNullableTypes { friend class FlutterIntegrationCoreApiCodecSerializer; friend class HostTrivialApi; friend class HostTrivialApiCodecSerializer; + friend class HostSmallApi; + friend class HostSmallApiCodecSerializer; friend class CoreTestsTest; std::optional a_nullable_bool_; std::optional a_nullable_int_; @@ -230,6 +235,8 @@ class AllNullableTypesWrapper { friend class FlutterIntegrationCoreApiCodecSerializer; friend class HostTrivialApi; friend class HostTrivialApiCodecSerializer; + friend class HostSmallApi; + friend class HostSmallApiCodecSerializer; friend class CoreTestsTest; AllNullableTypes values_; }; @@ -607,6 +614,14 @@ class FlutterIntegrationCoreApi { const flutter::EncodableMap* a_map, 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); + // Returns the passed in generic Object asynchronously. + void EchoAsyncString(const std::string& a_string, + std::function&& on_success, + std::function&& on_error); }; // An API that can be implemented for minimal, compile-only tests. @@ -632,5 +647,31 @@ class HostTrivialApi { protected: HostTrivialApi() = default; }; +// A simple API implemented in some unit tests. +// +// 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; + + // 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 flutter::EncodableValue WrapError(std::string_view error_message); + static flutter::EncodableValue WrapError(const FlutterError& error); + + protected: + HostSmallApi() = default; +}; } // namespace core_tests_pigeontest #endif // PIGEON_CORE_TESTS_GEN_H_ diff --git a/packages/pigeon/tool/shared/generation.dart b/packages/pigeon/tool/shared/generation.dart index 01efa09c8f5..7514c6e7c22 100644 --- a/packages/pigeon/tool/shared/generation.dart +++ b/packages/pigeon/tool/shared/generation.dart @@ -52,7 +52,6 @@ Future generatePigeons({required String baseDir}) async { // it entirely; see https://github.com/flutter/flutter/issues/115169. const List inputs = [ 'android_unittests', - 'async_handlers', 'background_platform_channels', 'core_tests', 'enum_args', diff --git a/packages/pigeon/tool/shared/test_suites.dart b/packages/pigeon/tool/shared/test_suites.dart index 1ff1dd6da35..6e6a6a50e97 100644 --- a/packages/pigeon/tool/shared/test_suites.dart +++ b/packages/pigeon/tool/shared/test_suites.dart @@ -220,7 +220,6 @@ Future _runFlutterUnitTests() async { // they are intended to cover is in core_tests.dart (or, if necessary in // the short term due to limitations in non-Dart generators, a single other // file). They aren't being unit tested, only analyzed. - 'async_handlers', 'host2flutter', 'list', 'message', From c002bb225fc14c86b73ea7b1158605c8ad0e5438 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Thu, 16 Feb 2023 09:39:24 -0500 Subject: [PATCH 02/10] Remove some largely unused files --- packages/pigeon/pigeons/host2flutter.dart | 23 ------------------- packages/pigeon/pigeons/void_arg_flutter.dart | 14 ----------- packages/pigeon/pigeons/void_arg_host.dart | 14 ----------- packages/pigeon/pigeons/voidflutter.dart | 14 ----------- packages/pigeon/pigeons/voidhost.dart | 14 ----------- packages/pigeon/tool/shared/generation.dart | 8 ------- packages/pigeon/tool/shared/test_suites.dart | 5 ---- 7 files changed, 92 deletions(-) delete mode 100644 packages/pigeon/pigeons/host2flutter.dart delete mode 100644 packages/pigeon/pigeons/void_arg_flutter.dart delete mode 100644 packages/pigeon/pigeons/void_arg_host.dart delete mode 100644 packages/pigeon/pigeons/voidflutter.dart delete mode 100644 packages/pigeon/pigeons/voidhost.dart diff --git a/packages/pigeon/pigeons/host2flutter.dart b/packages/pigeon/pigeons/host2flutter.dart deleted file mode 100644 index 143df60f65e..00000000000 --- a/packages/pigeon/pigeons/host2flutter.dart +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:pigeon/pigeon.dart'; - -@ConfigurePigeon(PigeonOptions( - objcOptions: ObjcOptions( - prefix: 'H2F', - ), -)) -class Host2FlutterSearchRequest { - String? query; -} - -class Host2FlutterSearchReply { - String? result; -} - -@FlutterApi() -abstract class H2FApi { - Host2FlutterSearchReply search(Host2FlutterSearchRequest request); -} diff --git a/packages/pigeon/pigeons/void_arg_flutter.dart b/packages/pigeon/pigeons/void_arg_flutter.dart deleted file mode 100644 index 7428812fadc..00000000000 --- a/packages/pigeon/pigeons/void_arg_flutter.dart +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:pigeon/pigeon.dart'; - -class VoidArgFlutterResult { - int? code; -} - -@FlutterApi() -abstract class VoidArgApi { - VoidArgFlutterResult getCode(); -} diff --git a/packages/pigeon/pigeons/void_arg_host.dart b/packages/pigeon/pigeons/void_arg_host.dart deleted file mode 100644 index 44ba5ac2438..00000000000 --- a/packages/pigeon/pigeons/void_arg_host.dart +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:pigeon/pigeon.dart'; - -class VoidArgHostResult { - int? code; -} - -@HostApi() -abstract class VoidArgHostApi { - VoidArgHostResult getCode(); -} diff --git a/packages/pigeon/pigeons/voidflutter.dart b/packages/pigeon/pigeons/voidflutter.dart deleted file mode 100644 index 51fe3a9afe8..00000000000 --- a/packages/pigeon/pigeons/voidflutter.dart +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:pigeon/pigeon.dart'; - -class VoidFlutterSetRequest { - int? value; -} - -@FlutterApi() -abstract class VoidFlutterApi { - void setValue(VoidFlutterSetRequest request); -} diff --git a/packages/pigeon/pigeons/voidhost.dart b/packages/pigeon/pigeons/voidhost.dart deleted file mode 100644 index 3ff48f88149..00000000000 --- a/packages/pigeon/pigeons/voidhost.dart +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:pigeon/pigeon.dart'; - -class VoidHostSetRequest { - int? value; -} - -@HostApi() -abstract class VoidHostApi { - void setValue(VoidHostSetRequest request); -} diff --git a/packages/pigeon/tool/shared/generation.dart b/packages/pigeon/tool/shared/generation.dart index 7514c6e7c22..bfc2968bd1a 100644 --- a/packages/pigeon/tool/shared/generation.dart +++ b/packages/pigeon/tool/shared/generation.dart @@ -38,11 +38,8 @@ String _snakeToPascalCase(String snake) { String _javaFilenameForName(String inputName) { const Map specialCases = { 'android_unittests': 'Pigeon', - 'host2flutter': 'Host2Flutter', 'list': 'PigeonList', 'message': 'MessagePigeon', - 'voidflutter': 'VoidFlutter', - 'voidhost': 'VoidHost', }; return specialCases[inputName] ?? _snakeToPascalCase(inputName); } @@ -56,7 +53,6 @@ Future generatePigeons({required String baseDir}) async { 'core_tests', 'enum_args', 'enum', - 'host2flutter', 'java_double_host_api', 'list', 'message', @@ -65,10 +61,6 @@ Future generatePigeons({required String baseDir}) async { 'null_fields', 'nullable_returns', 'primitive', - 'void_arg_flutter', - 'void_arg_host', - 'voidflutter', - 'voidhost', ]; final String outputBase = p.join(baseDir, 'platform_tests', 'test_plugin'); diff --git a/packages/pigeon/tool/shared/test_suites.dart b/packages/pigeon/tool/shared/test_suites.dart index 6e6a6a50e97..b7e832ca7d0 100644 --- a/packages/pigeon/tool/shared/test_suites.dart +++ b/packages/pigeon/tool/shared/test_suites.dart @@ -220,13 +220,8 @@ Future _runFlutterUnitTests() async { // they are intended to cover is in core_tests.dart (or, if necessary in // the short term due to limitations in non-Dart generators, a single other // file). They aren't being unit tested, only analyzed. - 'host2flutter', 'list', 'message', - 'void_arg_flutter', - 'void_arg_host', - 'voidflutter', - 'voidhost', ]; final int generateCode = await _generateDart({ for (final String name in inputPigeons) From a0a1e2f3cdd36938018f8c60fedcd4a9736d912f Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Thu, 16 Feb 2023 10:09:55 -0500 Subject: [PATCH 03/10] Fold in the relevant parts of list.dart --- packages/pigeon/pigeons/core_tests.dart | 25 +++- packages/pigeon/pigeons/list.dart | 20 --- .../CoreTests.java | 118 ++++++++++++++++++ .../ListTest.java | 12 +- .../example/ios/RunnerTests/ListTest.m | 18 +-- .../ios/Classes/CoreTests.gen.h | 17 +++ .../ios/Classes/CoreTests.gen.m | 111 ++++++++++++++++ .../lib/core_tests.gen.dart | 84 +++++++++++++ .../lib/src/generated/core_tests.gen.dart | 84 +++++++++++++ .../com/example/test_plugin/CoreTests.gen.kt | 85 +++++++++++++ .../com/example/test_plugin/ListTest.kt | 6 +- .../example/ios/RunnerTests/ListTests.swift | 6 +- .../ios/Classes/CoreTests.gen.swift | 85 +++++++++++++ .../macos/Classes/CoreTests.gen.swift | 85 +++++++++++++ .../windows/pigeon/core_tests.gen.cpp | 113 +++++++++++++++++ .../windows/pigeon/core_tests.gen.h | 68 ++++++++++ packages/pigeon/tool/shared/generation.dart | 2 - packages/pigeon/tool/shared/test_suites.dart | 1 - 18 files changed, 895 insertions(+), 45 deletions(-) delete mode 100644 packages/pigeon/pigeons/list.dart diff --git a/packages/pigeon/pigeons/core_tests.dart b/packages/pigeon/pigeons/core_tests.dart index 09e48da3bcb..6eb9dd81e8a 100644 --- a/packages/pigeon/pigeons/core_tests.dart +++ b/packages/pigeon/pigeons/core_tests.dart @@ -567,12 +567,35 @@ abstract class HostTrivialApi { // This is separate from HostIntegrationCoreApi to avoid having to update a // lot of unit tests every time we add something to the integration test API. // TODO(stuartmorgan): Restructure the unit tests to reduce the number of -// different HostApis we define. +// different APIs we define. @HostApi() abstract class HostSmallApi { @async @ObjCSelector('echoString:') String echo(String aString); + @async void voidVoid(); } + +/// A simple API called in some unit tests. +// +// This is separate from FlutterIntegrationCoreApi to allow for incrementally +// moving from the previous fragmented unit test structure to something more +// unified. +// TODO(stuartmorgan): Restructure the unit tests to reduce the number of +// different APIs we define. +@FlutterApi() +abstract class FlutterSmallApi { + @ObjCSelector('echoWrappedList:') + @SwiftFunction('echo(_:)') + TestMessage echoWrappedList(TestMessage msg); +} + +/// A data class containing a List, used in unit tests. +// TODO(stuartmorgan): Evaluate whether these unit tests are still useful; see +// TODOs above about restructring. +class TestMessage { + // ignore: always_specify_types, strict_raw_type + List? testList; +} diff --git a/packages/pigeon/pigeons/list.dart b/packages/pigeon/pigeons/list.dart deleted file mode 100644 index c813f745605..00000000000 --- a/packages/pigeon/pigeons/list.dart +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:pigeon/pigeon.dart'; - -class TestMessage { - // ignore: always_specify_types, strict_raw_type - List? testList; -} - -@HostApi() -abstract class TestApi { - void test(TestMessage msg); -} - -@FlutterApi() -abstract class EchoApi { - TestMessage echo(TestMessage msg); -} 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 14d254a7b8b..2e19088b392 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 @@ -708,6 +708,53 @@ ArrayList toList() { } } + /** + * A data class containing a List, used in unit tests. + * + *

Generated class from Pigeon that represents data sent in messages. + */ + public static final class TestMessage { + private @Nullable List testList; + + public @Nullable List getTestList() { + return testList; + } + + public void setTestList(@Nullable List setterArg) { + this.testList = setterArg; + } + + public static final class Builder { + + private @Nullable List testList; + + public @NonNull Builder setTestList(@Nullable List setterArg) { + this.testList = setterArg; + return this; + } + + public @NonNull TestMessage build() { + TestMessage pigeonReturn = new TestMessage(); + pigeonReturn.setTestList(testList); + return pigeonReturn; + } + } + + @NonNull + ArrayList toList() { + ArrayList toListResult = new ArrayList(1); + toListResult.add(testList); + return toListResult; + } + + static @NonNull TestMessage fromList(@NonNull ArrayList list) { + TestMessage pigeonResult = new TestMessage(); + Object testList = list.get(0); + pigeonResult.setTestList((List) testList); + return pigeonResult; + } + } + public interface Result { void success(T result); @@ -728,6 +775,8 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { return AllNullableTypesWrapper.fromList((ArrayList) readValue(buffer)); case (byte) 130: return AllTypes.fromList((ArrayList) readValue(buffer)); + case (byte) 131: + return TestMessage.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); } @@ -744,6 +793,9 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } else if (value instanceof AllTypes) { stream.write(130); writeValue(stream, ((AllTypes) value).toList()); + } else if (value instanceof TestMessage) { + stream.write(131); + writeValue(stream, ((TestMessage) value).toList()); } else { super.writeValue(stream, value); } @@ -3119,6 +3171,8 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { return AllNullableTypesWrapper.fromList((ArrayList) readValue(buffer)); case (byte) 130: return AllTypes.fromList((ArrayList) readValue(buffer)); + case (byte) 131: + return TestMessage.fromList((ArrayList) readValue(buffer)); default: return super.readValueOfType(type, buffer); } @@ -3135,6 +3189,9 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } else if (value instanceof AllTypes) { stream.write(130); writeValue(stream, ((AllTypes) value).toList()); + } else if (value instanceof TestMessage) { + stream.write(131); + writeValue(stream, ((TestMessage) value).toList()); } else { super.writeValue(stream, value); } @@ -3608,4 +3665,65 @@ public void error(Throwable error) { } } } + + private static class FlutterSmallApiCodec extends StandardMessageCodec { + public static final FlutterSmallApiCodec INSTANCE = new FlutterSmallApiCodec(); + + private FlutterSmallApiCodec() {} + + @Override + protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { + switch (type) { + case (byte) 128: + return TestMessage.fromList((ArrayList) readValue(buffer)); + default: + return super.readValueOfType(type, buffer); + } + } + + @Override + protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { + if (value instanceof TestMessage) { + stream.write(128); + writeValue(stream, ((TestMessage) value).toList()); + } else { + super.writeValue(stream, value); + } + } + } + + /** + * A simple API called in some unit tests. + * + *

Generated class from Pigeon that represents Flutter messages that can be called from Java. + */ + public static final class FlutterSmallApi { + private final BinaryMessenger binaryMessenger; + + public FlutterSmallApi(BinaryMessenger argBinaryMessenger) { + this.binaryMessenger = argBinaryMessenger; + } + + /** Public interface for sending reply. */ + public interface Reply { + void reply(T reply); + } + /** The codec used by FlutterSmallApi. */ + static MessageCodec getCodec() { + return FlutterSmallApiCodec.INSTANCE; + } + + public void echoWrappedList(@NonNull TestMessage msgArg, Reply callback) { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, "dev.flutter.pigeon.FlutterSmallApi.echoWrappedList", getCodec()); + channel.send( + new ArrayList(Collections.singletonList(msgArg)), + channelReply -> { + @SuppressWarnings("ConstantConditions") + TestMessage output = (TestMessage) channelReply; + callback.reply(output); + }); + } + } } diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/ListTest.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/ListTest.java index a1345a00a1b..37ecef9a032 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/ListTest.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/ListTest.java @@ -7,8 +7,8 @@ import static org.junit.Assert.*; import static org.mockito.Mockito.*; -import com.example.alternate_language_test_plugin.PigeonList.EchoApi; -import com.example.alternate_language_test_plugin.PigeonList.TestMessage; +import com.example.alternate_language_test_plugin.CoreTests.FlutterSmallApi; +import com.example.alternate_language_test_plugin.CoreTests.TestMessage; import io.flutter.plugin.common.BinaryMessenger; import java.nio.ByteBuffer; import java.util.ArrayList; @@ -28,17 +28,17 @@ public void listInList() { ByteBuffer message = invocation.getArgument(1); BinaryMessenger.BinaryReply reply = invocation.getArgument(2); message.position(0); - ArrayList args = (ArrayList) EchoApi.getCodec().decodeMessage(message); - ByteBuffer replyData = EchoApi.getCodec().encodeMessage(args.get(0)); + ArrayList args = (ArrayList) FlutterSmallApi.getCodec().decodeMessage(message); + ByteBuffer replyData = FlutterSmallApi.getCodec().encodeMessage(args.get(0)); replyData.position(0); reply.reply(replyData); return null; }) .when(binaryMessenger) .send(anyString(), any(), any()); - EchoApi api = new EchoApi(binaryMessenger); + FlutterSmallApi api = new FlutterSmallApi(binaryMessenger); boolean[] didCall = {false}; - api.echo( + api.echoWrappedList( top, (result) -> { didCall[0] = true; diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/RunnerTests/ListTest.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/RunnerTests/ListTest.m index 479a80fd44b..124de85973b 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/RunnerTests/ListTest.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/RunnerTests/ListTest.m @@ -22,16 +22,16 @@ - (void)testListInList { inside.testList = @[ @1, @2, @3 ]; top.testList = @[ inside ]; EchoBinaryMessenger *binaryMessenger = - [[EchoBinaryMessenger alloc] initWithCodec:EchoApiGetCodec()]; - EchoApi *api = [[EchoApi alloc] initWithBinaryMessenger:binaryMessenger]; + [[EchoBinaryMessenger alloc] initWithCodec:FlutterSmallApiGetCodec()]; + FlutterSmallApi *api = [[FlutterSmallApi alloc] initWithBinaryMessenger:binaryMessenger]; XCTestExpectation *expectation = [self expectationWithDescription:@"callback"]; - [api echoMsg:top - completion:^(TestMessage *_Nonnull result, FlutterError *_Nullable err) { - XCTAssertEqual(1u, result.testList.count); - XCTAssertTrue([result.testList[0] isKindOfClass:[TestMessage class]]); - XCTAssertEqualObjects(inside.testList, [result.testList[0] testList]); - [expectation fulfill]; - }]; + [api echoWrappedList:top + completion:^(TestMessage *_Nonnull result, FlutterError *_Nullable err) { + XCTAssertEqual(1u, result.testList.count); + XCTAssertTrue([result.testList[0] isKindOfClass:[TestMessage class]]); + XCTAssertEqualObjects(inside.testList, [result.testList[0] testList]); + [expectation fulfill]; + }]; [self waitForExpectations:@[ expectation ] timeout:1.0]; } 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 15c8ea3d5d8..c0f834cfa83 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 @@ -23,6 +23,7 @@ typedef NS_ENUM(NSUInteger, AnEnum) { @class AllTypes; @class AllNullableTypes; @class AllNullableTypesWrapper; +@class TestMessage; @interface AllTypes : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. @@ -91,6 +92,12 @@ typedef NS_ENUM(NSUInteger, AnEnum) { @property(nonatomic, strong) AllNullableTypes *values; @end +/// A data class containing a List, used in unit tests. +@interface TestMessage : NSObject ++ (instancetype)makeWithTestList:(nullable NSArray *)testList; +@property(nonatomic, strong, nullable) NSArray *testList; +@end + /// The codec used by HostIntegrationCoreApi. NSObject *HostIntegrationCoreApiGetCodec(void); @@ -420,4 +427,14 @@ NSObject *HostSmallApiGetCodec(void); extern void HostSmallApiSetup(id binaryMessenger, NSObject *_Nullable api); +/// The codec used by FlutterSmallApi. +NSObject *FlutterSmallApiGetCodec(void); + +/// A simple API called in some unit tests. +@interface FlutterSmallApi : NSObject +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; +- (void)echoWrappedList:(TestMessage *)msg + completion:(void (^)(TestMessage *_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 4eb21171520..b3f948a4617 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 @@ -43,6 +43,12 @@ + (nullable AllNullableTypesWrapper *)nullableFromList:(NSArray *)list; - (NSArray *)toList; @end +@interface TestMessage () ++ (TestMessage *)fromList:(NSArray *)list; ++ (nullable TestMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; +@end + @implementation AllTypes + (instancetype)makeWithABool:(NSNumber *)aBool anInt:(NSNumber *)anInt @@ -210,6 +216,27 @@ - (NSArray *)toList { } @end +@implementation TestMessage ++ (instancetype)makeWithTestList:(nullable NSArray *)testList { + TestMessage *pigeonResult = [[TestMessage alloc] init]; + pigeonResult.testList = testList; + return pigeonResult; +} ++ (TestMessage *)fromList:(NSArray *)list { + TestMessage *pigeonResult = [[TestMessage alloc] init]; + pigeonResult.testList = GetNullableObjectAtIndex(list, 0); + return pigeonResult; +} ++ (nullable TestMessage *)nullableFromList:(NSArray *)list { + return (list) ? [TestMessage fromList:list] : nil; +} +- (NSArray *)toList { + return @[ + (self.testList ?: [NSNull null]), + ]; +} +@end + @interface HostIntegrationCoreApiCodecReader : FlutterStandardReader @end @implementation HostIntegrationCoreApiCodecReader @@ -221,6 +248,8 @@ - (nullable id)readValueOfType:(UInt8)type { return [AllNullableTypesWrapper fromList:[self readValue]]; case 130: return [AllTypes fromList:[self readValue]]; + case 131: + return [TestMessage fromList:[self readValue]]; default: return [super readValueOfType:type]; } @@ -240,6 +269,9 @@ - (void)writeValue:(id)value { } else if ([value isKindOfClass:[AllTypes class]]) { [self writeByte:130]; [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[TestMessage class]]) { + [self writeByte:131]; + [self writeValue:[value toList]]; } else { [super writeValue:value]; } @@ -1715,6 +1747,8 @@ - (nullable id)readValueOfType:(UInt8)type { return [AllNullableTypesWrapper fromList:[self readValue]]; case 130: return [AllTypes fromList:[self readValue]]; + case 131: + return [TestMessage fromList:[self readValue]]; default: return [super readValueOfType:type]; } @@ -1734,6 +1768,9 @@ - (void)writeValue:(id)value { } else if ([value isKindOfClass:[AllTypes class]]) { [self writeByte:130]; [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[TestMessage class]]) { + [self writeByte:131]; + [self writeValue:[value toList]]; } else { [super writeValue:value]; } @@ -2118,3 +2155,77 @@ void HostSmallApiSetup(id binaryMessenger, NSObject *FlutterSmallApiGetCodec() { + static FlutterStandardMessageCodec *sSharedObject = nil; + static dispatch_once_t sPred = 0; + dispatch_once(&sPred, ^{ + FlutterSmallApiCodecReaderWriter *readerWriter = + [[FlutterSmallApiCodecReaderWriter alloc] init]; + sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; + }); + return sSharedObject; +} + +@interface FlutterSmallApi () +@property(nonatomic, strong) NSObject *binaryMessenger; +@end + +@implementation FlutterSmallApi + +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { + self = [super init]; + if (self) { + _binaryMessenger = binaryMessenger; + } + return self; +} +- (void)echoWrappedList:(TestMessage *)arg_msg + completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterSmallApi.echoWrappedList" + binaryMessenger:self.binaryMessenger + codec:FlutterSmallApiGetCodec()]; + [channel sendMessage:@[ arg_msg ?: [NSNull null] ] + reply:^(id reply) { + TestMessage *output = reply; + completion(output, nil); + }]; +} +@end diff --git a/packages/pigeon/platform_tests/flutter_null_safe_unit_tests/lib/core_tests.gen.dart b/packages/pigeon/platform_tests/flutter_null_safe_unit_tests/lib/core_tests.gen.dart index 010dedde06d..a4f08bc5f3e 100644 --- a/packages/pigeon/platform_tests/flutter_null_safe_unit_tests/lib/core_tests.gen.dart +++ b/packages/pigeon/platform_tests/flutter_null_safe_unit_tests/lib/core_tests.gen.dart @@ -199,6 +199,28 @@ class AllNullableTypesWrapper { } } +/// A data class containing a List, used in unit tests. +class TestMessage { + TestMessage({ + this.testList, + }); + + List? testList; + + Object encode() { + return [ + testList, + ]; + } + + static TestMessage decode(Object result) { + result as List; + return TestMessage( + testList: result[0] as List?, + ); + } +} + class _HostIntegrationCoreApiCodec extends StandardMessageCodec { const _HostIntegrationCoreApiCodec(); @override @@ -212,6 +234,9 @@ class _HostIntegrationCoreApiCodec extends StandardMessageCodec { } else if (value is AllTypes) { buffer.putUint8(130); writeValue(buffer, value.encode()); + } else if (value is TestMessage) { + buffer.putUint8(131); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -226,6 +251,8 @@ class _HostIntegrationCoreApiCodec extends StandardMessageCodec { return AllNullableTypesWrapper.decode(readValue(buffer)!); case 130: return AllTypes.decode(readValue(buffer)!); + case 131: + return TestMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -1897,6 +1924,9 @@ class _FlutterIntegrationCoreApiCodec extends StandardMessageCodec { } else if (value is AllTypes) { buffer.putUint8(130); writeValue(buffer, value.encode()); + } else if (value is TestMessage) { + buffer.putUint8(131); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -1911,6 +1941,8 @@ class _FlutterIntegrationCoreApiCodec extends StandardMessageCodec { return AllNullableTypesWrapper.decode(readValue(buffer)!); case 130: return AllTypes.decode(readValue(buffer)!); + case 131: + return TestMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -2489,3 +2521,55 @@ class HostSmallApi { } } } + +class _FlutterSmallApiCodec extends StandardMessageCodec { + const _FlutterSmallApiCodec(); + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is TestMessage) { + buffer.putUint8(128); + writeValue(buffer, value.encode()); + } else { + super.writeValue(buffer, value); + } + } + + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 128: + return TestMessage.decode(readValue(buffer)!); + default: + return super.readValueOfType(type, buffer); + } + } +} + +/// A simple API called in some unit tests. +abstract class FlutterSmallApi { + static const MessageCodec codec = _FlutterSmallApiCodec(); + + TestMessage echoWrappedList(TestMessage msg); + + static void setup(FlutterSmallApi? api, {BinaryMessenger? binaryMessenger}) { + { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.FlutterSmallApi.echoWrappedList', codec, + binaryMessenger: binaryMessenger); + if (api == null) { + channel.setMessageHandler(null); + } else { + channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.FlutterSmallApi.echoWrappedList was null.'); + final List args = (message as List?)!; + final TestMessage? arg_msg = (args[0] as TestMessage?); + assert(arg_msg != null, + 'Argument for dev.flutter.pigeon.FlutterSmallApi.echoWrappedList was null, expected non-null TestMessage.'); + final TestMessage output = api.echoWrappedList(arg_msg!); + return output; + }); + } + } + } +} 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 010dedde06d..a4f08bc5f3e 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 @@ -199,6 +199,28 @@ class AllNullableTypesWrapper { } } +/// A data class containing a List, used in unit tests. +class TestMessage { + TestMessage({ + this.testList, + }); + + List? testList; + + Object encode() { + return [ + testList, + ]; + } + + static TestMessage decode(Object result) { + result as List; + return TestMessage( + testList: result[0] as List?, + ); + } +} + class _HostIntegrationCoreApiCodec extends StandardMessageCodec { const _HostIntegrationCoreApiCodec(); @override @@ -212,6 +234,9 @@ class _HostIntegrationCoreApiCodec extends StandardMessageCodec { } else if (value is AllTypes) { buffer.putUint8(130); writeValue(buffer, value.encode()); + } else if (value is TestMessage) { + buffer.putUint8(131); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -226,6 +251,8 @@ class _HostIntegrationCoreApiCodec extends StandardMessageCodec { return AllNullableTypesWrapper.decode(readValue(buffer)!); case 130: return AllTypes.decode(readValue(buffer)!); + case 131: + return TestMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -1897,6 +1924,9 @@ class _FlutterIntegrationCoreApiCodec extends StandardMessageCodec { } else if (value is AllTypes) { buffer.putUint8(130); writeValue(buffer, value.encode()); + } else if (value is TestMessage) { + buffer.putUint8(131); + writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); } @@ -1911,6 +1941,8 @@ class _FlutterIntegrationCoreApiCodec extends StandardMessageCodec { return AllNullableTypesWrapper.decode(readValue(buffer)!); case 130: return AllTypes.decode(readValue(buffer)!); + case 131: + return TestMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); } @@ -2489,3 +2521,55 @@ class HostSmallApi { } } } + +class _FlutterSmallApiCodec extends StandardMessageCodec { + const _FlutterSmallApiCodec(); + @override + void writeValue(WriteBuffer buffer, Object? value) { + if (value is TestMessage) { + buffer.putUint8(128); + writeValue(buffer, value.encode()); + } else { + super.writeValue(buffer, value); + } + } + + @override + Object? readValueOfType(int type, ReadBuffer buffer) { + switch (type) { + case 128: + return TestMessage.decode(readValue(buffer)!); + default: + return super.readValueOfType(type, buffer); + } + } +} + +/// A simple API called in some unit tests. +abstract class FlutterSmallApi { + static const MessageCodec codec = _FlutterSmallApiCodec(); + + TestMessage echoWrappedList(TestMessage msg); + + static void setup(FlutterSmallApi? api, {BinaryMessenger? binaryMessenger}) { + { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.FlutterSmallApi.echoWrappedList', codec, + binaryMessenger: binaryMessenger); + if (api == null) { + channel.setMessageHandler(null); + } else { + channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.FlutterSmallApi.echoWrappedList was null.'); + final List args = (message as List?)!; + final TestMessage? arg_msg = (args[0] as TestMessage?); + assert(arg_msg != null, + 'Argument for dev.flutter.pigeon.FlutterSmallApi.echoWrappedList was null, expected non-null TestMessage.'); + final TestMessage output = api.echoWrappedList(arg_msg!); + return output; + }); + } + } + } +} 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 072e8827a94..dffa64725cc 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 @@ -167,6 +167,29 @@ data class AllNullableTypesWrapper ( } } +/** + * A data class containing a List, used in unit tests. + * + * Generated class from Pigeon that represents data sent in messages. + */ +data class TestMessage ( + val testList: List? = null + +) { + companion object { + @Suppress("UNCHECKED_CAST") + fun fromList(list: List): TestMessage { + val testList = list[0] as? List + return TestMessage(testList) + } + } + fun toList(): List { + return listOf( + testList, + ) + } +} + @Suppress("UNCHECKED_CAST") private object HostIntegrationCoreApiCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { @@ -186,6 +209,11 @@ private object HostIntegrationCoreApiCodec : StandardMessageCodec() { AllTypes.fromList(it) } } + 131.toByte() -> { + return (readValue(buffer) as? List)?.let { + TestMessage.fromList(it) + } + } else -> super.readValueOfType(type, buffer) } } @@ -203,6 +231,10 @@ private object HostIntegrationCoreApiCodec : StandardMessageCodec() { stream.write(130) writeValue(stream, value.toList()) } + is TestMessage -> { + stream.write(131) + writeValue(stream, value.toList()) + } else -> super.writeValue(stream, value) } } @@ -1623,6 +1655,11 @@ private object FlutterIntegrationCoreApiCodec : StandardMessageCodec() { AllTypes.fromList(it) } } + 131.toByte() -> { + return (readValue(buffer) as? List)?.let { + TestMessage.fromList(it) + } + } else -> super.readValueOfType(type, buffer) } } @@ -1640,6 +1677,10 @@ private object FlutterIntegrationCoreApiCodec : StandardMessageCodec() { stream.write(130) writeValue(stream, value.toList()) } + is TestMessage -> { + stream.write(131) + writeValue(stream, value.toList()) + } else -> super.writeValue(stream, value) } } @@ -1938,3 +1979,47 @@ interface HostSmallApi { } } } +@Suppress("UNCHECKED_CAST") +private object FlutterSmallApiCodec : StandardMessageCodec() { + override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { + return when (type) { + 128.toByte() -> { + return (readValue(buffer) as? List)?.let { + TestMessage.fromList(it) + } + } + else -> super.readValueOfType(type, buffer) + } + } + override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { + when (value) { + is TestMessage -> { + stream.write(128) + writeValue(stream, value.toList()) + } + else -> super.writeValue(stream, value) + } + } +} + +/** + * A simple API called in some unit tests. + * + * Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. + */ +@Suppress("UNCHECKED_CAST") +class FlutterSmallApi(private val binaryMessenger: BinaryMessenger) { + companion object { + /** The codec used by FlutterSmallApi. */ + val codec: MessageCodec by lazy { + FlutterSmallApiCodec + } + } + fun echoWrappedList(msgArg: TestMessage, callback: (TestMessage) -> Unit) { + val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.FlutterSmallApi.echoWrappedList", codec) + channel.send(listOf(msgArg)) { + val result = it as TestMessage + callback(result) + } + } +} diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/ListTest.kt b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/ListTest.kt index d0edb5e6c52..1a071f2dfc1 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/ListTest.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/ListTest.kt @@ -16,13 +16,13 @@ class ListTest: TestCase() { @Test fun testListInList() { val binaryMessenger = mockk() - val api = EchoApi(binaryMessenger) + val api = FlutterSmallApi(binaryMessenger) val inside = TestMessage(listOf(1, 2, 3)) val input = TestMessage(listOf(inside)) every { binaryMessenger.send(any(), any(), any()) } answers { - val codec = EchoApi.codec + val codec = FlutterSmallApi.codec val message = arg(1) val reply = arg(2) message.position(0) @@ -33,7 +33,7 @@ class ListTest: TestCase() { } var didCall = false - api.echo(input) { + api.echoWrappedList(input) { didCall = true assertEquals(input, it) } diff --git a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/ListTests.swift b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/ListTests.swift index 5726c110267..c48068e234d 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/ListTests.swift +++ b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/ListTests.swift @@ -10,11 +10,11 @@ class ListTests: XCTestCase { func testListInList() throws { let inside = TestMessage(testList: [1, 2, 3]) let top = TestMessage(testList: [inside]) - let binaryMessenger = EchoBinaryMessenger(codec: EchoApiCodec.shared) - let api = EchoApi(binaryMessenger: binaryMessenger) + let binaryMessenger = EchoBinaryMessenger(codec: FlutterSmallApiCodec.shared) + let api = FlutterSmallApi(binaryMessenger: binaryMessenger) let expectation = XCTestExpectation(description: "callback") - api.echo(msg: top) { result in + api.echo(top) { result in XCTAssertEqual(1, result.testList?.count) XCTAssertTrue(result.testList?[0] is TestMessage) XCTAssert(equalsList(inside.testList, (result.testList?[0] as! TestMessage).testList)) 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 d460e1cbd1c..3f3d3bbd6b1 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 @@ -190,6 +190,26 @@ struct AllNullableTypesWrapper { } } +/// A data class containing a List, used in unit tests. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct TestMessage { + var testList: [Any?]? = nil + + static func fromList(_ list: [Any?]) -> TestMessage? { + let testList = list[0] as? [Any?] + + return TestMessage( + testList: testList + ) + } + func toList() -> [Any?] { + return [ + testList, + ] + } +} + private class HostIntegrationCoreApiCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { @@ -199,6 +219,8 @@ private class HostIntegrationCoreApiCodecReader: FlutterStandardReader { return AllNullableTypesWrapper.fromList(self.readValue() as! [Any]) case 130: return AllTypes.fromList(self.readValue() as! [Any]) + case 131: + return TestMessage.fromList(self.readValue() as! [Any]) default: return super.readValue(ofType: type) } @@ -216,6 +238,9 @@ private class HostIntegrationCoreApiCodecWriter: FlutterStandardWriter { } else if let value = value as? AllTypes { super.writeByte(130) super.writeValue(value.toList()) + } else if let value = value as? TestMessage { + super.writeByte(131) + super.writeValue(value.toList()) } else { super.writeValue(value) } @@ -1448,6 +1473,8 @@ private class FlutterIntegrationCoreApiCodecReader: FlutterStandardReader { return AllNullableTypesWrapper.fromList(self.readValue() as! [Any]) case 130: return AllTypes.fromList(self.readValue() as! [Any]) + case 131: + return TestMessage.fromList(self.readValue() as! [Any]) default: return super.readValue(ofType: type) } @@ -1465,6 +1492,9 @@ private class FlutterIntegrationCoreApiCodecWriter: FlutterStandardWriter { } else if let value = value as? AllTypes { super.writeByte(130) super.writeValue(value.toList()) + } else if let value = value as? TestMessage { + super.writeByte(131) + super.writeValue(value.toList()) } else { super.writeValue(value) } @@ -1749,3 +1779,58 @@ class HostSmallApiSetup { } } } +private class FlutterSmallApiCodecReader: FlutterStandardReader { + override func readValue(ofType type: UInt8) -> Any? { + switch type { + case 128: + return TestMessage.fromList(self.readValue() as! [Any]) + default: + return super.readValue(ofType: type) + } + } +} + +private class FlutterSmallApiCodecWriter: FlutterStandardWriter { + override func writeValue(_ value: Any) { + if let value = value as? TestMessage { + super.writeByte(128) + super.writeValue(value.toList()) + } else { + super.writeValue(value) + } + } +} + +private class FlutterSmallApiCodecReaderWriter: FlutterStandardReaderWriter { + override func reader(with data: Data) -> FlutterStandardReader { + return FlutterSmallApiCodecReader(data: data) + } + + override func writer(with data: NSMutableData) -> FlutterStandardWriter { + return FlutterSmallApiCodecWriter(data: data) + } +} + +class FlutterSmallApiCodec: FlutterStandardMessageCodec { + static let shared = FlutterSmallApiCodec(readerWriter: FlutterSmallApiCodecReaderWriter()) +} + +/// A simple API called in some unit tests. +/// +/// Generated class from Pigeon that represents Flutter messages that can be called from Swift. +class FlutterSmallApi { + private let binaryMessenger: FlutterBinaryMessenger + init(binaryMessenger: FlutterBinaryMessenger){ + self.binaryMessenger = binaryMessenger + } + var codec: FlutterStandardMessageCodec { + return FlutterSmallApiCodec.shared + } + func echo(_ msgArg: TestMessage, completion: @escaping (TestMessage) -> Void) { + let channel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.FlutterSmallApi.echoWrappedList", binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([msgArg] as [Any?]) { response in + let result = response as! TestMessage + completion(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 d460e1cbd1c..3f3d3bbd6b1 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 @@ -190,6 +190,26 @@ struct AllNullableTypesWrapper { } } +/// A data class containing a List, used in unit tests. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct TestMessage { + var testList: [Any?]? = nil + + static func fromList(_ list: [Any?]) -> TestMessage? { + let testList = list[0] as? [Any?] + + return TestMessage( + testList: testList + ) + } + func toList() -> [Any?] { + return [ + testList, + ] + } +} + private class HostIntegrationCoreApiCodecReader: FlutterStandardReader { override func readValue(ofType type: UInt8) -> Any? { switch type { @@ -199,6 +219,8 @@ private class HostIntegrationCoreApiCodecReader: FlutterStandardReader { return AllNullableTypesWrapper.fromList(self.readValue() as! [Any]) case 130: return AllTypes.fromList(self.readValue() as! [Any]) + case 131: + return TestMessage.fromList(self.readValue() as! [Any]) default: return super.readValue(ofType: type) } @@ -216,6 +238,9 @@ private class HostIntegrationCoreApiCodecWriter: FlutterStandardWriter { } else if let value = value as? AllTypes { super.writeByte(130) super.writeValue(value.toList()) + } else if let value = value as? TestMessage { + super.writeByte(131) + super.writeValue(value.toList()) } else { super.writeValue(value) } @@ -1448,6 +1473,8 @@ private class FlutterIntegrationCoreApiCodecReader: FlutterStandardReader { return AllNullableTypesWrapper.fromList(self.readValue() as! [Any]) case 130: return AllTypes.fromList(self.readValue() as! [Any]) + case 131: + return TestMessage.fromList(self.readValue() as! [Any]) default: return super.readValue(ofType: type) } @@ -1465,6 +1492,9 @@ private class FlutterIntegrationCoreApiCodecWriter: FlutterStandardWriter { } else if let value = value as? AllTypes { super.writeByte(130) super.writeValue(value.toList()) + } else if let value = value as? TestMessage { + super.writeByte(131) + super.writeValue(value.toList()) } else { super.writeValue(value) } @@ -1749,3 +1779,58 @@ class HostSmallApiSetup { } } } +private class FlutterSmallApiCodecReader: FlutterStandardReader { + override func readValue(ofType type: UInt8) -> Any? { + switch type { + case 128: + return TestMessage.fromList(self.readValue() as! [Any]) + default: + return super.readValue(ofType: type) + } + } +} + +private class FlutterSmallApiCodecWriter: FlutterStandardWriter { + override func writeValue(_ value: Any) { + if let value = value as? TestMessage { + super.writeByte(128) + super.writeValue(value.toList()) + } else { + super.writeValue(value) + } + } +} + +private class FlutterSmallApiCodecReaderWriter: FlutterStandardReaderWriter { + override func reader(with data: Data) -> FlutterStandardReader { + return FlutterSmallApiCodecReader(data: data) + } + + override func writer(with data: NSMutableData) -> FlutterStandardWriter { + return FlutterSmallApiCodecWriter(data: data) + } +} + +class FlutterSmallApiCodec: FlutterStandardMessageCodec { + static let shared = FlutterSmallApiCodec(readerWriter: FlutterSmallApiCodecReaderWriter()) +} + +/// A simple API called in some unit tests. +/// +/// Generated class from Pigeon that represents Flutter messages that can be called from Swift. +class FlutterSmallApi { + private let binaryMessenger: FlutterBinaryMessenger + init(binaryMessenger: FlutterBinaryMessenger){ + self.binaryMessenger = binaryMessenger + } + var codec: FlutterStandardMessageCodec { + return FlutterSmallApiCodec.shared + } + func echo(_ msgArg: TestMessage, completion: @escaping (TestMessage) -> Void) { + let channel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.FlutterSmallApi.echoWrappedList", binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([msgArg] as [Any?]) { response in + let result = response as! TestMessage + completion(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 90d1fed3b85..d390add4913 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 @@ -473,6 +473,36 @@ AllNullableTypesWrapper::AllNullableTypesWrapper(const EncodableList& list) { } } +// TestMessage + +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; +} +void TestMessage::set_test_list(const EncodableList& value_arg) { + test_list_ = value_arg; +} + +EncodableList TestMessage::ToEncodableList() const { + EncodableList list; + list.reserve(1); + list.push_back(test_list_ ? EncodableValue(*test_list_) : EncodableValue()); + return list; +} + +TestMessage::TestMessage() {} + +TestMessage::TestMessage(const EncodableList& list) { + auto& encodable_test_list = list[0]; + if (const EncodableList* pointer_test_list = + std::get_if(&encodable_test_list)) { + test_list_ = *pointer_test_list; + } +} + HostIntegrationCoreApiCodecSerializer::HostIntegrationCoreApiCodecSerializer() { } EncodableValue HostIntegrationCoreApiCodecSerializer::ReadValueOfType( @@ -487,6 +517,9 @@ EncodableValue HostIntegrationCoreApiCodecSerializer::ReadValueOfType( case 130: return CustomEncodableValue( AllTypes(std::get(ReadValue(stream)))); + case 131: + return CustomEncodableValue( + TestMessage(std::get(ReadValue(stream)))); default: return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } @@ -519,6 +552,14 @@ void HostIntegrationCoreApiCodecSerializer::WriteValue( stream); return; } + if (custom_value->type() == typeid(TestMessage)) { + stream->WriteByte(131); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); + return; + } } flutter::StandardCodecSerializer::WriteValue(value, stream); } @@ -2881,6 +2922,9 @@ EncodableValue FlutterIntegrationCoreApiCodecSerializer::ReadValueOfType( case 130: return CustomEncodableValue( AllTypes(std::get(ReadValue(stream)))); + case 131: + return CustomEncodableValue( + TestMessage(std::get(ReadValue(stream)))); default: return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } @@ -2913,6 +2957,14 @@ void FlutterIntegrationCoreApiCodecSerializer::WriteValue( stream); return; } + if (custom_value->type() == typeid(TestMessage)) { + stream->WriteByte(131); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); + return; + } } flutter::StandardCodecSerializer::WriteValue(value, stream); } @@ -3521,4 +3573,65 @@ EncodableValue HostSmallApi::WrapError(const FlutterError& error) { error.details()}); } +FlutterSmallApiCodecSerializer::FlutterSmallApiCodecSerializer() {} +EncodableValue FlutterSmallApiCodecSerializer::ReadValueOfType( + uint8_t type, flutter::ByteStreamReader* stream) const { + switch (type) { + case 128: + return CustomEncodableValue( + TestMessage(std::get(ReadValue(stream)))); + default: + return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); + } +} + +void FlutterSmallApiCodecSerializer::WriteValue( + const EncodableValue& value, flutter::ByteStreamWriter* stream) const { + if (const CustomEncodableValue* custom_value = + std::get_if(&value)) { + if (custom_value->type() == typeid(TestMessage)) { + stream->WriteByte(128); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); + return; + } + } + flutter::StandardCodecSerializer::WriteValue(value, stream); +} + +// Generated class from Pigeon that represents Flutter messages that can be +// called from C++. +FlutterSmallApi::FlutterSmallApi(flutter::BinaryMessenger* binary_messenger) { + this->binary_messenger_ = binary_messenger; +} + +const flutter::StandardMessageCodec& FlutterSmallApi::GetCodec() { + return flutter::StandardMessageCodec::GetInstance( + &FlutterSmallApiCodecSerializer::GetInstance()); +} + +void FlutterSmallApi::EchoWrappedList( + const TestMessage& msg_arg, + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, "dev.flutter.pigeon.FlutterSmallApi.echoWrappedList", + &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(msg_arg.ToEncodableList()), + }); + channel->Send( + encoded_api_arguments, + [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& return_value = std::any_cast( + std::get(encodable_return_value)); + on_success(return_value); + }); +} } // 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 127617f1e39..513bae6682f 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 @@ -58,6 +58,7 @@ class ErrorOr { friend class FlutterIntegrationCoreApi; friend class HostTrivialApi; friend class HostSmallApi; + friend class FlutterSmallApi; ErrorOr() = default; T TakeValue() && { return std::get(std::move(v_)); } @@ -114,6 +115,8 @@ class AllTypes { friend class HostTrivialApiCodecSerializer; friend class HostSmallApi; friend class HostSmallApiCodecSerializer; + friend class FlutterSmallApi; + friend class FlutterSmallApiCodecSerializer; friend class CoreTestsTest; bool a_bool_; int64_t an_int_; @@ -202,6 +205,8 @@ class AllNullableTypes { friend class HostTrivialApiCodecSerializer; friend class HostSmallApi; friend class HostSmallApiCodecSerializer; + friend class FlutterSmallApi; + friend class FlutterSmallApiCodecSerializer; friend class CoreTestsTest; std::optional a_nullable_bool_; std::optional a_nullable_int_; @@ -237,10 +242,39 @@ class AllNullableTypesWrapper { friend class HostTrivialApiCodecSerializer; friend class HostSmallApi; friend class HostSmallApiCodecSerializer; + friend class FlutterSmallApi; + friend class FlutterSmallApiCodecSerializer; friend class CoreTestsTest; AllNullableTypes values_; }; +// A data class containing a List, used in unit tests. +// +// Generated class from Pigeon that represents data sent in messages. +class TestMessage { + public: + TestMessage(); + const flutter::EncodableList* test_list() const; + void set_test_list(const flutter::EncodableList* value_arg); + void set_test_list(const flutter::EncodableList& value_arg); + + private: + TestMessage(const flutter::EncodableList& list); + flutter::EncodableList ToEncodableList() const; + friend class HostIntegrationCoreApi; + friend class HostIntegrationCoreApiCodecSerializer; + friend class FlutterIntegrationCoreApi; + friend class FlutterIntegrationCoreApiCodecSerializer; + friend class HostTrivialApi; + friend class HostTrivialApiCodecSerializer; + friend class HostSmallApi; + friend class HostSmallApiCodecSerializer; + friend class FlutterSmallApi; + friend class FlutterSmallApiCodecSerializer; + friend class CoreTestsTest; + std::optional test_list_; +}; + class HostIntegrationCoreApiCodecSerializer : public flutter::StandardCodecSerializer { public: @@ -673,5 +707,39 @@ class HostSmallApi { protected: HostSmallApi() = default; }; +class FlutterSmallApiCodecSerializer : public flutter::StandardCodecSerializer { + public: + inline static FlutterSmallApiCodecSerializer& GetInstance() { + static FlutterSmallApiCodecSerializer sInstance; + return sInstance; + } + + FlutterSmallApiCodecSerializer(); + + public: + void WriteValue(const flutter::EncodableValue& value, + flutter::ByteStreamWriter* stream) const override; + + protected: + flutter::EncodableValue ReadValueOfType( + uint8_t type, flutter::ByteStreamReader* stream) const override; +}; + +// A simple API called in some unit tests. +// +// Generated class from Pigeon that represents Flutter messages that can be +// called from C++. +class FlutterSmallApi { + private: + flutter::BinaryMessenger* binary_messenger_; + + public: + FlutterSmallApi(flutter::BinaryMessenger* binary_messenger); + static const flutter::StandardMessageCodec& GetCodec(); + void EchoWrappedList(const TestMessage& msg, + std::function&& on_success, + std::function&& on_error); +}; + } // namespace core_tests_pigeontest #endif // PIGEON_CORE_TESTS_GEN_H_ diff --git a/packages/pigeon/tool/shared/generation.dart b/packages/pigeon/tool/shared/generation.dart index bfc2968bd1a..ba2f947a152 100644 --- a/packages/pigeon/tool/shared/generation.dart +++ b/packages/pigeon/tool/shared/generation.dart @@ -38,7 +38,6 @@ String _snakeToPascalCase(String snake) { String _javaFilenameForName(String inputName) { const Map specialCases = { 'android_unittests': 'Pigeon', - 'list': 'PigeonList', 'message': 'MessagePigeon', }; return specialCases[inputName] ?? _snakeToPascalCase(inputName); @@ -54,7 +53,6 @@ Future generatePigeons({required String baseDir}) async { 'enum_args', 'enum', 'java_double_host_api', - 'list', 'message', 'multiple_arity', 'non_null_fields', diff --git a/packages/pigeon/tool/shared/test_suites.dart b/packages/pigeon/tool/shared/test_suites.dart index b7e832ca7d0..6af4c0c3863 100644 --- a/packages/pigeon/tool/shared/test_suites.dart +++ b/packages/pigeon/tool/shared/test_suites.dart @@ -220,7 +220,6 @@ Future _runFlutterUnitTests() async { // they are intended to cover is in core_tests.dart (or, if necessary in // the short term due to limitations in non-Dart generators, a single other // file). They aren't being unit tested, only analyzed. - 'list', 'message', ]; final int generateCode = await _generateDart({ From 769e7e22546ff21d5ff57b1b1c0dcd79339e6650 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Thu, 16 Feb 2023 10:10:34 -0500 Subject: [PATCH 04/10] Remove java_double_host_api --- packages/pigeon/pigeons/core_tests.dart | 4 ++++ .../pigeon/pigeons/java_double_host_api.dart | 21 ------------------- packages/pigeon/tool/shared/generation.dart | 1 - 3 files changed, 4 insertions(+), 22 deletions(-) delete mode 100644 packages/pigeon/pigeons/java_double_host_api.dart diff --git a/packages/pigeon/pigeons/core_tests.dart b/packages/pigeon/pigeons/core_tests.dart index 6eb9dd81e8a..27102d96254 100644 --- a/packages/pigeon/pigeons/core_tests.dart +++ b/packages/pigeon/pigeons/core_tests.dart @@ -557,6 +557,10 @@ abstract class FlutterIntegrationCoreApi { } /// An API that can be implemented for minimal, compile-only tests. +// +// This is also here to test that multiple host APIs can be generated +// successfully in all languages (e.g., in Java where it requires having a +// wrapper class). @HostApi() abstract class HostTrivialApi { void noop(); diff --git a/packages/pigeon/pigeons/java_double_host_api.dart b/packages/pigeon/pigeons/java_double_host_api.dart deleted file mode 100644 index d07cb58af0b..00000000000 --- a/packages/pigeon/pigeons/java_double_host_api.dart +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:pigeon/pigeon.dart'; - -class BridgeResponse { - int? result; -} - -@HostApi() -abstract class BridgeApi1 { - @async - BridgeResponse call(); -} - -@HostApi() -abstract class BridgeApi2 { - @async - BridgeResponse call(); -} diff --git a/packages/pigeon/tool/shared/generation.dart b/packages/pigeon/tool/shared/generation.dart index ba2f947a152..709e8e1d892 100644 --- a/packages/pigeon/tool/shared/generation.dart +++ b/packages/pigeon/tool/shared/generation.dart @@ -52,7 +52,6 @@ Future generatePigeons({required String baseDir}) async { 'core_tests', 'enum_args', 'enum', - 'java_double_host_api', 'message', 'multiple_arity', 'non_null_fields', From e177d58765cc93d7f1f2369c84babc39ef251926 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Thu, 16 Feb 2023 10:12:47 -0500 Subject: [PATCH 05/10] Remove unnecessary double-generation of messages.dart --- packages/pigeon/tool/shared/test_suites.dart | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/pigeon/tool/shared/test_suites.dart b/packages/pigeon/tool/shared/test_suites.dart index 6af4c0c3863..a62b70ba9c8 100644 --- a/packages/pigeon/tool/shared/test_suites.dart +++ b/packages/pigeon/tool/shared/test_suites.dart @@ -216,11 +216,6 @@ Future _runFlutterUnitTests() async { 'non_null_fields', 'null_fields', 'nullable_returns', - // TODO(stuartmorgan): Eliminate these files by ensuring that everything - // they are intended to cover is in core_tests.dart (or, if necessary in - // the short term due to limitations in non-Dart generators, a single other - // file). They aren't being unit tested, only analyzed. - 'message', ]; final int generateCode = await _generateDart({ for (final String name in inputPigeons) From 314138cfef52dec3756d063b8a244ffb2d857995 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Thu, 16 Feb 2023 10:18:46 -0500 Subject: [PATCH 06/10] Remove enum_args --- packages/pigeon/pigeons/enum_args.dart | 20 -------------------- packages/pigeon/tool/shared/generation.dart | 5 +---- 2 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 packages/pigeon/pigeons/enum_args.dart diff --git a/packages/pigeon/pigeons/enum_args.dart b/packages/pigeon/pigeons/enum_args.dart deleted file mode 100644 index 886b92401ca..00000000000 --- a/packages/pigeon/pigeons/enum_args.dart +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:pigeon/pigeon.dart'; - -enum EnumArgsState { - Pending, - Success, - Error, -} - -class EnumArgsData { - EnumArgsState? state; -} - -@HostApi() -abstract class EnumArgs2Host { - void foo(EnumArgsState state); -} diff --git a/packages/pigeon/tool/shared/generation.dart b/packages/pigeon/tool/shared/generation.dart index 709e8e1d892..963e453db82 100644 --- a/packages/pigeon/tool/shared/generation.dart +++ b/packages/pigeon/tool/shared/generation.dart @@ -16,9 +16,7 @@ enum GeneratorLanguages { // A map of pigeons/ files to the languages that they can't yet be generated // for due to limitations of that generator. const Map> _unsupportedFiles = - >{ - 'enum_args': {GeneratorLanguages.cpp}, -}; + >{}; String _snakeToPascalCase(String snake) { final List parts = snake.split('_'); @@ -50,7 +48,6 @@ Future generatePigeons({required String baseDir}) async { 'android_unittests', 'background_platform_channels', 'core_tests', - 'enum_args', 'enum', 'message', 'multiple_arity', From 87efaa4aa55575d04f5807984600349d552e2f26 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Thu, 16 Feb 2023 10:34:59 -0500 Subject: [PATCH 07/10] Remove some unnecesasry/duplicate unit tests --- .../PigeonTest.java | 64 ------------------- 1 file changed, 64 deletions(-) diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/PigeonTest.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/PigeonTest.java index a8a88b190eb..ec57ebdd5c2 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/PigeonTest.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/PigeonTest.java @@ -16,30 +16,6 @@ import org.mockito.ArgumentCaptor; public class PigeonTest { - @Test - public void toListAndBack() { - Pigeon.AndroidSetRequest request = new Pigeon.AndroidSetRequest(); - request.setValue(1234l); - request.setState(Pigeon.AndroidLoadingState.COMPLETE); - ArrayList list = request.toList(); - Pigeon.AndroidSetRequest readRequest = Pigeon.AndroidSetRequest.fromList(list); - assertEquals(request.getValue(), readRequest.getValue()); - assertEquals(request.getState(), readRequest.getState()); - } - - @Test - public void toListAndBackNested() { - Pigeon.AndroidNestedRequest nested = new Pigeon.AndroidNestedRequest(); - Pigeon.AndroidSetRequest request = new Pigeon.AndroidSetRequest(); - request.setValue(1234l); - request.setState(Pigeon.AndroidLoadingState.COMPLETE); - nested.setRequest(request); - ArrayList list = nested.toList(); - Pigeon.AndroidNestedRequest readNested = Pigeon.AndroidNestedRequest.fromList(list); - assertEquals(nested.getRequest().getValue(), readNested.getRequest().getValue()); - assertEquals(nested.getRequest().getState(), readNested.getRequest().getState()); - } - @Test public void clearsHandler() { Pigeon.AndroidApi mockApi = mock(Pigeon.AndroidApi.class); @@ -77,44 +53,4 @@ public void errorMessage() { assertTrue(details.contains("Stacktrace:")); }); } - - @Test - public void callsVoidMethod() { - Pigeon.AndroidApi mockApi = mock(Pigeon.AndroidApi.class); - BinaryMessenger binaryMessenger = mock(BinaryMessenger.class); - Pigeon.AndroidApi.setup(binaryMessenger, mockApi); - ArgumentCaptor handler = - ArgumentCaptor.forClass(BinaryMessenger.BinaryMessageHandler.class); - verify(binaryMessenger).setMessageHandler(anyString(), handler.capture()); - Pigeon.AndroidSetRequest request = new Pigeon.AndroidSetRequest(); - request.setValue(1234l); - request.setState(Pigeon.AndroidLoadingState.COMPLETE); - MessageCodec codec = Pigeon.AndroidApi.getCodec(); - ByteBuffer message = codec.encodeMessage(new ArrayList(Arrays.asList(request))); - message.rewind(); - handler - .getValue() - .onMessage( - message, - (bytes) -> { - bytes.rewind(); - @SuppressWarnings("unchecked") - ArrayList wrapped = (ArrayList) codec.decodeMessage(bytes); - assertTrue(wrapped.size() == 1); - assertNull(wrapped.get(0)); - }); - ArgumentCaptor receivedRequest = - ArgumentCaptor.forClass(Pigeon.AndroidSetRequest.class); - verify(mockApi).setValue(receivedRequest.capture()); - assertEquals(request.getValue(), receivedRequest.getValue().getValue()); - } - - @Test - public void encodeWithNullField() { - Pigeon.AndroidNestedRequest request = new Pigeon.AndroidNestedRequest(); - request.setContext("hello"); - MessageCodec codec = Pigeon.AndroidNestedApi.getCodec(); - ByteBuffer message = codec.encodeMessage(request); - assertNotNull(message); - } } From 8a19d8e5b539d55f2156f619082339e25f6ef306 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Thu, 16 Feb 2023 11:12:14 -0500 Subject: [PATCH 08/10] Eliminate android_unittest --- .../CoreTests.java | 591 +-- .../AsyncTest.java | 4 +- .../PigeonTest.java | 25 +- .../ios/Classes/CoreTests.gen.h | 359 +- .../ios/Classes/CoreTests.gen.m | 1596 +++--- .../lib/src/generated/core_tests.gen.dart | 291 +- .../windows/pigeon/core_tests.gen.cpp | 4672 +++++++---------- .../windows/pigeon/core_tests.gen.h | 434 +- packages/pigeon/tool/shared/generation.dart | 2 - 9 files changed, 3140 insertions(+), 4834 deletions(-) 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 2e19088b392..1c0c3551747 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 @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// +// // Autogenerated from Pigeon (v9.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -19,6 +19,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; @@ -31,7 +32,7 @@ private 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; } @@ -313,8 +314,7 @@ ArrayList toList() { Object aBool = list.get(0); pigeonResult.setABool((Boolean) aBool); Object anInt = 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 aDouble = list.get(2); pigeonResult.setADouble((Double) aDouble); Object aByteArray = list.get(3); @@ -553,8 +553,7 @@ public static final class Builder { private @Nullable Map nullableMapWithAnnotations; - public @NonNull Builder setNullableMapWithAnnotations( - @Nullable Map setterArg) { + public @NonNull Builder setNullableMapWithAnnotations(@Nullable Map setterArg) { this.nullableMapWithAnnotations = setterArg; return this; } @@ -625,10 +624,7 @@ ArrayList toList() { Object aNullableBool = list.get(0); pigeonResult.setANullableBool((Boolean) aNullableBool); Object aNullableInt = 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 aNullableDouble = list.get(2); pigeonResult.setANullableDouble((Double) aNullableDouble); Object aNullableByteArray = list.get(3); @@ -650,8 +646,7 @@ ArrayList toList() { Object nullableMapWithObject = list.get(11); pigeonResult.setNullableMapWithObject((Map) nullableMapWithObject); Object aNullableEnum = list.get(12); - pigeonResult.setANullableEnum( - aNullableEnum == null ? null : AnEnum.values()[(int) aNullableEnum]); + pigeonResult.setANullableEnum(aNullableEnum == null ? null : AnEnum.values()[(int) aNullableEnum]); Object aNullableString = list.get(13); pigeonResult.setANullableString((String) aNullableString); return pigeonResult; @@ -702,8 +697,7 @@ ArrayList toList() { static @NonNull AllNullableTypesWrapper fromList(@NonNull ArrayList list) { AllNullableTypesWrapper pigeonResult = new AllNullableTypesWrapper(); Object values = list.get(0); - pigeonResult.setValues( - (values == null) ? null : AllNullableTypes.fromList((ArrayList) values)); + pigeonResult.setValues((values == null) ? null : AllNullableTypes.fromList((ArrayList) values)); return pigeonResult; } } @@ -711,7 +705,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; @@ -803,94 +797,94 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } /** - * 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(); /** Responds with an error from an async void function. */ void throwErrorFromVoid(); /** 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 aList); /** Returns the passed map, to test serialization and deserialization. */ - @NonNull + @NonNull Map echoMap(@NonNull Map aMap); /** Returns the passed object, to test serialization and deserialization. */ - @Nullable + @Nullable AllNullableTypes echoAllNullableTypes(@Nullable AllNullableTypes 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 AllNullableTypesWrapper 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 AllNullableTypesWrapper 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 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); /** - * 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(Result result); /** Returns passed in int asynchronously. */ @@ -916,8 +910,7 @@ AllNullableTypes sendMultipleNullableTypes( /** Returns the passed object, to test async serialization and deserialization. */ void echoAsyncAllTypes(@NonNull AllTypes everything, Result result); /** Returns the passed object, to test serialization and deserialization. */ - void echoAsyncNullableAllNullableTypes( - @Nullable AllNullableTypes everything, Result result); + void echoAsyncNullableAllNullableTypes(@Nullable AllNullableTypes everything, Result result); /** Returns passed in int asynchronously. */ void echoAsyncNullableInt(@Nullable Long anInt, Result result); /** Returns passed in double asynchronously. */ @@ -933,8 +926,7 @@ void echoAsyncNullableAllNullableTypes( /** Returns the passed list, to test serialization and deserialization asynchronously. */ void echoAsyncNullableList(@Nullable List aList, Result> result); /** Returns the passed map, to test serialization and deserialization asynchronously. */ - void echoAsyncNullableMap( - @Nullable Map aMap, Result> result); + void echoAsyncNullableMap(@Nullable Map aMap, Result> result); void callFlutterNoop(Result result); @@ -944,11 +936,7 @@ void echoAsyncNullableMap( void callFlutterEchoAllTypes(@NonNull AllTypes everything, Result result); - void callFlutterSendMultipleNullableTypes( - @Nullable Boolean aNullableBool, - @Nullable Long aNullableInt, - @Nullable String aNullableString, - Result result); + void callFlutterSendMultipleNullableTypes(@Nullable Boolean aNullableBool, @Nullable Long aNullableInt, @Nullable String aNullableString, Result result); void callFlutterEchoBool(@NonNull Boolean aBool, Result result); @@ -976,17 +964,13 @@ void callFlutterSendMultipleNullableTypes( void callFlutterEchoNullableList(@Nullable List aList, Result> result); - void callFlutterEchoNullableMap( - @Nullable Map aMap, Result> result); + void callFlutterEchoNullableMap(@Nullable Map aMap, Result> result); /** The codec used by HostIntegrationCoreApi. */ static MessageCodec getCodec() { return HostIntegrationCoreApiCodec.INSTANCE; } - /** - * Sets up an instance of `HostIntegrationCoreApi` to handle messages through the - * `binaryMessenger`. - */ + /**Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binaryMessenger`. */ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = @@ -1012,9 +996,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAllTypes", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAllTypes", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1041,9 +1023,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.throwError", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.throwError", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1064,9 +1044,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.throwErrorFromVoid", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.throwErrorFromVoid", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1114,9 +1092,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoDouble", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoDouble", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1170,9 +1146,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoString", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoString", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1199,9 +1173,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoUint8List", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoUint8List", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1228,9 +1200,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoObject", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoObject", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1311,9 +1281,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAllNullableTypes", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAllNullableTypes", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1337,9 +1305,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1366,9 +1332,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1377,8 +1341,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { ArrayList args = (ArrayList) message; assert args != null; String nullableStringArg = (String) args.get(0); - AllNullableTypesWrapper output = - api.createNestedNullableString(nullableStringArg); + AllNullableTypesWrapper output = api.createNestedNullableString(nullableStringArg); wrapped.add(0, output); } catch (Error | RuntimeException exception) { ArrayList wrappedError = wrapError(exception); @@ -1393,9 +1356,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1406,11 +1367,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { Boolean aNullableBoolArg = (Boolean) args.get(0); Number aNullableIntArg = (Number) args.get(1); String aNullableStringArg = (String) args.get(2); - 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 (Error | RuntimeException exception) { ArrayList wrappedError = wrapError(exception); @@ -1425,9 +1382,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableInt", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableInt", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1436,9 +1391,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { ArrayList args = (ArrayList) message; assert args != null; Number aNullableIntArg = (Number) args.get(0); - Long output = - api.echoNullableInt( - (aNullableIntArg == null) ? null : aNullableIntArg.longValue()); + Long output = api.echoNullableInt((aNullableIntArg == null) ? null : aNullableIntArg.longValue()); wrapped.add(0, output); } catch (Error | RuntimeException exception) { ArrayList wrappedError = wrapError(exception); @@ -1453,9 +1406,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableDouble", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableDouble", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1479,9 +1430,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableBool", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableBool", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1505,9 +1454,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableString", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableString", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1531,9 +1478,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1557,9 +1502,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableObject", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableObject", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1583,9 +1526,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableList", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableList", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1609,9 +1550,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableMap", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableMap", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1641,7 +1580,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { (message, reply) -> { ArrayList wrapped = new ArrayList(); try { - Result resultCallback = + Result resultCallback = new Result() { public void success(Void result) { wrapped.add(0, null); @@ -1667,9 +1606,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncInt", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncInt", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1681,7 +1618,7 @@ public void error(Throwable error) { if (anIntArg == null) { throw new NullPointerException("anIntArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(Long result) { wrapped.add(0, result); @@ -1694,8 +1631,7 @@ public void error(Throwable error) { } }; - api.echoAsyncInt( - (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.echoAsyncInt((anIntArg == null) ? null : anIntArg.longValue(), resultCallback); } catch (Error | RuntimeException exception) { ArrayList wrappedError = wrapError(exception); reply.reply(wrappedError); @@ -1708,9 +1644,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncDouble", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncDouble", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1722,7 +1656,7 @@ public void error(Throwable error) { if (aDoubleArg == null) { throw new NullPointerException("aDoubleArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(Double result) { wrapped.add(0, result); @@ -1748,9 +1682,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncBool", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncBool", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1762,7 +1694,7 @@ public void error(Throwable error) { if (aBoolArg == null) { throw new NullPointerException("aBoolArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(Boolean result) { wrapped.add(0, result); @@ -1788,9 +1720,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncString", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncString", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1802,7 +1732,7 @@ public void error(Throwable error) { if (aStringArg == null) { throw new NullPointerException("aStringArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(String result) { wrapped.add(0, result); @@ -1828,9 +1758,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncUint8List", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncUint8List", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1842,7 +1770,7 @@ public void error(Throwable error) { if (aUint8ListArg == null) { throw new NullPointerException("aUint8ListArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(byte[] result) { wrapped.add(0, result); @@ -1868,9 +1796,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncObject", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncObject", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1882,7 +1808,7 @@ public void error(Throwable error) { if (anObjectArg == null) { throw new NullPointerException("anObjectArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(Object result) { wrapped.add(0, result); @@ -1908,9 +1834,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncList", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncList", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1922,7 +1846,7 @@ public void error(Throwable error) { if (aListArg == null) { throw new NullPointerException("aListArg unexpectedly null."); } - Result> resultCallback = + Result> resultCallback = new Result>() { public void success(List result) { wrapped.add(0, result); @@ -1948,9 +1872,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncMap", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncMap", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1962,7 +1884,7 @@ public void error(Throwable error) { if (aMapArg == null) { throw new NullPointerException("aMapArg unexpectedly null."); } - Result> resultCallback = + Result> resultCallback = new Result>() { public void success(Map result) { wrapped.add(0, result); @@ -1988,15 +1910,13 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncError", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncError", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); try { - Result resultCallback = + Result resultCallback = new Result() { public void success(Object result) { wrapped.add(0, result); @@ -2022,15 +1942,13 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); try { - Result resultCallback = + Result resultCallback = new Result() { public void success(Void result) { wrapped.add(0, null); @@ -2056,9 +1974,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncAllTypes", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncAllTypes", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2070,7 +1986,7 @@ public void error(Throwable error) { if (everythingArg == null) { throw new NullPointerException("everythingArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(AllTypes result) { wrapped.add(0, result); @@ -2096,9 +2012,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2107,7 +2021,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; AllNullableTypes everythingArg = (AllNullableTypes) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(AllNullableTypes result) { wrapped.add(0, result); @@ -2133,9 +2047,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableInt", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableInt", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2144,7 +2056,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Number anIntArg = (Number) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(Long result) { wrapped.add(0, result); @@ -2157,8 +2069,7 @@ public void error(Throwable error) { } }; - api.echoAsyncNullableInt( - (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.echoAsyncNullableInt((anIntArg == null) ? null : anIntArg.longValue(), resultCallback); } catch (Error | RuntimeException exception) { ArrayList wrappedError = wrapError(exception); reply.reply(wrappedError); @@ -2171,9 +2082,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2182,7 +2091,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Double aDoubleArg = (Double) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(Double result) { wrapped.add(0, result); @@ -2208,9 +2117,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2219,7 +2126,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Boolean aBoolArg = (Boolean) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(Boolean result) { wrapped.add(0, result); @@ -2245,9 +2152,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2256,7 +2161,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; String aStringArg = (String) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(String result) { wrapped.add(0, result); @@ -2282,9 +2187,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2293,7 +2196,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; byte[] aUint8ListArg = (byte[]) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(byte[] result) { wrapped.add(0, result); @@ -2319,9 +2222,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2330,7 +2231,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Object anObjectArg = args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(Object result) { wrapped.add(0, result); @@ -2356,9 +2257,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2367,7 +2266,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; List aListArg = (List) args.get(0); - Result> resultCallback = + Result> resultCallback = new Result>() { public void success(List result) { wrapped.add(0, result); @@ -2393,9 +2292,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableMap", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableMap", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2404,7 +2301,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Map aMapArg = (Map) args.get(0); - Result> resultCallback = + Result> resultCallback = new Result>() { public void success(Map result) { wrapped.add(0, result); @@ -2430,15 +2327,13 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterNoop", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterNoop", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); try { - Result resultCallback = + Result resultCallback = new Result() { public void success(Void result) { wrapped.add(0, null); @@ -2464,15 +2359,13 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); try { - Result resultCallback = + Result resultCallback = new Result() { public void success(Object result) { wrapped.add(0, result); @@ -2498,15 +2391,13 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); try { - Result resultCallback = + Result resultCallback = new Result() { public void success(Void result) { wrapped.add(0, null); @@ -2532,9 +2423,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2546,7 +2435,7 @@ public void error(Throwable error) { if (everythingArg == null) { throw new NullPointerException("everythingArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(AllTypes result) { wrapped.add(0, result); @@ -2572,9 +2461,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2585,7 +2472,7 @@ public void error(Throwable error) { Boolean aNullableBoolArg = (Boolean) args.get(0); Number aNullableIntArg = (Number) args.get(1); String aNullableStringArg = (String) args.get(2); - Result resultCallback = + Result resultCallback = new Result() { public void success(AllNullableTypes result) { wrapped.add(0, result); @@ -2598,11 +2485,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); } catch (Error | RuntimeException exception) { ArrayList wrappedError = wrapError(exception); reply.reply(wrappedError); @@ -2615,9 +2498,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoBool", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoBool", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2629,7 +2510,7 @@ public void error(Throwable error) { if (aBoolArg == null) { throw new NullPointerException("aBoolArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(Boolean result) { wrapped.add(0, result); @@ -2655,9 +2536,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoInt", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoInt", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2669,7 +2548,7 @@ public void error(Throwable error) { if (anIntArg == null) { throw new NullPointerException("anIntArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(Long result) { wrapped.add(0, result); @@ -2682,8 +2561,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoInt( - (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.callFlutterEchoInt((anIntArg == null) ? null : anIntArg.longValue(), resultCallback); } catch (Error | RuntimeException exception) { ArrayList wrappedError = wrapError(exception); reply.reply(wrappedError); @@ -2696,9 +2574,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2710,7 +2586,7 @@ public void error(Throwable error) { if (aDoubleArg == null) { throw new NullPointerException("aDoubleArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(Double result) { wrapped.add(0, result); @@ -2736,9 +2612,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2750,7 +2624,7 @@ public void error(Throwable error) { if (aStringArg == null) { throw new NullPointerException("aStringArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(String result) { wrapped.add(0, result); @@ -2776,9 +2650,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2790,7 +2662,7 @@ public void error(Throwable error) { if (aListArg == null) { throw new NullPointerException("aListArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(byte[] result) { wrapped.add(0, result); @@ -2816,9 +2688,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoList", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoList", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2830,7 +2700,7 @@ public void error(Throwable error) { if (aListArg == null) { throw new NullPointerException("aListArg unexpectedly null."); } - Result> resultCallback = + Result> resultCallback = new Result>() { public void success(List result) { wrapped.add(0, result); @@ -2856,9 +2726,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoMap", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoMap", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2870,7 +2738,7 @@ public void error(Throwable error) { if (aMapArg == null) { throw new NullPointerException("aMapArg unexpectedly null."); } - Result> resultCallback = + Result> resultCallback = new Result>() { public void success(Map result) { wrapped.add(0, result); @@ -2896,9 +2764,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2907,7 +2773,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Boolean aBoolArg = (Boolean) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(Boolean result) { wrapped.add(0, result); @@ -2933,9 +2799,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2944,7 +2808,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Number anIntArg = (Number) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(Long result) { wrapped.add(0, result); @@ -2957,8 +2821,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoNullableInt( - (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.callFlutterEchoNullableInt((anIntArg == null) ? null : anIntArg.longValue(), resultCallback); } catch (Error | RuntimeException exception) { ArrayList wrappedError = wrapError(exception); reply.reply(wrappedError); @@ -2971,9 +2834,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableDouble", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableDouble", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2982,7 +2843,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Double aDoubleArg = (Double) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(Double result) { wrapped.add(0, result); @@ -3008,9 +2869,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableString", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableString", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3019,7 +2878,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; String aStringArg = (String) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(String result) { wrapped.add(0, result); @@ -3045,9 +2904,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableUint8List", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableUint8List", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3056,7 +2913,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; byte[] aListArg = (byte[]) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(byte[] result) { wrapped.add(0, result); @@ -3082,9 +2939,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3093,7 +2948,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; List aListArg = (List) args.get(0); - Result> resultCallback = + Result> resultCallback = new Result>() { public void success(List result) { wrapped.add(0, result); @@ -3119,9 +2974,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3130,7 +2983,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Map aMapArg = (Map) args.get(0); - Result> resultCallback = + Result> resultCallback = new Result>() { public void success(Map result) { wrapped.add(0, result); @@ -3157,8 +3010,7 @@ public void error(Throwable error) { } private static class FlutterIntegrationCoreApiCodec extends StandardMessageCodec { - public static final FlutterIntegrationCoreApiCodec INSTANCE = - new FlutterIntegrationCoreApiCodec(); + public static final FlutterIntegrationCoreApiCodec INSTANCE = new FlutterIntegrationCoreApiCodec(); private FlutterIntegrationCoreApiCodec() {} @@ -3199,10 +3051,10 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } /** - * 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 BinaryMessenger binaryMessenger; @@ -3211,8 +3063,7 @@ public FlutterIntegrationCoreApi(BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ - public interface Reply { + /** Public interface for sending reply. */ public interface Reply { void reply(T reply); } /** The codec used by FlutterIntegrationCoreApi. */ @@ -3220,21 +3071,22 @@ static MessageCodec getCodec() { return FlutterIntegrationCoreApiCodec.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(Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.noop", getCodec()); - channel.send(null, channelReply -> callback.reply(null)); + channel.send( + null, + channelReply -> callback.reply(null)); } /** Responds with an error from an async function returning a value. */ public void throwError(Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.throwError", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.throwError", getCodec()); channel.send( null, channelReply -> { @@ -3247,18 +3099,16 @@ public void throwError(Reply callback) { public void throwErrorFromVoid(Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.throwErrorFromVoid", - getCodec()); - channel.send(null, channelReply -> callback.reply(null)); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.throwErrorFromVoid", getCodec()); + channel.send( + null, + channelReply -> callback.reply(null)); } /** Returns the passed object, to test serialization and deserialization. */ public void echoAllTypes(@NonNull AllTypes everythingArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllTypes", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllTypes", getCodec()); channel.send( new ArrayList(Collections.singletonList(everythingArg)), channelReply -> { @@ -3268,13 +3118,10 @@ public void echoAllTypes(@NonNull AllTypes everythingArg, Reply callba }); } /** Returns the passed object, to test serialization and deserialization. */ - public void echoAllNullableTypes( - @NonNull AllNullableTypes everythingArg, Reply callback) { + public void echoAllNullableTypes(@NonNull AllNullableTypes everythingArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes", getCodec()); channel.send( new ArrayList(Collections.singletonList(everythingArg)), channelReply -> { @@ -3286,21 +3133,14 @@ public void echoAllNullableTypes( /** * 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, - Reply callback) { + public void sendMultipleNullableTypes(@Nullable Boolean aNullableBoolArg, @Nullable Long aNullableIntArg, @Nullable String aNullableStringArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes", getCodec()); channel.send( - new ArrayList( - Arrays.asList(aNullableBoolArg, aNullableIntArg, aNullableStringArg)), + new ArrayList(Arrays.asList(aNullableBoolArg, aNullableIntArg, aNullableStringArg)), channelReply -> { @SuppressWarnings("ConstantConditions") AllNullableTypes output = (AllNullableTypes) channelReply; @@ -3337,9 +3177,7 @@ public void echoInt(@NonNull Long anIntArg, Reply callback) { public void echoDouble(@NonNull Double aDoubleArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoDouble", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoDouble", getCodec()); channel.send( new ArrayList(Collections.singletonList(aDoubleArg)), channelReply -> { @@ -3352,9 +3190,7 @@ public void echoDouble(@NonNull Double aDoubleArg, Reply callback) { public void echoString(@NonNull String aStringArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoString", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoString", getCodec()); channel.send( new ArrayList(Collections.singletonList(aStringArg)), channelReply -> { @@ -3367,9 +3203,7 @@ public void echoString(@NonNull String aStringArg, Reply callback) { public void echoUint8List(@NonNull byte[] aListArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoUint8List", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoUint8List", getCodec()); channel.send( new ArrayList(Collections.singletonList(aListArg)), channelReply -> { @@ -3408,9 +3242,7 @@ public void echoMap(@NonNull Map aMapArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool", getCodec()); channel.send( new ArrayList(Collections.singletonList(aBoolArg)), channelReply -> { @@ -3423,9 +3255,7 @@ public void echoNullableBool(@Nullable Boolean aBoolArg, Reply callback public void echoNullableInt(@Nullable Long anIntArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableInt", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableInt", getCodec()); channel.send( new ArrayList(Collections.singletonList(anIntArg)), channelReply -> { @@ -3438,9 +3268,7 @@ public void echoNullableInt(@Nullable Long anIntArg, Reply callback) { public void echoNullableDouble(@Nullable Double aDoubleArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble", getCodec()); channel.send( new ArrayList(Collections.singletonList(aDoubleArg)), channelReply -> { @@ -3453,9 +3281,7 @@ public void echoNullableDouble(@Nullable Double aDoubleArg, Reply callba public void echoNullableString(@Nullable String aStringArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString", getCodec()); channel.send( new ArrayList(Collections.singletonList(aStringArg)), channelReply -> { @@ -3468,9 +3294,7 @@ public void echoNullableString(@Nullable String aStringArg, Reply callba public void echoNullableUint8List(@Nullable byte[] aListArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List", getCodec()); channel.send( new ArrayList(Collections.singletonList(aListArg)), channelReply -> { @@ -3483,9 +3307,7 @@ public void echoNullableUint8List(@Nullable byte[] aListArg, Reply callb public void echoNullableList(@Nullable List aListArg, Reply> callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList", getCodec()); channel.send( new ArrayList(Collections.singletonList(aListArg)), channelReply -> { @@ -3495,13 +3317,10 @@ public void echoNullableList(@Nullable List aListArg, Reply }); } /** Returns the passed map, to test serialization and deserialization. */ - public void echoNullableMap( - @Nullable Map aMapArg, Reply> callback) { + public void echoNullableMap(@Nullable Map aMapArg, Reply> callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableMap", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableMap", getCodec()); channel.send( new ArrayList(Collections.singletonList(aMapArg)), channelReply -> { @@ -3511,24 +3330,22 @@ public void echoNullableMap( }); } /** - * 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(Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync", - getCodec()); - channel.send(null, channelReply -> callback.reply(null)); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync", getCodec()); + channel.send( + null, + channelReply -> callback.reply(null)); } /** Returns the passed in generic Object asynchronously. */ public void echoAsyncString(@NonNull String aStringArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString", getCodec()); channel.send( new ArrayList(Collections.singletonList(aStringArg)), channelReply -> { @@ -3541,7 +3358,7 @@ public void echoAsyncString(@NonNull String aStringArg, Reply callback) /** * 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 { @@ -3551,7 +3368,7 @@ public interface HostTrivialApi { static MessageCodec getCodec() { return new StandardMessageCodec(); } - /** 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(BinaryMessenger binaryMessenger, HostTrivialApi api) { { BasicMessageChannel channel = @@ -3579,7 +3396,7 @@ static void setup(BinaryMessenger binaryMessenger, HostTrivialApi api) { /** * 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 { @@ -3591,7 +3408,7 @@ public interface HostSmallApi { static MessageCodec getCodec() { return new StandardMessageCodec(); } - /** 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(BinaryMessenger binaryMessenger, HostSmallApi api) { { BasicMessageChannel channel = @@ -3608,7 +3425,7 @@ static void setup(BinaryMessenger binaryMessenger, HostSmallApi api) { if (aStringArg == null) { throw new NullPointerException("aStringArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(String result) { wrapped.add(0, result); @@ -3640,7 +3457,7 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList(); try { - Result resultCallback = + Result resultCallback = new Result() { public void success(Void result) { wrapped.add(0, null); @@ -3695,24 +3512,22 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** * 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 final class FlutterSmallApi { + public static class FlutterSmallApi { private final BinaryMessenger binaryMessenger; public FlutterSmallApi(BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ - public interface Reply { + /** Public interface for sending reply. */ public interface Reply { void reply(T reply); } /** The codec used by FlutterSmallApi. */ static MessageCodec getCodec() { return FlutterSmallApiCodec.INSTANCE; } - public void echoWrappedList(@NonNull TestMessage msgArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/AsyncTest.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/AsyncTest.java index 29d2d2d51c4..e5e795380a8 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/AsyncTest.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/AsyncTest.java @@ -51,7 +51,7 @@ public void asyncSuccess() { verify(binaryMessenger).setMessageHandler(eq("dev.flutter.pigeon.HostSmallApi.echo"), any()); verify(binaryMessenger) .setMessageHandler(eq("dev.flutter.pigeon.HostSmallApi.voidVoid"), handler.capture()); - MessageCodec codec = Pigeon.AndroidApi.getCodec(); + MessageCodec codec = HostSmallApi.getCodec(); ByteBuffer message = codec.encodeMessage(null); Boolean[] didCall = {false}; handler @@ -78,7 +78,7 @@ public void asyncError() { verify(binaryMessenger).setMessageHandler(eq("dev.flutter.pigeon.HostSmallApi.echo"), any()); verify(binaryMessenger) .setMessageHandler(eq("dev.flutter.pigeon.HostSmallApi.voidVoid"), handler.capture()); - MessageCodec codec = Pigeon.AndroidApi.getCodec(); + MessageCodec codec = HostSmallApi.getCodec(); ByteBuffer message = codec.encodeMessage(null); Boolean[] didCall = {false}; handler diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/PigeonTest.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/PigeonTest.java index ec57ebdd5c2..865d4ef8176 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/PigeonTest.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/PigeonTest.java @@ -7,39 +7,40 @@ import static org.junit.Assert.*; import static org.mockito.Mockito.*; +import com.example.alternate_language_test_plugin.CoreTests.HostSmallApi; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.MessageCodec; import java.nio.ByteBuffer; import java.util.ArrayList; -import java.util.Arrays; import org.junit.Test; import org.mockito.ArgumentCaptor; public class PigeonTest { @Test public void clearsHandler() { - Pigeon.AndroidApi mockApi = mock(Pigeon.AndroidApi.class); + HostSmallApi mockApi = mock(HostSmallApi.class); BinaryMessenger binaryMessenger = mock(BinaryMessenger.class); - Pigeon.AndroidApi.setup(binaryMessenger, mockApi); + HostSmallApi.setup(binaryMessenger, mockApi); ArgumentCaptor channelName = ArgumentCaptor.forClass(String.class); - verify(binaryMessenger).setMessageHandler(channelName.capture(), isNotNull()); - Pigeon.AndroidApi.setup(binaryMessenger, null); - verify(binaryMessenger).setMessageHandler(eq(channelName.getValue()), isNull()); + verify(binaryMessenger, atLeast(1)).setMessageHandler(channelName.capture(), isNotNull()); + HostSmallApi.setup(binaryMessenger, null); + verify(binaryMessenger, atLeast(1)).setMessageHandler(eq(channelName.getValue()), isNull()); } - /** Causes an exception in the handler by passing in null when a AndroidSetRequest is expected. */ + /** Causes an exception in the handler by passing in null when a non-null value is expected. */ @Test public void errorMessage() { - Pigeon.AndroidApi mockApi = mock(Pigeon.AndroidApi.class); + HostSmallApi mockApi = mock(HostSmallApi.class); BinaryMessenger binaryMessenger = mock(BinaryMessenger.class); - Pigeon.AndroidApi.setup(binaryMessenger, mockApi); + HostSmallApi.setup(binaryMessenger, mockApi); ArgumentCaptor handler = ArgumentCaptor.forClass(BinaryMessenger.BinaryMessageHandler.class); - verify(binaryMessenger).setMessageHandler(anyString(), handler.capture()); - MessageCodec codec = Pigeon.AndroidApi.getCodec(); + verify(binaryMessenger, atLeast(1)).setMessageHandler(anyString(), handler.capture()); + MessageCodec codec = HostSmallApi.getCodec(); ByteBuffer message = codec.encodeMessage(null); handler - .getValue() + .getAllValues() + .get(0) // "echo" is the first method. .onMessage( message, (bytes) -> { 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 c0f834cfa83..c26e2c3c540 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 @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// +// // Autogenerated from Pigeon (v9.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -29,73 +29,71 @@ typedef NS_ENUM(NSUInteger, AnEnum) { /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithABool:(NSNumber *)aBool - anInt:(NSNumber *)anInt - aDouble:(NSNumber *)aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - aList:(NSArray *)aList - aMap:(NSDictionary *)aMap - anEnum:(AnEnum)anEnum - aString:(NSString *)aString; -@property(nonatomic, strong) NSNumber *aBool; -@property(nonatomic, strong) NSNumber *anInt; -@property(nonatomic, strong) NSNumber *aDouble; -@property(nonatomic, strong) FlutterStandardTypedData *aByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *a4ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *a8ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData *aFloatArray; -@property(nonatomic, strong) NSArray *aList; -@property(nonatomic, strong) NSDictionary *aMap; + anInt:(NSNumber *)anInt + aDouble:(NSNumber *)aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + aList:(NSArray *)aList + aMap:(NSDictionary *)aMap + anEnum:(AnEnum)anEnum + aString:(NSString *)aString; +@property(nonatomic, strong) NSNumber * aBool; +@property(nonatomic, strong) NSNumber * anInt; +@property(nonatomic, strong) NSNumber * aDouble; +@property(nonatomic, strong) FlutterStandardTypedData * aByteArray; +@property(nonatomic, strong) FlutterStandardTypedData * a4ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData * a8ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData * aFloatArray; +@property(nonatomic, strong) NSArray * aList; +@property(nonatomic, strong) NSDictionary * aMap; @property(nonatomic, assign) AnEnum anEnum; -@property(nonatomic, copy) NSString *aString; +@property(nonatomic, copy) NSString * aString; @end @interface AllNullableTypes : NSObject + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - aNullableList:(nullable NSArray *)aNullableList - aNullableMap:(nullable NSDictionary *)aNullableMap - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(AnEnum)aNullableEnum - aNullableString:(nullable NSString *)aNullableString; -@property(nonatomic, strong, nullable) NSNumber *aNullableBool; -@property(nonatomic, strong, nullable) NSNumber *aNullableInt; -@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, strong, nullable) NSArray *aNullableList; -@property(nonatomic, strong, nullable) NSDictionary *aNullableMap; -@property(nonatomic, strong, nullable) NSArray *> *nullableNestedList; -@property(nonatomic, strong, nullable) - NSDictionary *nullableMapWithAnnotations; -@property(nonatomic, strong, nullable) NSDictionary *nullableMapWithObject; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableList:(nullable NSArray *)aNullableList + aNullableMap:(nullable NSDictionary *)aNullableMap + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(AnEnum)aNullableEnum + aNullableString:(nullable NSString *)aNullableString; +@property(nonatomic, strong, nullable) NSNumber * aNullableBool; +@property(nonatomic, strong, nullable) NSNumber * aNullableInt; +@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, strong, nullable) NSArray * aNullableList; +@property(nonatomic, strong, nullable) NSDictionary * aNullableMap; +@property(nonatomic, strong, nullable) NSArray *> * nullableNestedList; +@property(nonatomic, strong, nullable) NSDictionary * nullableMapWithAnnotations; +@property(nonatomic, strong, nullable) NSDictionary * nullableMapWithObject; @property(nonatomic, assign) AnEnum aNullableEnum; -@property(nonatomic, copy, nullable) NSString *aNullableString; +@property(nonatomic, copy, nullable) NSString * aNullableString; @end @interface AllNullableTypesWrapper : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithValues:(AllNullableTypes *)values; -@property(nonatomic, strong) AllNullableTypes *values; +@property(nonatomic, strong) AllNullableTypes * values; @end /// A data class containing a List, used in unit tests. @interface TestMessage : NSObject + (instancetype)makeWithTestList:(nullable NSArray *)testList; -@property(nonatomic, strong, nullable) NSArray *testList; +@property(nonatomic, strong, nullable) NSArray * testList; @end /// The codec used by HostIntegrationCoreApi. @@ -110,8 +108,7 @@ NSObject *HostIntegrationCoreApiGetCodec(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; /// Responds with an error from an async void function. @@ -123,8 +120,7 @@ NSObject *HostIntegrationCoreApiGetCodec(void); /// Returns passed in double. /// /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoDouble:(NSNumber *)aDouble - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoDouble:(NSNumber *)aDouble error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in boolean. /// /// @return `nil` only when `error != nil`. @@ -132,13 +128,11 @@ NSObject *HostIntegrationCoreApiGetCodec(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`. @@ -146,179 +140,106 @@ NSObject *HostIntegrationCoreApiGetCodec(void); /// Returns the passed list, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable NSArray *)echoList:(NSArray *)aList - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSArray *)echoList:(NSArray *)aList 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 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 inner `aString` value from the wrapped object, to test /// sending of nested objects. -- (nullable NSString *)extractNestedNullableStringFrom:(AllNullableTypesWrapper *)wrapper - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)extractNestedNullableStringFrom:(AllNullableTypesWrapper *)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 AllNullableTypesWrapper *) - createNestedObjectWithNullableString:(nullable NSString *)nullableString - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllNullableTypesWrapper *)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 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; +- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)aNullableMap 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:(NSNumber *)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncInt:(NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in double asynchronously. -- (void)echoAsyncDouble:(NSNumber *)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncDouble:(NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in boolean asynchronously. -- (void)echoAsyncBool:(NSNumber *)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncBool:(NSNumber *)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 serialization and deserialization asynchronously. -- (void)echoAsyncList:(NSArray *)aList - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncList:(NSArray *)aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization asynchronously. -- (void)echoAsyncMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_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; /// 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 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 serialization and deserialization asynchronously. -- (void)echoAsyncNullableList:(nullable NSArray *)aList - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableList:(nullable NSArray *)aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization asynchronously. -- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_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)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool - anInt:(nullable NSNumber *)aNullableInt - aString:(nullable NSString *)aNullableString - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoBool:(NSNumber *)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoInt:(NSNumber *)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoDouble:(NSNumber *)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoString:(NSString *)aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)aList - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoList:(NSArray *)aList - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_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 *)aList - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableList:(nullable NSArray *)aList - completion: - (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllTypes:(AllTypes *)everything completion:(void (^)(AllTypes *_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)callFlutterEchoBool:(NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoInt:(NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoDouble:(NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)aList completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoList:(NSArray *)aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_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 *)aList completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableList:(nullable NSArray *)aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; @end -extern void HostIntegrationCoreApiSetup(id binaryMessenger, - NSObject *_Nullable api); +extern void HostIntegrationCoreApiSetup(id binaryMessenger, NSObject *_Nullable api); /// The codec used by FlutterIntegrationCoreApi. NSObject *FlutterIntegrationCoreApiGetCodec(void); @@ -335,72 +256,46 @@ NSObject *FlutterIntegrationCoreApiGetCodec(void); /// 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:(AllNullableTypes *)everything - completion: - (void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAllNullableTypes:(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 boolean, to test serialization and deserialization. -- (void)echoBool:(NSNumber *)aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoBool:(NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed int, to test serialization and deserialization. -- (void)echoInt:(NSNumber *)anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoInt:(NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed double, to test serialization and deserialization. -- (void)echoDouble:(NSNumber *)aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoDouble:(NSNumber *)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 *)aList - completion: - (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)echoUint8List:(FlutterStandardTypedData *)aList completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test serialization and deserialization. -- (void)echoList:(NSArray *)aList - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoList:(NSArray *)aList 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 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 *)aList - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)aList completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test serialization and deserialization. -- (void)echoNullableList:(nullable NSArray *)aList - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableList:(nullable NSArray *)aList 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; /// 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 /// The codec used by HostTrivialApi. @@ -411,21 +306,18 @@ NSObject *HostTrivialApiGetCodec(void); - (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error; @end -extern void HostTrivialApiSetup(id binaryMessenger, - NSObject *_Nullable api); +extern void HostTrivialApiSetup(id binaryMessenger, NSObject *_Nullable api); /// The codec used by HostSmallApi. NSObject *HostSmallApiGetCodec(void); /// 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 HostSmallApiSetup(id binaryMessenger, - NSObject *_Nullable api); +extern void HostSmallApiSetup(id binaryMessenger, NSObject *_Nullable api); /// The codec used by FlutterSmallApi. NSObject *FlutterSmallApiGetCodec(void); @@ -433,8 +325,7 @@ NSObject *FlutterSmallApiGetCodec(void); /// A simple API called in some unit tests. @interface FlutterSmallApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (void)echoWrappedList:(TestMessage *)msg - completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion; +- (void)echoWrappedList:(TestMessage *)msg completion:(void (^)(TestMessage *_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 b3f948a4617..60899fe2ac7 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 @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// +// // Autogenerated from Pigeon (v9.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -51,17 +51,17 @@ - (NSArray *)toList; @implementation AllTypes + (instancetype)makeWithABool:(NSNumber *)aBool - anInt:(NSNumber *)anInt - aDouble:(NSNumber *)aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - aList:(NSArray *)aList - aMap:(NSDictionary *)aMap - anEnum:(AnEnum)anEnum - aString:(NSString *)aString { - AllTypes *pigeonResult = [[AllTypes alloc] init]; + anInt:(NSNumber *)anInt + aDouble:(NSNumber *)aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + aList:(NSArray *)aList + aMap:(NSDictionary *)aMap + anEnum:(AnEnum)anEnum + aString:(NSString *)aString { + AllTypes* pigeonResult = [[AllTypes alloc] init]; pigeonResult.aBool = aBool; pigeonResult.anInt = anInt; pigeonResult.aDouble = aDouble; @@ -122,21 +122,20 @@ - (NSArray *)toList { @implementation AllNullableTypes + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - aNullableList:(nullable NSArray *)aNullableList - aNullableMap:(nullable NSDictionary *)aNullableMap - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(AnEnum)aNullableEnum - aNullableString:(nullable NSString *)aNullableString { - AllNullableTypes *pigeonResult = [[AllNullableTypes alloc] init]; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableList:(nullable NSArray *)aNullableList + aNullableMap:(nullable NSDictionary *)aNullableMap + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(AnEnum)aNullableEnum + aNullableString:(nullable NSString *)aNullableString { + AllNullableTypes* pigeonResult = [[AllNullableTypes alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; pigeonResult.aNullableDouble = aNullableDouble; @@ -196,7 +195,7 @@ - (NSArray *)toList { @implementation AllNullableTypesWrapper + (instancetype)makeWithValues:(AllNullableTypes *)values { - AllNullableTypesWrapper *pigeonResult = [[AllNullableTypesWrapper alloc] init]; + AllNullableTypesWrapper* pigeonResult = [[AllNullableTypesWrapper alloc] init]; pigeonResult.values = values; return pigeonResult; } @@ -218,7 +217,7 @@ - (NSArray *)toList { @implementation TestMessage + (instancetype)makeWithTestList:(nullable NSArray *)testList { - TestMessage *pigeonResult = [[TestMessage alloc] init]; + TestMessage* pigeonResult = [[TestMessage alloc] init]; pigeonResult.testList = testList; return pigeonResult; } @@ -242,13 +241,13 @@ @interface HostIntegrationCoreApiCodecReader : FlutterStandardReader @implementation HostIntegrationCoreApiCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: + case 128: return [AllNullableTypes fromList:[self readValue]]; - case 129: + case 129: return [AllNullableTypesWrapper fromList:[self readValue]]; - case 130: + case 130: return [AllTypes fromList:[self readValue]]; - case 131: + case 131: return [TestMessage fromList:[self readValue]]; default: return [super readValueOfType:type]; @@ -293,26 +292,23 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - HostIntegrationCoreApiCodecReaderWriter *readerWriter = - [[HostIntegrationCoreApiCodecReaderWriter alloc] init]; + HostIntegrationCoreApiCodecReaderWriter *readerWriter = [[HostIntegrationCoreApiCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } -void HostIntegrationCoreApiSetup(id binaryMessenger, - NSObject *api) { +void HostIntegrationCoreApiSetup(id binaryMessenger, NSObject *api) { /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.noop" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.noop" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -324,15 +320,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAllTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAllTypes" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -346,15 +340,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns an error, to test error handling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwError" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwError" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -366,15 +358,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Responds with an error from an async void function. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwErrorFromVoid" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwErrorFromVoid" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -386,14 +376,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoInt" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); @@ -407,14 +396,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoDouble" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); @@ -428,14 +416,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed in boolean. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoBool" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); @@ -449,14 +436,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -470,15 +456,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed in Uint8List. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoUint8List" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -492,14 +476,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed in generic Object. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoObject" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoObject" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -513,14 +496,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed list, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoList" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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_aList = GetNullableObjectAtIndex(args, 0); @@ -534,14 +516,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed map, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoMap" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -555,15 +536,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAllNullableTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAllNullableTypes" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -578,15 +557,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; AllNullableTypesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); @@ -601,21 +578,18 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; - AllNullableTypesWrapper *output = - [api createNestedObjectWithNullableString:arg_nullableString error:&error]; + AllNullableTypesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -624,26 +598,20 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns passed in arguments of multiple types. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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 { @@ -652,15 +620,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableInt" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -674,15 +640,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableDouble" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -696,15 +660,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed in boolean. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableBool" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -718,15 +680,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -740,21 +700,18 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed in Uint8List. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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 { @@ -763,15 +720,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed in generic Object. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableObject" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableObject" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -785,15 +740,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed list, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableList" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -807,15 +760,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed map, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableMap" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -830,15 +781,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.noopAsync" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.noopAsync" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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)); @@ -850,22 +799,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns passed in int asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncInt" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [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]; @@ -873,22 +819,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns passed in double asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncDouble" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [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]; @@ -896,22 +839,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed in boolean asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncBool" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [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]; @@ -919,22 +859,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed string asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -942,23 +879,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed in Uint8List asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncUint8List" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -966,22 +899,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed in generic Object asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncObject" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncObject" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -989,22 +919,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed list, to test serialization and deserialization asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncList" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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_aList = GetNullableObjectAtIndex(args, 0); - [api echoAsyncList:arg_aList - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncList:arg_aList completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1012,23 +939,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed map, to test serialization and deserialization asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncMap" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1036,15 +959,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Responds with an error from an async function returning a value. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncError" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncError" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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)); @@ -1056,15 +977,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Responds with an error from an async void function. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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)); @@ -1076,22 +995,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed object, to test async serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncAllTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncAllTypes" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1099,24 +1015,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - @"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1124,22 +1035,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns passed in int asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableInt" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1147,22 +1055,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns passed in double asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1170,22 +1075,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed in boolean asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1193,22 +1095,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed string asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1216,23 +1115,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed in Uint8List asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1240,22 +1135,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed in generic Object asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1263,22 +1155,19 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed list, to test serialization and deserialization asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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_aList = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableList:arg_aList - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableList:arg_aList completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1286,38 +1175,32 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } /// Returns the passed map, to test serialization and deserialization asynchronously. { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableMap" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterNoop" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterNoop" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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)); @@ -1328,18 +1211,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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)); }]; }]; @@ -1348,15 +1228,13 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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)); @@ -1367,369 +1245,306 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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: - @"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoBool" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoInt" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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_aList = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoUint8List:arg_aList - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoUint8List:arg_aList completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoList" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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_aList = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoList:arg_aList - completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoList:arg_aList completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoMap" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableDouble" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableDouble" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableString" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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: - @"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableUint8List" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableUint8List" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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_aList = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableUint8List:arg_aList - completion:^(FlutterStandardTypedData *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableUint8List:arg_aList completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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_aList = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableList:arg_aList - completion:^(NSArray *_Nullable output, - FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableList:arg_aList completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap" + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1741,13 +1556,13 @@ @interface FlutterIntegrationCoreApiCodecReader : FlutterStandardReader @implementation FlutterIntegrationCoreApiCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: + case 128: return [AllNullableTypes fromList:[self readValue]]; - case 129: + case 129: return [AllNullableTypesWrapper fromList:[self readValue]]; - case 130: + case 130: return [AllTypes fromList:[self readValue]]; - case 131: + case 131: return [TestMessage fromList:[self readValue]]; default: return [super readValueOfType:type]; @@ -1792,8 +1607,7 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - FlutterIntegrationCoreApiCodecReaderWriter *readerWriter = - [[FlutterIntegrationCoreApiCodecReaderWriter alloc] init]; + FlutterIntegrationCoreApiCodecReaderWriter *readerWriter = [[FlutterIntegrationCoreApiCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; @@ -1813,273 +1627,243 @@ - (instancetype)initWithBinaryMessenger:(NSObject *)bina return self; } - (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.noop" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:nil - reply:^(id reply) { - completion(nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil reply:^(id reply) { + completion(nil); + }]; } - (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.throwError" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:nil - reply:^(id reply) { - id output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil reply:^(id reply) { + id output = reply; + completion(output, nil); + }]; } - (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.throwErrorFromVoid" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:nil - reply:^(id reply) { - completion(nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil reply:^(id reply) { + completion(nil); + }]; } -- (void)echoAllTypes:(AllTypes *)arg_everything - completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoAllTypes:(AllTypes *)arg_everything completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllTypes" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] - reply:^(id reply) { - AllTypes *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(id reply) { + AllTypes *output = reply; + completion(output, nil); + }]; } -- (void)echoAllNullableTypes:(AllNullableTypes *)arg_everything - completion: - (void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoAllNullableTypes:(AllNullableTypes *)arg_everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_everything ?: [NSNull null] ] - reply:^(id reply) { - AllNullableTypes *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(id reply) { + AllNullableTypes *output = reply; + completion(output, nil); + }]; } -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool - anInt:(nullable NSNumber *)arg_aNullableInt - aString:(nullable NSString *)arg_aNullableString - completion:(void (^)(AllNullableTypes *_Nullable, - FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName: - @"dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ - arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], - arg_aNullableString ?: [NSNull null] - ] - reply:^(id reply) { - AllNullableTypes *output = reply; - completion(output, nil); - }]; +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool anInt:(nullable NSNumber *)arg_aNullableInt aString:(nullable NSString *)arg_aNullableString completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], arg_aNullableString ?: [NSNull null]] reply:^(id reply) { + AllNullableTypes *output = reply; + completion(output, nil); + }]; } -- (void)echoBool:(NSNumber *)arg_aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoBool:(NSNumber *)arg_aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoBool" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] - reply:^(id reply) { - NSNumber *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aBool ?: [NSNull null]] reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; } -- (void)echoInt:(NSNumber *)arg_anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoInt:(NSNumber *)arg_anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoInt" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] - reply:^(id reply) { - NSNumber *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_anInt ?: [NSNull null]] reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; } -- (void)echoDouble:(NSNumber *)arg_aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoDouble:(NSNumber *)arg_aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoDouble" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] - reply:^(id reply) { - NSNumber *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aDouble ?: [NSNull null]] reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; } -- (void)echoString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoString" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(id reply) { - NSString *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(id reply) { + NSString *output = reply; + completion(output, nil); + }]; } -- (void)echoUint8List:(FlutterStandardTypedData *)arg_aList - completion: - (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoUint8List:(FlutterStandardTypedData *)arg_aList completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoUint8List" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aList ?: [NSNull null] ] - reply:^(id reply) { - FlutterStandardTypedData *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aList ?: [NSNull null]] reply:^(id reply) { + FlutterStandardTypedData *output = reply; + completion(output, nil); + }]; } -- (void)echoList:(NSArray *)arg_aList - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoList:(NSArray *)arg_aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoList" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aList ?: [NSNull null] ] - reply:^(id reply) { - NSArray *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aList ?: [NSNull null]] reply:^(id reply) { + NSArray *output = reply; + completion(output, nil); + }]; } -- (void)echoMap:(NSDictionary *)arg_aMap - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoMap:(NSDictionary *)arg_aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoMap" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] - reply:^(id reply) { - NSDictionary *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aMap ?: [NSNull null]] reply:^(id reply) { + NSDictionary *output = reply; + completion(output, nil); + }]; } -- (void)echoNullableBool:(nullable NSNumber *)arg_aBool - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoNullableBool:(nullable NSNumber *)arg_aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] - reply:^(id reply) { - NSNumber *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aBool ?: [NSNull null]] reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; } -- (void)echoNullableInt:(nullable NSNumber *)arg_anInt - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoNullableInt:(nullable NSNumber *)arg_anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableInt" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] - reply:^(id reply) { - NSNumber *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_anInt ?: [NSNull null]] reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; } -- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble - completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] - reply:^(id reply) { - NSNumber *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aDouble ?: [NSNull null]] reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; } -- (void)echoNullableString:(nullable NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoNullableString:(nullable NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(id reply) { - NSString *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(id reply) { + NSString *output = reply; + completion(output, nil); + }]; } -- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_aList - completion:(void (^)(FlutterStandardTypedData *_Nullable, - FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_aList completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aList ?: [NSNull null] ] - reply:^(id reply) { - FlutterStandardTypedData *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aList ?: [NSNull null]] reply:^(id reply) { + FlutterStandardTypedData *output = reply; + completion(output, nil); + }]; } -- (void)echoNullableList:(nullable NSArray *)arg_aList - completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoNullableList:(nullable NSArray *)arg_aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aList ?: [NSNull null] ] - reply:^(id reply) { - NSArray *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aList ?: [NSNull null]] reply:^(id reply) { + NSArray *output = reply; + completion(output, nil); + }]; } -- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableMap" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] - reply:^(id reply) { - NSDictionary *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aMap ?: [NSNull null]] reply:^(id reply) { + NSDictionary *output = reply; + completion(output, nil); + }]; } - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:nil - reply:^(id reply) { - completion(nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil reply:^(id reply) { + completion(nil); + }]; } -- (void)echoAsyncString:(NSString *)arg_aString - completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoAsyncString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[ arg_aString ?: [NSNull null] ] - reply:^(id reply) { - NSString *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(id reply) { + NSString *output = reply; + completion(output, nil); + }]; } @end @@ -2089,16 +1873,15 @@ - (void)echoAsyncString:(NSString *)arg_aString return sSharedObject; } -void HostTrivialApiSetup(id binaryMessenger, - NSObject *api) { +void HostTrivialApiSetup(id binaryMessenger, NSObject *api) { { FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] initWithName:@"dev.flutter.pigeon.HostTrivialApi.noop" - binaryMessenger:binaryMessenger - codec:HostTrivialApiGetCodec()]; + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostTrivialApi.noop" + binaryMessenger:binaryMessenger + codec:HostTrivialApiGetCodec()]; 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]; @@ -2118,19 +1901,18 @@ void HostTrivialApiSetup(id binaryMessenger, void HostSmallApiSetup(id binaryMessenger, NSObject *api) { { FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] initWithName:@"dev.flutter.pigeon.HostSmallApi.echo" - binaryMessenger:binaryMessenger - codec:HostSmallApiGetCodec()]; + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostSmallApi.echo" + binaryMessenger:binaryMessenger + codec:HostSmallApiGetCodec()]; 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]; @@ -2138,13 +1920,12 @@ void HostSmallApiSetup(id binaryMessenger, NSObject *)bina } return self; } -- (void)echoWrappedList:(TestMessage *)arg_msg - completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel +- (void)echoWrappedList:(TestMessage *)arg_msg completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterSmallApi.echoWrappedList" - binaryMessenger:self.binaryMessenger - codec:FlutterSmallApiGetCodec()]; - [channel sendMessage:@[ arg_msg ?: [NSNull null] ] - reply:^(id reply) { - TestMessage *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterSmallApiGetCodec()]; + [channel sendMessage:@[arg_msg ?: [NSNull null]] reply:^(id reply) { + TestMessage *output = reply; + completion(output, nil); + }]; } @end + 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 a4f08bc5f3e..61ec8c13b21 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 @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// +// // Autogenerated from Pigeon (v9.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import @@ -167,12 +167,11 @@ class AllNullableTypes { aNullableList: result[7] as List?, aNullableMap: result[8] as Map?, nullableNestedList: (result[9] as List?)?.cast?>(), - nullableMapWithAnnotations: - (result[10] as Map?)?.cast(), - nullableMapWithObject: - (result[11] as Map?)?.cast(), - aNullableEnum: - result[12] != null ? AnEnum.values[result[12]! as int] : null, + nullableMapWithAnnotations: (result[10] as Map?)?.cast(), + nullableMapWithObject: (result[11] as Map?)?.cast(), + aNullableEnum: result[12] != null + ? AnEnum.values[result[12]! as int] + : null, aNullableString: result[13] as String?, ); } @@ -245,13 +244,13 @@ class _HostIntegrationCoreApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return AllNullableTypes.decode(readValue(buffer)!); - case 129: + case 129: return AllNullableTypesWrapper.decode(readValue(buffer)!); - case 130: + case 130: return AllTypes.decode(readValue(buffer)!); - case 131: + case 131: return TestMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -277,7 +276,8 @@ class HostIntegrationCoreApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.noop', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -327,7 +327,8 @@ class HostIntegrationCoreApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.throwError', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -349,7 +350,8 @@ class HostIntegrationCoreApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.throwErrorFromVoid', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -591,8 +593,7 @@ class HostIntegrationCoreApi { } /// Returns the passed object, to test serialization and deserialization. - Future echoAllNullableTypes( - AllNullableTypes? arg_everything) async { + Future echoAllNullableTypes(AllNullableTypes? arg_everything) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAllNullableTypes', codec, binaryMessenger: _binaryMessenger); @@ -616,11 +617,9 @@ class HostIntegrationCoreApi { /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. - Future extractNestedNullableString( - AllNullableTypesWrapper arg_wrapper) async { + Future extractNestedNullableString(AllNullableTypesWrapper arg_wrapper) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_wrapper]) as List?; @@ -642,11 +641,9 @@ class HostIntegrationCoreApi { /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. - Future createNestedNullableString( - String? arg_nullableString) async { + Future createNestedNullableString(String? arg_nullableString) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_nullableString]) as List?; @@ -672,15 +669,12 @@ class HostIntegrationCoreApi { } /// Returns passed in arguments of multiple types. - Future sendMultipleNullableTypes(bool? arg_aNullableBool, - int? arg_aNullableInt, String? arg_aNullableString) async { + Future sendMultipleNullableTypes(bool? arg_aNullableBool, int? arg_aNullableInt, String? arg_aNullableString) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send( - [arg_aNullableBool, arg_aNullableInt, arg_aNullableString]) - as List?; + final List? replyList = + await channel.send([arg_aNullableBool, arg_aNullableInt, arg_aNullableString]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -795,11 +789,9 @@ class HostIntegrationCoreApi { } /// Returns the passed in Uint8List. - Future echoNullableUint8List( - Uint8List? arg_aNullableUint8List) async { + Future echoNullableUint8List(Uint8List? arg_aNullableUint8List) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aNullableUint8List]) as List?; @@ -843,8 +835,7 @@ class HostIntegrationCoreApi { } /// Returns the passed list, to test serialization and deserialization. - Future?> echoNullableList( - List? arg_aNullableList) async { + Future?> echoNullableList(List? arg_aNullableList) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableList', codec, binaryMessenger: _binaryMessenger); @@ -867,8 +858,7 @@ class HostIntegrationCoreApi { } /// Returns the passed map, to test serialization and deserialization. - Future?> echoNullableMap( - Map? arg_aNullableMap) async { + Future?> echoNullableMap(Map? arg_aNullableMap) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableMap', codec, binaryMessenger: _binaryMessenger); @@ -896,7 +886,8 @@ class HostIntegrationCoreApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.noopAsync', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1110,8 +1101,7 @@ class HostIntegrationCoreApi { } /// Returns the passed map, to test serialization and deserialization asynchronously. - Future> echoAsyncMap( - Map arg_aMap) async { + Future> echoAsyncMap(Map arg_aMap) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncMap', codec, binaryMessenger: _binaryMessenger); @@ -1143,7 +1133,8 @@ class HostIntegrationCoreApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncError', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1163,10 +1154,10 @@ class HostIntegrationCoreApi { /// Responds with an error from an async void function. Future throwAsyncErrorFromVoid() async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1212,11 +1203,9 @@ class HostIntegrationCoreApi { } /// Returns the passed object, to test serialization and deserialization. - Future echoAsyncNullableAllNullableTypes( - AllNullableTypes? arg_everything) async { + Future echoAsyncNullableAllNullableTypes(AllNullableTypes? arg_everything) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_everything]) as List?; @@ -1262,8 +1251,7 @@ class HostIntegrationCoreApi { /// Returns passed in double asynchronously. Future echoAsyncNullableDouble(double? arg_aDouble) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aDouble]) as List?; @@ -1286,8 +1274,7 @@ class HostIntegrationCoreApi { /// Returns the passed in boolean asynchronously. Future echoAsyncNullableBool(bool? arg_aBool) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aBool]) as List?; @@ -1310,8 +1297,7 @@ class HostIntegrationCoreApi { /// Returns the passed string asynchronously. Future echoAsyncNullableString(String? arg_aString) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aString]) as List?; @@ -1332,11 +1318,9 @@ class HostIntegrationCoreApi { } /// Returns the passed in Uint8List asynchronously. - Future echoAsyncNullableUint8List( - Uint8List? arg_aUint8List) async { + Future echoAsyncNullableUint8List(Uint8List? arg_aUint8List) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aUint8List]) as List?; @@ -1359,8 +1343,7 @@ class HostIntegrationCoreApi { /// Returns the passed in generic Object asynchronously. Future echoAsyncNullableObject(Object? arg_anObject) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_anObject]) as List?; @@ -1383,8 +1366,7 @@ class HostIntegrationCoreApi { /// Returns the passed list, to test serialization and deserialization asynchronously. Future?> echoAsyncNullableList(List? arg_aList) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aList]) as List?; @@ -1405,8 +1387,7 @@ class HostIntegrationCoreApi { } /// Returns the passed map, to test serialization and deserialization asynchronously. - Future?> echoAsyncNullableMap( - Map? arg_aMap) async { + Future?> echoAsyncNullableMap(Map? arg_aMap) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableMap', codec, binaryMessenger: _binaryMessenger); @@ -1432,7 +1413,8 @@ class HostIntegrationCoreApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterNoop', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1451,10 +1433,10 @@ class HostIntegrationCoreApi { Future callFlutterThrowError() async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1473,10 +1455,10 @@ class HostIntegrationCoreApi { Future callFlutterThrowErrorFromVoid() async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1495,8 +1477,7 @@ class HostIntegrationCoreApi { Future callFlutterEchoAllTypes(AllTypes arg_everything) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_everything]) as List?; @@ -1521,17 +1502,12 @@ class HostIntegrationCoreApi { } } - Future callFlutterSendMultipleNullableTypes( - bool? arg_aNullableBool, - int? arg_aNullableInt, - String? arg_aNullableString) async { + Future callFlutterSendMultipleNullableTypes(bool? arg_aNullableBool, int? arg_aNullableInt, String? arg_aNullableString) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send( - [arg_aNullableBool, arg_aNullableInt, arg_aNullableString]) - as List?; + final List? replyList = + await channel.send([arg_aNullableBool, arg_aNullableInt, arg_aNullableString]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1609,8 +1585,7 @@ class HostIntegrationCoreApi { Future callFlutterEchoDouble(double arg_aDouble) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aDouble]) as List?; @@ -1637,8 +1612,7 @@ class HostIntegrationCoreApi { Future callFlutterEchoString(String arg_aString) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aString]) as List?; @@ -1665,8 +1639,7 @@ class HostIntegrationCoreApi { Future callFlutterEchoUint8List(Uint8List arg_aList) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aList]) as List?; @@ -1718,8 +1691,7 @@ class HostIntegrationCoreApi { } } - Future> callFlutterEchoMap( - Map arg_aMap) async { + Future> callFlutterEchoMap(Map arg_aMap) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoMap', codec, binaryMessenger: _binaryMessenger); @@ -1748,8 +1720,7 @@ class HostIntegrationCoreApi { Future callFlutterEchoNullableBool(bool? arg_aBool) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aBool]) as List?; @@ -1771,8 +1742,7 @@ class HostIntegrationCoreApi { Future callFlutterEchoNullableInt(int? arg_anInt) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_anInt]) as List?; @@ -1794,8 +1764,7 @@ class HostIntegrationCoreApi { Future callFlutterEchoNullableDouble(double? arg_aDouble) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableDouble', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableDouble', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aDouble]) as List?; @@ -1817,8 +1786,7 @@ class HostIntegrationCoreApi { Future callFlutterEchoNullableString(String? arg_aString) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableString', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableString', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aString]) as List?; @@ -1838,11 +1806,9 @@ class HostIntegrationCoreApi { } } - Future callFlutterEchoNullableUint8List( - Uint8List? arg_aList) async { + Future callFlutterEchoNullableUint8List(Uint8List? arg_aList) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableUint8List', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableUint8List', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aList]) as List?; @@ -1862,11 +1828,9 @@ class HostIntegrationCoreApi { } } - Future?> callFlutterEchoNullableList( - List? arg_aList) async { + Future?> callFlutterEchoNullableList(List? arg_aList) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aList]) as List?; @@ -1886,11 +1850,9 @@ class HostIntegrationCoreApi { } } - Future?> callFlutterEchoNullableMap( - Map? arg_aMap) async { + Future?> callFlutterEchoNullableMap(Map? arg_aMap) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap', - codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aMap]) as List?; @@ -1935,13 +1897,13 @@ class _FlutterIntegrationCoreApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return AllNullableTypes.decode(readValue(buffer)!); - case 129: + case 129: return AllNullableTypesWrapper.decode(readValue(buffer)!); - case 130: + case 130: return AllTypes.decode(readValue(buffer)!); - case 131: + case 131: return TestMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1973,8 +1935,7 @@ 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 boolean, to test serialization and deserialization. bool echoBool(bool aBool); @@ -2025,8 +1986,7 @@ abstract class FlutterIntegrationCoreApi { /// Returns the passed in generic Object asynchronously. Future echoAsyncString(String aString); - static void setup(FlutterIntegrationCoreApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(FlutterIntegrationCoreApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FlutterIntegrationCoreApi.noop', codec, @@ -2057,8 +2017,7 @@ abstract class FlutterIntegrationCoreApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FlutterIntegrationCoreApi.throwErrorFromVoid', - codec, + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.throwErrorFromVoid', codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); @@ -2079,7 +2038,7 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllTypes was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllTypes was null.'); final List args = (message as List?)!; final AllTypes? arg_everything = (args[0] as AllTypes?); assert(arg_everything != null, @@ -2091,43 +2050,38 @@ abstract class FlutterIntegrationCoreApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes', - codec, + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes', codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes was null.'); + 'Argument for dev.flutter.pigeon.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?); assert(arg_everything != null, 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes was null, expected non-null AllNullableTypes.'); - final AllNullableTypes output = - api.echoAllNullableTypes(arg_everything!); + final AllNullableTypes output = api.echoAllNullableTypes(arg_everything!); return output; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes', - codec, + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes', codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes was null.'); + 'Argument for dev.flutter.pigeon.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?); - final AllNullableTypes output = api.sendMultipleNullableTypes( - arg_aNullableBool, arg_aNullableInt, arg_aNullableString); + final AllNullableTypes output = api.sendMultipleNullableTypes(arg_aNullableBool, arg_aNullableInt, arg_aNullableString); return output; }); } @@ -2141,7 +2095,7 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoBool was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoBool was null.'); final List args = (message as List?)!; final bool? arg_aBool = (args[0] as bool?); assert(arg_aBool != null, @@ -2160,7 +2114,7 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoInt was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoInt was null.'); final List args = (message as List?)!; final int? arg_anInt = (args[0] as int?); assert(arg_anInt != null, @@ -2179,7 +2133,7 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoDouble was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoDouble was null.'); final List args = (message as List?)!; final double? arg_aDouble = (args[0] as double?); assert(arg_aDouble != null, @@ -2198,7 +2152,7 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoString was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoString was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); assert(arg_aString != null, @@ -2217,7 +2171,7 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoUint8List was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoUint8List was null.'); final List args = (message as List?)!; final Uint8List? arg_aList = (args[0] as Uint8List?); assert(arg_aList != null, @@ -2236,10 +2190,9 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoList was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoList was null.'); final List args = (message as List?)!; - final List? arg_aList = - (args[0] as List?)?.cast(); + final List? arg_aList = (args[0] as List?)?.cast(); assert(arg_aList != null, 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoList was null, expected non-null List.'); final List output = api.echoList(arg_aList!); @@ -2256,10 +2209,9 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoMap was null.'); + 'Argument for dev.flutter.pigeon.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.FlutterIntegrationCoreApi.echoMap was null, expected non-null Map.'); final Map output = api.echoMap(arg_aMap!); @@ -2269,15 +2221,14 @@ abstract class FlutterIntegrationCoreApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool', - codec, + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool', codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool was null.'); final List args = (message as List?)!; final bool? arg_aBool = (args[0] as bool?); final bool? output = api.echoNullableBool(arg_aBool); @@ -2294,7 +2245,7 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableInt was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableInt was null.'); final List args = (message as List?)!; final int? arg_anInt = (args[0] as int?); final int? output = api.echoNullableInt(arg_anInt); @@ -2304,15 +2255,14 @@ abstract class FlutterIntegrationCoreApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble', - codec, + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble', codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble was null.'); final List args = (message as List?)!; final double? arg_aDouble = (args[0] as double?); final double? output = api.echoNullableDouble(arg_aDouble); @@ -2322,15 +2272,14 @@ abstract class FlutterIntegrationCoreApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString', - codec, + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString', codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); final String? output = api.echoNullableString(arg_aString); @@ -2340,15 +2289,14 @@ abstract class FlutterIntegrationCoreApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List', - codec, + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List', codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List was null.'); final List args = (message as List?)!; final Uint8List? arg_aList = (args[0] as Uint8List?); final Uint8List? output = api.echoNullableUint8List(arg_aList); @@ -2358,18 +2306,16 @@ abstract class FlutterIntegrationCoreApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList', - codec, + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList', codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList was null.'); final List args = (message as List?)!; - final List? arg_aList = - (args[0] as List?)?.cast(); + final List? arg_aList = (args[0] as List?)?.cast(); final List? output = api.echoNullableList(arg_aList); return output; }); @@ -2384,10 +2330,9 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableMap was null.'); + 'Argument for dev.flutter.pigeon.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(); final Map? output = api.echoNullableMap(arg_aMap); return output; }); @@ -2416,7 +2361,7 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); assert(arg_aString != null, @@ -2444,7 +2389,8 @@ class HostTrivialApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostTrivialApi.noop', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2504,7 +2450,8 @@ class HostSmallApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostSmallApi.voidVoid', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2537,7 +2484,7 @@ class _FlutterSmallApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return TestMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2561,7 +2508,7 @@ abstract class FlutterSmallApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterSmallApi.echoWrappedList was null.'); + 'Argument for dev.flutter.pigeon.FlutterSmallApi.echoWrappedList was null.'); final List args = (message as List?)!; final TestMessage? arg_msg = (args[0] as TestMessage?); assert(arg_msg != null, 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 d390add4913..94350e81b5e 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 @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// +// // Autogenerated from Pigeon (v9.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -36,38 +36,20 @@ void AllTypes::set_an_int(int64_t value_arg) { an_int_ = 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_; -} -void AllTypes::set_a_byte_array(const std::vector& value_arg) { - a_byte_array_ = value_arg; -} +const std::vector& AllTypes::a_byte_array() const { return a_byte_array_; } +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_; -} -void AllTypes::set_a4_byte_array(const std::vector& value_arg) { - a4_byte_array_ = value_arg; -} +const std::vector& AllTypes::a4_byte_array() const { return a4_byte_array_; } +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_; -} -void AllTypes::set_a8_byte_array(const std::vector& value_arg) { - a8_byte_array_ = value_arg; -} +const std::vector& AllTypes::a8_byte_array() const { return a8_byte_array_; } +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_; -} -void AllTypes::set_a_float_array(const std::vector& value_arg) { - a_float_array_ = value_arg; -} +const std::vector& AllTypes::a_float_array() const { return a_float_array_; } +void AllTypes::set_a_float_array(const std::vector& value_arg) { a_float_array_ = value_arg; } const EncodableList& AllTypes::a_list() const { return a_list_; } -void AllTypes::set_a_list(const EncodableList& value_arg) { - a_list_ = value_arg; -} +void AllTypes::set_a_list(const EncodableList& value_arg) { a_list_ = value_arg; } const EncodableMap& AllTypes::a_map() const { return a_map_; } void AllTypes::set_a_map(const EncodableMap& value_arg) { a_map_ = value_arg; } @@ -76,9 +58,7 @@ 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_; } -void AllTypes::set_a_string(std::string_view value_arg) { - a_string_ = value_arg; -} +void AllTypes::set_a_string(std::string_view value_arg) { a_string_ = value_arg; } EncodableList AllTypes::ToEncodableList() const { EncodableList list; @@ -107,265 +87,119 @@ AllTypes::AllTypes(const EncodableList& list) { auto& encodable_an_int = list[1]; if (const int32_t* pointer_an_int = std::get_if(&encodable_an_int)) an_int_ = *pointer_an_int; - else if (const int64_t* pointer_an_int_64 = - std::get_if(&encodable_an_int)) + else if (const int64_t* pointer_an_int_64 = std::get_if(&encodable_an_int)) an_int_ = *pointer_an_int_64; auto& encodable_a_double = list[2]; - if (const double* pointer_a_double = - std::get_if(&encodable_a_double)) { + if (const double* pointer_a_double = std::get_if(&encodable_a_double)) { a_double_ = *pointer_a_double; } auto& encodable_a_byte_array = list[3]; - if (const std::vector* pointer_a_byte_array = - std::get_if>(&encodable_a_byte_array)) { + if (const std::vector* pointer_a_byte_array = std::get_if>(&encodable_a_byte_array)) { a_byte_array_ = *pointer_a_byte_array; } auto& encodable_a4_byte_array = list[4]; - if (const std::vector* pointer_a4_byte_array = - std::get_if>(&encodable_a4_byte_array)) { + if (const std::vector* pointer_a4_byte_array = std::get_if>(&encodable_a4_byte_array)) { a4_byte_array_ = *pointer_a4_byte_array; } auto& encodable_a8_byte_array = list[5]; - if (const std::vector* pointer_a8_byte_array = - std::get_if>(&encodable_a8_byte_array)) { + if (const std::vector* pointer_a8_byte_array = std::get_if>(&encodable_a8_byte_array)) { a8_byte_array_ = *pointer_a8_byte_array; } auto& encodable_a_float_array = list[6]; - if (const std::vector* pointer_a_float_array = - std::get_if>(&encodable_a_float_array)) { + if (const std::vector* pointer_a_float_array = std::get_if>(&encodable_a_float_array)) { a_float_array_ = *pointer_a_float_array; } auto& encodable_a_list = list[7]; - if (const EncodableList* pointer_a_list = - std::get_if(&encodable_a_list)) { + if (const EncodableList* pointer_a_list = std::get_if(&encodable_a_list)) { a_list_ = *pointer_a_list; } auto& encodable_a_map = list[8]; - if (const EncodableMap* pointer_a_map = - std::get_if(&encodable_a_map)) { + if (const EncodableMap* pointer_a_map = std::get_if(&encodable_a_map)) { a_map_ = *pointer_a_map; } auto& encodable_an_enum = list[9]; - if (const int32_t* pointer_an_enum = std::get_if(&encodable_an_enum)) - an_enum_ = (AnEnum)*pointer_an_enum; + if (const int32_t* pointer_an_enum = std::get_if(&encodable_an_enum)) an_enum_ = (AnEnum)*pointer_an_enum; auto& encodable_a_string = list[10]; - if (const std::string* pointer_a_string = - std::get_if(&encodable_a_string)) { + if (const std::string* pointer_a_string = std::get_if(&encodable_a_string)) { a_string_ = *pointer_a_string; } } // AllNullableTypes -const bool* AllNullableTypes::a_nullable_bool() const { - return a_nullable_bool_ ? &(*a_nullable_bool_) : nullptr; -} -void AllNullableTypes::set_a_nullable_bool(const bool* value_arg) { - a_nullable_bool_ = value_arg ? std::optional(*value_arg) : std::nullopt; -} -void AllNullableTypes::set_a_nullable_bool(bool value_arg) { - a_nullable_bool_ = value_arg; -} +const bool* AllNullableTypes::a_nullable_bool() const { return a_nullable_bool_ ? &(*a_nullable_bool_) : nullptr; } +void AllNullableTypes::set_a_nullable_bool(const bool* value_arg) { a_nullable_bool_ = value_arg ? std::optional(*value_arg) : std::nullopt; } +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; -} -void AllNullableTypes::set_a_nullable_int(int64_t value_arg) { - a_nullable_int_ = 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; } +void AllNullableTypes::set_a_nullable_int(int64_t value_arg) { a_nullable_int_ = 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; -} -void AllNullableTypes::set_a_nullable_double(double value_arg) { - a_nullable_double_ = 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; } +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; -} +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; } -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; -} +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; } -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; -} +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; } -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; -} +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; } -const EncodableList* AllNullableTypes::a_nullable_list() const { - return a_nullable_list_ ? &(*a_nullable_list_) : nullptr; -} -void AllNullableTypes::set_a_nullable_list(const EncodableList* value_arg) { - a_nullable_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} -void AllNullableTypes::set_a_nullable_list(const EncodableList& value_arg) { - a_nullable_list_ = value_arg; -} +const EncodableList* AllNullableTypes::a_nullable_list() const { return a_nullable_list_ ? &(*a_nullable_list_) : nullptr; } +void AllNullableTypes::set_a_nullable_list(const EncodableList* value_arg) { a_nullable_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } +void AllNullableTypes::set_a_nullable_list(const EncodableList& value_arg) { a_nullable_list_ = value_arg; } -const EncodableMap* AllNullableTypes::a_nullable_map() const { - return a_nullable_map_ ? &(*a_nullable_map_) : nullptr; -} -void AllNullableTypes::set_a_nullable_map(const EncodableMap* value_arg) { - a_nullable_map_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} -void AllNullableTypes::set_a_nullable_map(const EncodableMap& value_arg) { - a_nullable_map_ = value_arg; -} +const EncodableMap* AllNullableTypes::a_nullable_map() const { return a_nullable_map_ ? &(*a_nullable_map_) : nullptr; } +void AllNullableTypes::set_a_nullable_map(const EncodableMap* value_arg) { a_nullable_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; } +void AllNullableTypes::set_a_nullable_map(const EncodableMap& value_arg) { a_nullable_map_ = 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; -} +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; } -const EncodableMap* AllNullableTypes::nullable_map_with_annotations() const { - 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; -} +const EncodableMap* AllNullableTypes::nullable_map_with_annotations() const { 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; } -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; -} +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; } -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; -} -void AllNullableTypes::set_a_nullable_enum(const AnEnum& value_arg) { - a_nullable_enum_ = 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; } +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(std::string_view value_arg) { - a_nullable_string_ = 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(std::string_view value_arg) { a_nullable_string_ = value_arg; } EncodableList AllNullableTypes::ToEncodableList() const { EncodableList list; list.reserve(14); - 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_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(a_nullable_list_ ? EncodableValue(*a_nullable_list_) - : EncodableValue()); - list.push_back(a_nullable_map_ ? EncodableValue(*a_nullable_map_) - : 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_ ? EncodableValue((int)(*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_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(a_nullable_list_ ? EncodableValue(*a_nullable_list_) : EncodableValue()); + list.push_back(a_nullable_map_ ? EncodableValue(*a_nullable_map_) : 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_ ? EncodableValue((int)(*a_nullable_enum_)) : EncodableValue()); + list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_) : EncodableValue()); return list; } @@ -373,88 +207,66 @@ AllNullableTypes::AllNullableTypes() {} AllNullableTypes::AllNullableTypes(const EncodableList& list) { auto& encodable_a_nullable_bool = list[0]; - if (const bool* pointer_a_nullable_bool = - std::get_if(&encodable_a_nullable_bool)) { + if (const bool* pointer_a_nullable_bool = std::get_if(&encodable_a_nullable_bool)) { a_nullable_bool_ = *pointer_a_nullable_bool; } auto& encodable_a_nullable_int = list[1]; - if (const int32_t* pointer_a_nullable_int = - std::get_if(&encodable_a_nullable_int)) + if (const int32_t* pointer_a_nullable_int = std::get_if(&encodable_a_nullable_int)) a_nullable_int_ = *pointer_a_nullable_int; - else if (const int64_t* pointer_a_nullable_int_64 = - std::get_if(&encodable_a_nullable_int)) + else if (const int64_t* pointer_a_nullable_int_64 = std::get_if(&encodable_a_nullable_int)) a_nullable_int_ = *pointer_a_nullable_int_64; auto& encodable_a_nullable_double = list[2]; - if (const double* pointer_a_nullable_double = - std::get_if(&encodable_a_nullable_double)) { + if (const double* pointer_a_nullable_double = std::get_if(&encodable_a_nullable_double)) { a_nullable_double_ = *pointer_a_nullable_double; } auto& encodable_a_nullable_byte_array = list[3]; - if (const std::vector* pointer_a_nullable_byte_array = - std::get_if>(&encodable_a_nullable_byte_array)) { + if (const std::vector* pointer_a_nullable_byte_array = std::get_if>(&encodable_a_nullable_byte_array)) { a_nullable_byte_array_ = *pointer_a_nullable_byte_array; } auto& encodable_a_nullable4_byte_array = list[4]; - if (const std::vector* pointer_a_nullable4_byte_array = - std::get_if>( - &encodable_a_nullable4_byte_array)) { + if (const std::vector* pointer_a_nullable4_byte_array = std::get_if>(&encodable_a_nullable4_byte_array)) { a_nullable4_byte_array_ = *pointer_a_nullable4_byte_array; } auto& encodable_a_nullable8_byte_array = list[5]; - if (const std::vector* pointer_a_nullable8_byte_array = - std::get_if>( - &encodable_a_nullable8_byte_array)) { + if (const std::vector* pointer_a_nullable8_byte_array = std::get_if>(&encodable_a_nullable8_byte_array)) { a_nullable8_byte_array_ = *pointer_a_nullable8_byte_array; } auto& encodable_a_nullable_float_array = list[6]; - if (const std::vector* pointer_a_nullable_float_array = - std::get_if>(&encodable_a_nullable_float_array)) { + if (const std::vector* pointer_a_nullable_float_array = std::get_if>(&encodable_a_nullable_float_array)) { a_nullable_float_array_ = *pointer_a_nullable_float_array; } auto& encodable_a_nullable_list = list[7]; - if (const EncodableList* pointer_a_nullable_list = - std::get_if(&encodable_a_nullable_list)) { + if (const EncodableList* pointer_a_nullable_list = std::get_if(&encodable_a_nullable_list)) { a_nullable_list_ = *pointer_a_nullable_list; } auto& encodable_a_nullable_map = list[8]; - if (const EncodableMap* pointer_a_nullable_map = - std::get_if(&encodable_a_nullable_map)) { + if (const EncodableMap* pointer_a_nullable_map = std::get_if(&encodable_a_nullable_map)) { a_nullable_map_ = *pointer_a_nullable_map; } auto& encodable_nullable_nested_list = list[9]; - if (const EncodableList* pointer_nullable_nested_list = - std::get_if(&encodable_nullable_nested_list)) { + if (const EncodableList* pointer_nullable_nested_list = std::get_if(&encodable_nullable_nested_list)) { nullable_nested_list_ = *pointer_nullable_nested_list; } auto& encodable_nullable_map_with_annotations = list[10]; - if (const EncodableMap* pointer_nullable_map_with_annotations = - std::get_if(&encodable_nullable_map_with_annotations)) { + if (const EncodableMap* pointer_nullable_map_with_annotations = std::get_if(&encodable_nullable_map_with_annotations)) { nullable_map_with_annotations_ = *pointer_nullable_map_with_annotations; } auto& encodable_nullable_map_with_object = list[11]; - if (const EncodableMap* pointer_nullable_map_with_object = - std::get_if(&encodable_nullable_map_with_object)) { + if (const EncodableMap* pointer_nullable_map_with_object = std::get_if(&encodable_nullable_map_with_object)) { nullable_map_with_object_ = *pointer_nullable_map_with_object; } auto& encodable_a_nullable_enum = list[12]; - if (const int32_t* pointer_a_nullable_enum = - std::get_if(&encodable_a_nullable_enum)) - a_nullable_enum_ = (AnEnum)*pointer_a_nullable_enum; + if (const int32_t* pointer_a_nullable_enum = std::get_if(&encodable_a_nullable_enum)) a_nullable_enum_ = (AnEnum)*pointer_a_nullable_enum; auto& encodable_a_nullable_string = list[13]; - if (const std::string* pointer_a_nullable_string = - std::get_if(&encodable_a_nullable_string)) { + if (const std::string* pointer_a_nullable_string = std::get_if(&encodable_a_nullable_string)) { a_nullable_string_ = *pointer_a_nullable_string; } } // AllNullableTypesWrapper -const AllNullableTypes& AllNullableTypesWrapper::values() const { - return values_; -} -void AllNullableTypesWrapper::set_values(const AllNullableTypes& value_arg) { - values_ = value_arg; -} +const AllNullableTypes& AllNullableTypesWrapper::values() const { return values_; } +void AllNullableTypesWrapper::set_values(const AllNullableTypes& value_arg) { values_ = value_arg; } EncodableList AllNullableTypesWrapper::ToEncodableList() const { EncodableList list; @@ -467,24 +279,16 @@ AllNullableTypesWrapper::AllNullableTypesWrapper() {} AllNullableTypesWrapper::AllNullableTypesWrapper(const EncodableList& list) { auto& encodable_values = list[0]; - if (const EncodableList* pointer_values = - std::get_if(&encodable_values)) { + if (const EncodableList* pointer_values = std::get_if(&encodable_values)) { values_ = AllNullableTypes(*pointer_values); } } // TestMessage -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; -} -void TestMessage::set_test_list(const EncodableList& value_arg) { - test_list_ = value_arg; -} +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; } +void TestMessage::set_test_list(const EncodableList& value_arg) { test_list_ = value_arg; } EncodableList TestMessage::ToEncodableList() const { EncodableList list; @@ -497,67 +301,47 @@ TestMessage::TestMessage() {} TestMessage::TestMessage(const EncodableList& list) { auto& encodable_test_list = list[0]; - if (const EncodableList* pointer_test_list = - std::get_if(&encodable_test_list)) { + if (const EncodableList* pointer_test_list = std::get_if(&encodable_test_list)) { test_list_ = *pointer_test_list; } } -HostIntegrationCoreApiCodecSerializer::HostIntegrationCoreApiCodecSerializer() { -} -EncodableValue HostIntegrationCoreApiCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { +HostIntegrationCoreApiCodecSerializer::HostIntegrationCoreApiCodecSerializer() {} +EncodableValue HostIntegrationCoreApiCodecSerializer::ReadValueOfType(uint8_t type, flutter::ByteStreamReader* stream) const { switch (type) { case 128: - return CustomEncodableValue( - AllNullableTypes(std::get(ReadValue(stream)))); + return CustomEncodableValue(AllNullableTypes(std::get(ReadValue(stream)))); case 129: - return CustomEncodableValue( - AllNullableTypesWrapper(std::get(ReadValue(stream)))); + return CustomEncodableValue(AllNullableTypesWrapper(std::get(ReadValue(stream)))); case 130: - return CustomEncodableValue( - AllTypes(std::get(ReadValue(stream)))); + return CustomEncodableValue(AllTypes(std::get(ReadValue(stream)))); case 131: - return CustomEncodableValue( - TestMessage(std::get(ReadValue(stream)))); + return CustomEncodableValue(TestMessage(std::get(ReadValue(stream)))); default: return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } } -void HostIntegrationCoreApiCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = - std::get_if(&value)) { +void HostIntegrationCoreApiCodecSerializer::WriteValue(const EncodableValue& value, flutter::ByteStreamWriter* stream) const { + if (const CustomEncodableValue* custom_value = std::get_if(&value)) { if (custom_value->type() == typeid(AllNullableTypes)) { stream->WriteByte(128); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); + WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); return; } if (custom_value->type() == typeid(AllNullableTypesWrapper)) { 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(AllTypes)) { 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(TestMessage)) { stream->WriteByte(131); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); + WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); return; } } @@ -566,2913 +350,2169 @@ void HostIntegrationCoreApiCodecSerializer::WriteValue( /// The codec used by HostIntegrationCoreApi. const flutter::StandardMessageCodec& HostIntegrationCoreApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &HostIntegrationCoreApiCodecSerializer::GetInstance()); -} - -// Sets up an instance of `HostIntegrationCoreApi` to handle messages through -// the `binary_messenger`. -void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, - HostIntegrationCoreApi* api) { - { - auto channel = std::make_unique>( - binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.noop", - &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())); - } - }); + return flutter::StandardMessageCodec::GetInstance(&HostIntegrationCoreApiCodecSerializer::GetInstance()); +} + +// Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binary_messenger`. +void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, HostIntegrationCoreApi* api) { + { + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.noop", &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); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAllTypes", &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAllTypes", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.throwError", &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.throwError", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.throwErrorFromVoid", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.throwErrorFromVoid", &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); } } { - auto channel = std::make_unique>( - binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoInt", - &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoInt", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoDouble", &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoDouble", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoBool", - &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoBool", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoString", &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoString", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoUint8List", &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoUint8List", &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); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoObject", &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoObject", &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); } } { - auto channel = std::make_unique>( - binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoList", - &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_list_arg = args.at(0); - if (encodable_a_list_arg.IsNull()) { - reply(WrapError("a_list_arg unexpectedly null.")); - return; - } - const auto& a_list_arg = - std::get(encodable_a_list_arg); - ErrorOr output = api->EchoList(a_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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoList", &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_list_arg = args.at(0); + if (encodable_a_list_arg.IsNull()) { + reply(WrapError("a_list_arg unexpectedly null.")); + return; + } + const auto& a_list_arg = std::get(encodable_a_list_arg); + ErrorOr output = api->EchoList(a_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); } } { - auto channel = std::make_unique>( - binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoMap", - &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoMap", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAllNullableTypes", - &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 = - &(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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAllNullableTypes", &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 = &(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); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString", - &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString", - &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes", - &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableInt", - &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableInt", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableDouble", - &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableDouble", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableBool", - &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableBool", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableString", - &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableString", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List", - &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableObject", - &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableObject", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableList", - &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableList", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableMap", - &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())); - } - }); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableMap", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.noopAsync", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.noopAsync", &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 { + 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); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncInt", &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncInt", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncDouble", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncDouble", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncBool", &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncBool", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncString", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncString", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncUint8List", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncUint8List", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncObject", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncObject", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncList", &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_list_arg = args.at(0); - if (encodable_a_list_arg.IsNull()) { - reply(WrapError("a_list_arg unexpectedly null.")); - return; - } - const auto& a_list_arg = - std::get(encodable_a_list_arg); - api->EchoAsyncList( - a_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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncList", &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_list_arg = args.at(0); + if (encodable_a_list_arg.IsNull()) { + reply(WrapError("a_list_arg unexpectedly null.")); + return; + } + const auto& a_list_arg = std::get(encodable_a_list_arg); + api->EchoAsyncList(a_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); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncMap", &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncMap", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncError", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncError", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid", &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); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncAllTypes", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncAllTypes", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi." - "echoAsyncNullableAllNullableTypes", - &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 = - &(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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", &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 = &(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); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableInt", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableInt", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList", - &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_list_arg = args.at(0); - const auto* a_list_arg = - std::get_if(&encodable_a_list_arg); - api->EchoAsyncNullableList( - a_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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList", &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_list_arg = args.at(0); + const auto* a_list_arg = std::get_if(&encodable_a_list_arg); + api->EchoAsyncNullableList(a_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); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableMap", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableMap", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterNoop", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterNoop", &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); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi." - "callFlutterThrowErrorFromVoid", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", &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); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi." - "callFlutterSendMultipleNullableTypes", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoBool", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoBool", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoInt", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoInt", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List", - &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_list_arg = args.at(0); - if (encodable_a_list_arg.IsNull()) { - reply(WrapError("a_list_arg unexpectedly null.")); - return; - } - const auto& a_list_arg = - std::get>(encodable_a_list_arg); - api->CallFlutterEchoUint8List( - a_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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List", &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_list_arg = args.at(0); + if (encodable_a_list_arg.IsNull()) { + reply(WrapError("a_list_arg unexpectedly null.")); + return; + } + const auto& a_list_arg = std::get>(encodable_a_list_arg); + api->CallFlutterEchoUint8List(a_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); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoList", - &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_list_arg = args.at(0); - if (encodable_a_list_arg.IsNull()) { - reply(WrapError("a_list_arg unexpectedly null.")); - return; - } - const auto& a_list_arg = - std::get(encodable_a_list_arg); - api->CallFlutterEchoList( - a_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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoList", &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_list_arg = args.at(0); + if (encodable_a_list_arg.IsNull()) { + reply(WrapError("a_list_arg unexpectedly null.")); + return; + } + const auto& a_list_arg = std::get(encodable_a_list_arg); + api->CallFlutterEchoList(a_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); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoMap", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoMap", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi." - "callFlutterEchoNullableDouble", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableDouble", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi." - "callFlutterEchoNullableString", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableString", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi." - "callFlutterEchoNullableUint8List", - &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_list_arg = args.at(0); - const auto* a_list_arg = - std::get_if>(&encodable_a_list_arg); - api->CallFlutterEchoNullableUint8List( - a_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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableUint8List", &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_list_arg = args.at(0); + const auto* a_list_arg = std::get_if>(&encodable_a_list_arg); + api->CallFlutterEchoNullableUint8List(a_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); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList", - &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_list_arg = args.at(0); - const auto* a_list_arg = - std::get_if(&encodable_a_list_arg); - api->CallFlutterEchoNullableList( - a_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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList", &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_list_arg = args.at(0); + const auto* a_list_arg = std::get_if(&encodable_a_list_arg); + api->CallFlutterEchoNullableList(a_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); } } { - auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap", - &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())); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap", &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())); + } + }); } 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.message()), - EncodableValue(error.code()), - error.details()}); + return EncodableValue(EncodableList{ + EncodableValue(error.message()), + EncodableValue(error.code()), + error.details() + }); } -FlutterIntegrationCoreApiCodecSerializer:: - FlutterIntegrationCoreApiCodecSerializer() {} -EncodableValue FlutterIntegrationCoreApiCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { + +FlutterIntegrationCoreApiCodecSerializer::FlutterIntegrationCoreApiCodecSerializer() {} +EncodableValue FlutterIntegrationCoreApiCodecSerializer::ReadValueOfType(uint8_t type, flutter::ByteStreamReader* stream) const { switch (type) { case 128: - return CustomEncodableValue( - AllNullableTypes(std::get(ReadValue(stream)))); + return CustomEncodableValue(AllNullableTypes(std::get(ReadValue(stream)))); case 129: - return CustomEncodableValue( - AllNullableTypesWrapper(std::get(ReadValue(stream)))); + return CustomEncodableValue(AllNullableTypesWrapper(std::get(ReadValue(stream)))); case 130: - return CustomEncodableValue( - AllTypes(std::get(ReadValue(stream)))); + return CustomEncodableValue(AllTypes(std::get(ReadValue(stream)))); case 131: - return CustomEncodableValue( - TestMessage(std::get(ReadValue(stream)))); + return CustomEncodableValue(TestMessage(std::get(ReadValue(stream)))); default: return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } } -void FlutterIntegrationCoreApiCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = - std::get_if(&value)) { +void FlutterIntegrationCoreApiCodecSerializer::WriteValue(const EncodableValue& value, flutter::ByteStreamWriter* stream) const { + if (const CustomEncodableValue* custom_value = std::get_if(&value)) { if (custom_value->type() == typeid(AllNullableTypes)) { stream->WriteByte(128); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); + WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); return; } if (custom_value->type() == typeid(AllNullableTypesWrapper)) { 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(AllTypes)) { 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(TestMessage)) { stream->WriteByte(131); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); + WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); return; } } flutter::StandardCodecSerializer::WriteValue(value, stream); } -// Generated class from Pigeon that represents Flutter messages that can be -// called from C++. -FlutterIntegrationCoreApi::FlutterIntegrationCoreApi( - flutter::BinaryMessenger* binary_messenger) { +// Generated class from Pigeon that represents Flutter messages that can be called from C++. +FlutterIntegrationCoreApi::FlutterIntegrationCoreApi(flutter::BinaryMessenger* binary_messenger) { this->binary_messenger_ = binary_messenger; } const flutter::StandardMessageCodec& FlutterIntegrationCoreApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &FlutterIntegrationCoreApiCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance(&FlutterIntegrationCoreApiCodecSerializer::GetInstance()); } -void FlutterIntegrationCoreApi::Noop( - std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.noop", - &GetCodec()); +void FlutterIntegrationCoreApi::Noop(std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.noop", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel->Send( - encoded_api_arguments, - [on_success = std::move(on_success), on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { on_success(); }); + channel->Send(encoded_api_arguments, [on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + on_success(); + }); } -void FlutterIntegrationCoreApi::ThrowError( - std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.throwError", &GetCodec()); +void FlutterIntegrationCoreApi::ThrowError(std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.throwError", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel->Send( - encoded_api_arguments, - [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* return_value = &encodable_return_value; - on_success(return_value); - }); + channel->Send(encoded_api_arguments, [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* return_value = &encodable_return_value; + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::ThrowErrorFromVoid( - std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.throwErrorFromVoid", - &GetCodec()); +void FlutterIntegrationCoreApi::ThrowErrorFromVoid(std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.throwErrorFromVoid", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel->Send( - encoded_api_arguments, - [on_success = std::move(on_success), on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { on_success(); }); + channel->Send(encoded_api_arguments, [on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + on_success(); + }); } -void FlutterIntegrationCoreApi::EchoAllTypes( - const AllTypes& everything_arg, - std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllTypes", &GetCodec()); +void FlutterIntegrationCoreApi::EchoAllTypes(const AllTypes& everything_arg, std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllTypes", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(everything_arg.ToEncodableList()), + EncodableValue(everything_arg.ToEncodableList()), + }); + channel->Send(encoded_api_arguments, [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& return_value = std::any_cast(std::get(encodable_return_value)); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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& return_value = std::any_cast( - std::get(encodable_return_value)); - on_success(return_value); - }); } -void FlutterIntegrationCoreApi::EchoAllNullableTypes( - const AllNullableTypes& everything_arg, - std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes", - &GetCodec()); +void FlutterIntegrationCoreApi::EchoAllNullableTypes(const AllNullableTypes& everything_arg, std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(everything_arg.ToEncodableList()), + EncodableValue(everything_arg.ToEncodableList()), + }); + channel->Send(encoded_api_arguments, [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& return_value = std::any_cast(std::get(encodable_return_value)); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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& return_value = std::any_cast( - std::get(encodable_return_value)); - on_success(return_value); - }); } -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) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes", - &GetCodec()); +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) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes", &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, [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& return_value = std::any_cast(std::get(encodable_return_value)); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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& return_value = std::any_cast( - std::get(encodable_return_value)); - on_success(return_value); - }); } -void FlutterIntegrationCoreApi::EchoBool( - bool a_bool_arg, std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoBool", &GetCodec()); +void FlutterIntegrationCoreApi::EchoBool(bool a_bool_arg, std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoBool", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_bool_arg), + EncodableValue(a_bool_arg), + }); + channel->Send(encoded_api_arguments, [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& return_value = std::get(encodable_return_value); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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& return_value = std::get(encodable_return_value); - on_success(return_value); - }); } -void FlutterIntegrationCoreApi::EchoInt( - int64_t an_int_arg, std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoInt", - &GetCodec()); +void FlutterIntegrationCoreApi::EchoInt(int64_t an_int_arg, std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoInt", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(an_int_arg), + EncodableValue(an_int_arg), + }); + channel->Send(encoded_api_arguments, [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 int64_t return_value = encodable_return_value.LongValue(); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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 int64_t return_value = encodable_return_value.LongValue(); - on_success(return_value); - }); } -void FlutterIntegrationCoreApi::EchoDouble( - double a_double_arg, std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoDouble", &GetCodec()); +void FlutterIntegrationCoreApi::EchoDouble(double a_double_arg, std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoDouble", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_double_arg), + EncodableValue(a_double_arg), + }); + channel->Send(encoded_api_arguments, [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& return_value = std::get(encodable_return_value); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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& return_value = std::get(encodable_return_value); - on_success(return_value); - }); } -void FlutterIntegrationCoreApi::EchoString( - const std::string& a_string_arg, - std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoString", &GetCodec()); +void FlutterIntegrationCoreApi::EchoString(const std::string& a_string_arg, std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoString", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), + EncodableValue(a_string_arg), + }); + channel->Send(encoded_api_arguments, [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& return_value = std::get(encodable_return_value); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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& return_value = - std::get(encodable_return_value); - on_success(return_value); - }); } -void FlutterIntegrationCoreApi::EchoUint8List( - const std::vector& a_list_arg, - std::function&)>&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoUint8List", - &GetCodec()); +void FlutterIntegrationCoreApi::EchoUint8List(const std::vector& a_list_arg, std::function&)>&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoUint8List", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_list_arg), + EncodableValue(a_list_arg), + }); + channel->Send(encoded_api_arguments, [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& return_value = std::get>(encodable_return_value); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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& return_value = - std::get>(encodable_return_value); - on_success(return_value); - }); } -void FlutterIntegrationCoreApi::EchoList( - const EncodableList& a_list_arg, - std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoList", &GetCodec()); +void FlutterIntegrationCoreApi::EchoList(const EncodableList& a_list_arg, std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoList", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_list_arg), + EncodableValue(a_list_arg), + }); + channel->Send(encoded_api_arguments, [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& return_value = std::get(encodable_return_value); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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& return_value = - std::get(encodable_return_value); - on_success(return_value); - }); } -void FlutterIntegrationCoreApi::EchoMap( - const EncodableMap& a_map_arg, - std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoMap", - &GetCodec()); +void FlutterIntegrationCoreApi::EchoMap(const EncodableMap& a_map_arg, std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoMap", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_map_arg), + EncodableValue(a_map_arg), + }); + channel->Send(encoded_api_arguments, [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& return_value = std::get(encodable_return_value); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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& return_value = - std::get(encodable_return_value); - on_success(return_value); - }); } -void FlutterIntegrationCoreApi::EchoNullableBool( - const bool* a_bool_arg, std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool", - &GetCodec()); +void FlutterIntegrationCoreApi::EchoNullableBool(const bool* a_bool_arg, std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool", &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, [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* return_value = std::get_if(&encodable_return_value); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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* return_value = std::get_if(&encodable_return_value); - on_success(return_value); - }); } -void FlutterIntegrationCoreApi::EchoNullableInt( - const int64_t* an_int_arg, std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableInt", - &GetCodec()); +void FlutterIntegrationCoreApi::EchoNullableInt(const int64_t* an_int_arg, std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableInt", &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, [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 int64_t return_value_value = encodable_return_value.IsNull() ? 0 : encodable_return_value.LongValue(); + const auto* return_value = encodable_return_value.IsNull() ? nullptr : &return_value_value; + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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 int64_t return_value_value = - encodable_return_value.IsNull() - ? 0 - : encodable_return_value.LongValue(); - const auto* return_value = - encodable_return_value.IsNull() ? nullptr : &return_value_value; - on_success(return_value); - }); } -void FlutterIntegrationCoreApi::EchoNullableDouble( - const double* a_double_arg, std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble", - &GetCodec()); +void FlutterIntegrationCoreApi::EchoNullableDouble(const double* a_double_arg, std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble", &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, [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* return_value = std::get_if(&encodable_return_value); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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* return_value = std::get_if(&encodable_return_value); - on_success(return_value); - }); } -void FlutterIntegrationCoreApi::EchoNullableString( - const std::string* a_string_arg, - std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString", - &GetCodec()); +void FlutterIntegrationCoreApi::EchoNullableString(const std::string* a_string_arg, std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString", &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, [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* return_value = std::get_if(&encodable_return_value); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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* return_value = - std::get_if(&encodable_return_value); - on_success(return_value); - }); } -void FlutterIntegrationCoreApi::EchoNullableUint8List( - const std::vector* a_list_arg, - std::function*)>&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List", - &GetCodec()); +void FlutterIntegrationCoreApi::EchoNullableUint8List(const std::vector* a_list_arg, std::function*)>&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_list_arg ? EncodableValue(*a_list_arg) : EncodableValue(), + a_list_arg ? EncodableValue(*a_list_arg) : EncodableValue(), + }); + channel->Send(encoded_api_arguments, [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* return_value = std::get_if>(&encodable_return_value); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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* return_value = - std::get_if>(&encodable_return_value); - on_success(return_value); - }); } -void FlutterIntegrationCoreApi::EchoNullableList( - const EncodableList* a_list_arg, - std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList", - &GetCodec()); +void FlutterIntegrationCoreApi::EchoNullableList(const EncodableList* a_list_arg, std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_list_arg ? EncodableValue(*a_list_arg) : EncodableValue(), + a_list_arg ? EncodableValue(*a_list_arg) : EncodableValue(), + }); + channel->Send(encoded_api_arguments, [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* return_value = std::get_if(&encodable_return_value); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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* return_value = - std::get_if(&encodable_return_value); - on_success(return_value); - }); } -void FlutterIntegrationCoreApi::EchoNullableMap( - const EncodableMap* a_map_arg, - std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableMap", - &GetCodec()); +void FlutterIntegrationCoreApi::EchoNullableMap(const EncodableMap* a_map_arg, std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableMap", &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, [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* return_value = std::get_if(&encodable_return_value); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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* return_value = - std::get_if(&encodable_return_value); - on_success(return_value); - }); } -void FlutterIntegrationCoreApi::NoopAsync( - std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync", &GetCodec()); +void FlutterIntegrationCoreApi::NoopAsync(std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel->Send( - encoded_api_arguments, - [on_success = std::move(on_success), on_error = std::move(on_error)]( - const uint8_t* reply, size_t reply_size) { on_success(); }); + channel->Send(encoded_api_arguments, [on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { + on_success(); + }); } -void FlutterIntegrationCoreApi::EchoAsyncString( - const std::string& a_string_arg, - std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, - "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString", - &GetCodec()); +void FlutterIntegrationCoreApi::EchoAsyncString(const std::string& a_string_arg, std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), + EncodableValue(a_string_arg), + }); + channel->Send(encoded_api_arguments, [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& return_value = std::get(encodable_return_value); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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& return_value = - std::get(encodable_return_value); - on_success(return_value); - }); } /// The codec used by HostTrivialApi. const flutter::StandardMessageCodec& HostTrivialApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &flutter::StandardCodecSerializer::GetInstance()); -} - -// Sets up an instance of `HostTrivialApi` to handle messages through the -// `binary_messenger`. -void HostTrivialApi::SetUp(flutter::BinaryMessenger* binary_messenger, - HostTrivialApi* api) { - { - auto channel = std::make_unique>( - binary_messenger, "dev.flutter.pigeon.HostTrivialApi.noop", - &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())); - } - }); + return flutter::StandardMessageCodec::GetInstance(&flutter::StandardCodecSerializer::GetInstance()); +} + +// Sets up an instance of `HostTrivialApi` to handle messages through the `binary_messenger`. +void HostTrivialApi::SetUp(flutter::BinaryMessenger* binary_messenger, HostTrivialApi* api) { + { + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostTrivialApi.noop", &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); } @@ -3480,82 +2520,74 @@ 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.message()), - EncodableValue(error.code()), - error.details()}); + return EncodableValue(EncodableList{ + EncodableValue(error.message()), + EncodableValue(error.code()), + error.details() + }); } /// The codec used by HostSmallApi. const flutter::StandardMessageCodec& HostSmallApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &flutter::StandardCodecSerializer::GetInstance()); -} - -// Sets up an instance of `HostSmallApi` to handle messages through the -// `binary_messenger`. -void HostSmallApi::SetUp(flutter::BinaryMessenger* binary_messenger, - HostSmallApi* api) { - { - auto channel = std::make_unique>( - binary_messenger, "dev.flutter.pigeon.HostSmallApi.echo", &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())); - } - }); + return flutter::StandardMessageCodec::GetInstance(&flutter::StandardCodecSerializer::GetInstance()); +} + +// Sets up an instance of `HostSmallApi` to handle messages through the `binary_messenger`. +void HostSmallApi::SetUp(flutter::BinaryMessenger* binary_messenger, HostSmallApi* api) { + { + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostSmallApi.echo", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>( - binary_messenger, "dev.flutter.pigeon.HostSmallApi.voidVoid", - &GetCodec()); + auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostSmallApi.voidVoid", &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); } @@ -3563,75 +2595,61 @@ 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.message()), - EncodableValue(error.code()), - error.details()}); + return EncodableValue(EncodableList{ + EncodableValue(error.message()), + EncodableValue(error.code()), + error.details() + }); } + FlutterSmallApiCodecSerializer::FlutterSmallApiCodecSerializer() {} -EncodableValue FlutterSmallApiCodecSerializer::ReadValueOfType( - uint8_t type, flutter::ByteStreamReader* stream) const { +EncodableValue FlutterSmallApiCodecSerializer::ReadValueOfType(uint8_t type, flutter::ByteStreamReader* stream) const { switch (type) { case 128: - return CustomEncodableValue( - TestMessage(std::get(ReadValue(stream)))); + return CustomEncodableValue(TestMessage(std::get(ReadValue(stream)))); default: return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } } -void FlutterSmallApiCodecSerializer::WriteValue( - const EncodableValue& value, flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = - std::get_if(&value)) { +void FlutterSmallApiCodecSerializer::WriteValue(const EncodableValue& value, flutter::ByteStreamWriter* stream) const { + if (const CustomEncodableValue* custom_value = std::get_if(&value)) { if (custom_value->type() == typeid(TestMessage)) { stream->WriteByte(128); - WriteValue( - EncodableValue( - std::any_cast(*custom_value).ToEncodableList()), - stream); + WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); return; } } flutter::StandardCodecSerializer::WriteValue(value, stream); } -// 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) { this->binary_messenger_ = binary_messenger; } const flutter::StandardMessageCodec& FlutterSmallApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance( - &FlutterSmallApiCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance(&FlutterSmallApiCodecSerializer::GetInstance()); } -void FlutterSmallApi::EchoWrappedList( - const TestMessage& msg_arg, - std::function&& on_success, - std::function&& on_error) { - auto channel = std::make_unique>( - binary_messenger_, "dev.flutter.pigeon.FlutterSmallApi.echoWrappedList", - &GetCodec()); +void FlutterSmallApi::EchoWrappedList(const TestMessage& msg_arg, std::function&& on_success, std::function&& on_error) { + auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterSmallApi.echoWrappedList", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(msg_arg.ToEncodableList()), + EncodableValue(msg_arg.ToEncodableList()), + }); + channel->Send(encoded_api_arguments, [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& return_value = std::any_cast(std::get(encodable_return_value)); + on_success(return_value); }); - channel->Send( - encoded_api_arguments, - [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& return_value = std::any_cast( - std::get(encodable_return_value)); - on_success(return_value); - }); } } // 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 513bae6682f..a3315830459 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 @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// +// // Autogenerated from Pigeon (v9.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -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,12 +41,13 @@ class FlutterError { flutter::EncodableValue details_; }; -template -class ErrorOr { +template class ErrorOr { public: - ErrorOr(const T& rhs) { new (&v_) T(rhs); } + ErrorOr(const T& rhs) { new(&v_) T(rhs); } ErrorOr(const T&& rhs) { v_ = std::move(rhs); } - ErrorOr(const FlutterError& rhs) { new (&v_) FlutterError(rhs); } + ErrorOr(const FlutterError& rhs) { + new(&v_) FlutterError(rhs); + } ErrorOr(const FlutterError&& rhs) { v_ = std::move(rhs); } bool has_error() const { return std::holds_alternative(v_); } @@ -65,7 +66,12 @@ class ErrorOr { std::variant v_; }; -enum class AnEnum { one = 0, two = 1, three = 2 }; + +enum class AnEnum { + one = 0, + two = 1, + three = 2 +}; // Generated class from Pigeon that represents data sent in messages. class AllTypes { @@ -104,6 +110,7 @@ class AllTypes { const std::string& a_string() const; void set_a_string(std::string_view value_arg); + private: AllTypes(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -129,8 +136,10 @@ class AllTypes { flutter::EncodableMap a_map_; AnEnum an_enum_; std::string a_string_; + }; + // Generated class from Pigeon that represents data sent in messages. class AllNullableTypes { public: @@ -176,10 +185,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); @@ -193,6 +200,7 @@ class AllNullableTypes { void set_a_nullable_string(const std::string_view* value_arg); void set_a_nullable_string(std::string_view value_arg); + private: AllNullableTypes(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -222,8 +230,10 @@ class AllNullableTypes { std::optional nullable_map_with_object_; std::optional a_nullable_enum_; std::optional a_nullable_string_; + }; + // Generated class from Pigeon that represents data sent in messages. class AllNullableTypesWrapper { public: @@ -231,6 +241,7 @@ class AllNullableTypesWrapper { const AllNullableTypes& values() const; void set_values(const AllNullableTypes& value_arg); + private: AllNullableTypesWrapper(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -246,8 +257,10 @@ class AllNullableTypesWrapper { friend class FlutterSmallApiCodecSerializer; friend class CoreTestsTest; AllNullableTypes values_; + }; + // A data class containing a List, used in unit tests. // // Generated class from Pigeon that represents data sent in messages. @@ -258,6 +271,7 @@ class TestMessage { void set_test_list(const flutter::EncodableList* value_arg); void set_test_list(const flutter::EncodableList& value_arg); + private: TestMessage(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -273,11 +287,12 @@ class TestMessage { friend class FlutterSmallApiCodecSerializer; friend class CoreTestsTest; std::optional test_list_; + }; -class HostIntegrationCoreApiCodecSerializer - : public flutter::StandardCodecSerializer { +class HostIntegrationCoreApiCodecSerializer : public flutter::StandardCodecSerializer { public: + inline static HostIntegrationCoreApiCodecSerializer& GetInstance() { static HostIntegrationCoreApiCodecSerializer sInstance; return sInstance; @@ -286,19 +301,17 @@ class HostIntegrationCoreApiCodecSerializer HostIntegrationCoreApiCodecSerializer(); public: - 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; + flutter::EncodableValue ReadValueOfType(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; @@ -322,219 +335,116 @@ 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& a_list) = 0; + virtual ErrorOr EchoList(const flutter::EncodableList& a_list) = 0; // Returns the passed map, to test serialization and deserialization. - virtual ErrorOr EchoMap( - const flutter::EncodableMap& a_map) = 0; + virtual ErrorOr EchoMap(const flutter::EncodableMap& a_map) = 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 inner `aString` value from the wrapped object, to test // sending of nested objects. - virtual ErrorOr> ExtractNestedNullableString( - const AllNullableTypesWrapper& wrapper) = 0; + virtual ErrorOr> ExtractNestedNullableString(const AllNullableTypesWrapper& 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; + virtual ErrorOr SendMultipleNullableTypes(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> EchoNullableMap(const flutter::EncodableMap* a_nullable_map) = 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; + virtual void EchoAsyncInt(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; + virtual void EchoAsyncDouble(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; + virtual void EchoAsyncBool(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; + virtual void EchoAsyncString(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; + virtual void EchoAsyncUint8List(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 serialization and deserialization - // asynchronously. - virtual void EchoAsyncList( - const flutter::EncodableList& a_list, - std::function reply)> result) = 0; - // Returns the passed map, to test serialization and deserialization - // asynchronously. - virtual void EchoAsyncMap( - const flutter::EncodableMap& a_map, - std::function reply)> result) = 0; + virtual void EchoAsyncObject(const flutter::EncodableValue& an_object, std::function reply)> result) = 0; + // Returns the passed list, to test serialization and deserialization asynchronously. + virtual void EchoAsyncList(const flutter::EncodableList& a_list, std::function reply)> result) = 0; + // Returns the passed map, to test serialization and deserialization asynchronously. + virtual void EchoAsyncMap(const flutter::EncodableMap& a_map, 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; // Returns the passed object, to test async serialization and deserialization. - virtual void EchoAsyncAllTypes( - const AllTypes& everything, - std::function reply)> result) = 0; + virtual void EchoAsyncAllTypes(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; + virtual void EchoAsyncNullableAllNullableTypes(const AllNullableTypes* everything, std::function> reply)> result) = 0; // Returns passed in int asynchronously. - virtual void EchoAsyncNullableInt( - const int64_t* an_int, - std::function> reply)> result) = 0; + virtual void EchoAsyncNullableInt(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; + virtual void EchoAsyncNullableDouble(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; + virtual void EchoAsyncNullableBool(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; + virtual void EchoAsyncNullableString(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; + virtual void EchoAsyncNullableUint8List(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 serialization and deserialization - // asynchronously. - virtual void EchoAsyncNullableList( - const flutter::EncodableList* a_list, - std::function> reply)> - result) = 0; - // Returns the passed map, to test serialization and deserialization - // asynchronously. - virtual void EchoAsyncNullableMap( - const flutter::EncodableMap* a_map, - 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; - 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; - virtual void CallFlutterEchoBool( - bool a_bool, std::function reply)> result) = 0; - virtual void CallFlutterEchoInt( - int64_t an_int, std::function reply)> result) = 0; - virtual void CallFlutterEchoDouble( - double a_double, std::function reply)> result) = 0; - virtual void CallFlutterEchoString( - const std::string& a_string, - std::function reply)> result) = 0; - virtual void CallFlutterEchoUint8List( - const std::vector& a_list, - std::function> reply)> result) = 0; - virtual void CallFlutterEchoList( - const flutter::EncodableList& a_list, - std::function reply)> result) = 0; - virtual void CallFlutterEchoMap( - const flutter::EncodableMap& a_map, - std::function reply)> result) = 0; - virtual void CallFlutterEchoNullableBool( - const bool* a_bool, - std::function> reply)> result) = 0; - virtual void CallFlutterEchoNullableInt( - const int64_t* an_int, - std::function> reply)> result) = 0; - virtual void CallFlutterEchoNullableDouble( - const double* a_double, - std::function> reply)> result) = 0; - virtual void CallFlutterEchoNullableString( - const std::string* a_string, - std::function> reply)> - result) = 0; - virtual void CallFlutterEchoNullableUint8List( - const std::vector* a_list, - std::function>> reply)> - result) = 0; - virtual void CallFlutterEchoNullableList( - const flutter::EncodableList* a_list, - std::function> reply)> - result) = 0; - virtual void CallFlutterEchoNullableMap( - const flutter::EncodableMap* a_map, - std::function> reply)> - result) = 0; + virtual void EchoAsyncNullableObject(const flutter::EncodableValue* an_object, std::function> reply)> result) = 0; + // Returns the passed list, to test serialization and deserialization asynchronously. + virtual void EchoAsyncNullableList(const flutter::EncodableList* a_list, std::function> reply)> result) = 0; + // Returns the passed map, to test serialization and deserialization asynchronously. + virtual void EchoAsyncNullableMap(const flutter::EncodableMap* a_map, 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; + 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; + virtual void CallFlutterEchoBool(bool a_bool, std::function reply)> result) = 0; + virtual void CallFlutterEchoInt(int64_t an_int, std::function reply)> result) = 0; + virtual void CallFlutterEchoDouble(double a_double, std::function reply)> result) = 0; + virtual void CallFlutterEchoString(const std::string& a_string, std::function reply)> result) = 0; + virtual void CallFlutterEchoUint8List(const std::vector& a_list, std::function> reply)> result) = 0; + virtual void CallFlutterEchoList(const flutter::EncodableList& a_list, std::function reply)> result) = 0; + virtual void CallFlutterEchoMap(const flutter::EncodableMap& a_map, std::function reply)> result) = 0; + virtual void CallFlutterEchoNullableBool(const bool* a_bool, std::function> reply)> result) = 0; + virtual void CallFlutterEchoNullableInt(const int64_t* an_int, std::function> reply)> result) = 0; + virtual void CallFlutterEchoNullableDouble(const double* a_double, std::function> reply)> result) = 0; + virtual void CallFlutterEchoNullableString(const std::string* a_string, std::function> reply)> result) = 0; + virtual void CallFlutterEchoNullableUint8List(const std::vector* a_list, std::function>> reply)> result) = 0; + virtual void CallFlutterEchoNullableList(const flutter::EncodableList* a_list, std::function> reply)> result) = 0; + virtual void CallFlutterEchoNullableMap(const flutter::EncodableMap* a_map, 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); + // Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binary_messenger`. + static void SetUp(flutter::BinaryMessenger* binary_messenger, HostIntegrationCoreApi* api); static flutter::EncodableValue WrapError(std::string_view error_message); static flutter::EncodableValue WrapError(const FlutterError& error); protected: HostIntegrationCoreApi() = default; + }; -class FlutterIntegrationCoreApiCodecSerializer - : public flutter::StandardCodecSerializer { +class FlutterIntegrationCoreApiCodecSerializer : public flutter::StandardCodecSerializer { public: + inline static FlutterIntegrationCoreApiCodecSerializer& GetInstance() { static FlutterIntegrationCoreApiCodecSerializer sInstance; return sInstance; @@ -543,19 +453,17 @@ class FlutterIntegrationCoreApiCodecSerializer FlutterIntegrationCoreApiCodecSerializer(); public: - 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; + flutter::EncodableValue ReadValueOfType(uint8_t type, flutter::ByteStreamReader* stream) const override; + }; // 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 { private: flutter::BinaryMessenger* binary_messenger_; @@ -565,103 +473,58 @@ class FlutterIntegrationCoreApi { 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); + void ThrowError(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); + void EchoAllNullableTypes(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); + 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); // 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& a_list, - std::function&)>&& on_success, - std::function&& on_error); + void EchoUint8List(const std::vector& a_list, std::function&)>&& on_success, std::function&& on_error); // Returns the passed list, to test serialization and deserialization. - void EchoList(const flutter::EncodableList& a_list, - std::function&& on_success, - std::function&& on_error); + void EchoList(const flutter::EncodableList& a_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 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* a_list, - std::function*)>&& on_success, - std::function&& on_error); + void EchoNullableUint8List(const std::vector* a_list, std::function*)>&& on_success, std::function&& on_error); // Returns the passed list, to test serialization and deserialization. - void EchoNullableList( - const flutter::EncodableList* a_list, - std::function&& on_success, - std::function&& on_error); + void EchoNullableList(const flutter::EncodableList* a_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); + void EchoNullableMap(const flutter::EncodableMap* a_map, 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); + }; // 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; @@ -671,44 +534,40 @@ 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); + // Sets up an instance of `HostTrivialApi` to handle messages through the `binary_messenger`. + static void SetUp(flutter::BinaryMessenger* binary_messenger, HostTrivialApi* api); 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); + // Sets up an instance of `HostSmallApi` to handle messages through the `binary_messenger`. + static void SetUp(flutter::BinaryMessenger* binary_messenger, HostSmallApi* api); static flutter::EncodableValue WrapError(std::string_view error_message); static flutter::EncodableValue WrapError(const FlutterError& error); protected: HostSmallApi() = default; + }; class FlutterSmallApiCodecSerializer : public flutter::StandardCodecSerializer { public: + inline static FlutterSmallApiCodecSerializer& GetInstance() { static FlutterSmallApiCodecSerializer sInstance; return sInstance; @@ -717,18 +576,16 @@ class FlutterSmallApiCodecSerializer : public flutter::StandardCodecSerializer { FlutterSmallApiCodecSerializer(); public: - 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; + flutter::EncodableValue ReadValueOfType(uint8_t type, flutter::ByteStreamReader* stream) const override; + }; // 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 { private: flutter::BinaryMessenger* binary_messenger_; @@ -736,9 +593,8 @@ class FlutterSmallApi { public: FlutterSmallApi(flutter::BinaryMessenger* binary_messenger); static const flutter::StandardMessageCodec& GetCodec(); - void EchoWrappedList(const TestMessage& msg, - std::function&& on_success, - std::function&& on_error); + void EchoWrappedList(const TestMessage& msg, std::function&& on_success, std::function&& on_error); + }; } // namespace core_tests_pigeontest diff --git a/packages/pigeon/tool/shared/generation.dart b/packages/pigeon/tool/shared/generation.dart index 963e453db82..9cc1eedfe09 100644 --- a/packages/pigeon/tool/shared/generation.dart +++ b/packages/pigeon/tool/shared/generation.dart @@ -35,7 +35,6 @@ String _snakeToPascalCase(String snake) { // https://github.com/flutter/flutter/issues/115168. String _javaFilenameForName(String inputName) { const Map specialCases = { - 'android_unittests': 'Pigeon', 'message': 'MessagePigeon', }; return specialCases[inputName] ?? _snakeToPascalCase(inputName); @@ -45,7 +44,6 @@ Future generatePigeons({required String baseDir}) async { // TODO(stuartmorgan): Make this dynamic rather than hard-coded. Or eliminate // it entirely; see https://github.com/flutter/flutter/issues/115169. const List inputs = [ - 'android_unittests', 'background_platform_channels', 'core_tests', 'enum', From b972da0164cef8c48b9fcb8668fa572d7f75dc73 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Thu, 16 Feb 2023 11:25:04 -0500 Subject: [PATCH 09/10] Format --- .../CoreTests.java | 589 ++- .../ios/Classes/CoreTests.gen.h | 359 +- .../ios/Classes/CoreTests.gen.m | 1596 +++--- .../lib/src/generated/core_tests.gen.dart | 291 +- .../windows/pigeon/core_tests.gen.cpp | 4672 ++++++++++------- .../windows/pigeon/core_tests.gen.h | 434 +- 6 files changed, 4817 insertions(+), 3124 deletions(-) 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 1c0c3551747..bedbf244ec3 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 @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// +// // Autogenerated from Pigeon (v9.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -19,7 +19,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; @@ -32,7 +31,7 @@ private 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; } @@ -314,7 +313,8 @@ ArrayList toList() { Object aBool = list.get(0); pigeonResult.setABool((Boolean) aBool); Object anInt = 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 aDouble = list.get(2); pigeonResult.setADouble((Double) aDouble); Object aByteArray = list.get(3); @@ -553,7 +553,8 @@ public static final class Builder { private @Nullable Map nullableMapWithAnnotations; - public @NonNull Builder setNullableMapWithAnnotations(@Nullable Map setterArg) { + public @NonNull Builder setNullableMapWithAnnotations( + @Nullable Map setterArg) { this.nullableMapWithAnnotations = setterArg; return this; } @@ -624,7 +625,10 @@ ArrayList toList() { Object aNullableBool = list.get(0); pigeonResult.setANullableBool((Boolean) aNullableBool); Object aNullableInt = 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 aNullableDouble = list.get(2); pigeonResult.setANullableDouble((Double) aNullableDouble); Object aNullableByteArray = list.get(3); @@ -646,7 +650,8 @@ ArrayList toList() { Object nullableMapWithObject = list.get(11); pigeonResult.setNullableMapWithObject((Map) nullableMapWithObject); Object aNullableEnum = list.get(12); - pigeonResult.setANullableEnum(aNullableEnum == null ? null : AnEnum.values()[(int) aNullableEnum]); + pigeonResult.setANullableEnum( + aNullableEnum == null ? null : AnEnum.values()[(int) aNullableEnum]); Object aNullableString = list.get(13); pigeonResult.setANullableString((String) aNullableString); return pigeonResult; @@ -697,7 +702,8 @@ ArrayList toList() { static @NonNull AllNullableTypesWrapper fromList(@NonNull ArrayList list) { AllNullableTypesWrapper pigeonResult = new AllNullableTypesWrapper(); Object values = list.get(0); - pigeonResult.setValues((values == null) ? null : AllNullableTypes.fromList((ArrayList) values)); + pigeonResult.setValues( + (values == null) ? null : AllNullableTypes.fromList((ArrayList) values)); return pigeonResult; } } @@ -705,7 +711,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; @@ -797,94 +803,94 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } /** - * 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(); /** Responds with an error from an async void function. */ void throwErrorFromVoid(); /** 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 aList); /** Returns the passed map, to test serialization and deserialization. */ - @NonNull + @NonNull Map echoMap(@NonNull Map aMap); /** Returns the passed object, to test serialization and deserialization. */ - @Nullable + @Nullable AllNullableTypes echoAllNullableTypes(@Nullable AllNullableTypes 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 AllNullableTypesWrapper 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 AllNullableTypesWrapper 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 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); /** - * 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(Result result); /** Returns passed in int asynchronously. */ @@ -910,7 +916,8 @@ public interface HostIntegrationCoreApi { /** Returns the passed object, to test async serialization and deserialization. */ void echoAsyncAllTypes(@NonNull AllTypes everything, Result result); /** Returns the passed object, to test serialization and deserialization. */ - void echoAsyncNullableAllNullableTypes(@Nullable AllNullableTypes everything, Result result); + void echoAsyncNullableAllNullableTypes( + @Nullable AllNullableTypes everything, Result result); /** Returns passed in int asynchronously. */ void echoAsyncNullableInt(@Nullable Long anInt, Result result); /** Returns passed in double asynchronously. */ @@ -926,7 +933,8 @@ public interface HostIntegrationCoreApi { /** Returns the passed list, to test serialization and deserialization asynchronously. */ void echoAsyncNullableList(@Nullable List aList, Result> result); /** Returns the passed map, to test serialization and deserialization asynchronously. */ - void echoAsyncNullableMap(@Nullable Map aMap, Result> result); + void echoAsyncNullableMap( + @Nullable Map aMap, Result> result); void callFlutterNoop(Result result); @@ -936,7 +944,11 @@ public interface HostIntegrationCoreApi { void callFlutterEchoAllTypes(@NonNull AllTypes everything, Result result); - void callFlutterSendMultipleNullableTypes(@Nullable Boolean aNullableBool, @Nullable Long aNullableInt, @Nullable String aNullableString, Result result); + void callFlutterSendMultipleNullableTypes( + @Nullable Boolean aNullableBool, + @Nullable Long aNullableInt, + @Nullable String aNullableString, + Result result); void callFlutterEchoBool(@NonNull Boolean aBool, Result result); @@ -964,13 +976,17 @@ public interface HostIntegrationCoreApi { void callFlutterEchoNullableList(@Nullable List aList, Result> result); - void callFlutterEchoNullableMap(@Nullable Map aMap, Result> result); + void callFlutterEchoNullableMap( + @Nullable Map aMap, Result> result); /** The codec used by HostIntegrationCoreApi. */ static MessageCodec getCodec() { return HostIntegrationCoreApiCodec.INSTANCE; } - /**Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `HostIntegrationCoreApi` to handle messages through the + * `binaryMessenger`. + */ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = @@ -996,7 +1012,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAllTypes", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAllTypes", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1023,7 +1041,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.throwError", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.throwError", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1044,7 +1064,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.throwErrorFromVoid", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.throwErrorFromVoid", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1092,7 +1114,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoDouble", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoDouble", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1146,7 +1170,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoString", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoString", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1173,7 +1199,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoUint8List", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoUint8List", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1200,7 +1228,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoObject", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoObject", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1281,7 +1311,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAllNullableTypes", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAllNullableTypes", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1305,7 +1337,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1332,7 +1366,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1341,7 +1377,8 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { ArrayList args = (ArrayList) message; assert args != null; String nullableStringArg = (String) args.get(0); - AllNullableTypesWrapper output = api.createNestedNullableString(nullableStringArg); + AllNullableTypesWrapper output = + api.createNestedNullableString(nullableStringArg); wrapped.add(0, output); } catch (Error | RuntimeException exception) { ArrayList wrappedError = wrapError(exception); @@ -1356,7 +1393,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1367,7 +1406,11 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { Boolean aNullableBoolArg = (Boolean) args.get(0); Number aNullableIntArg = (Number) args.get(1); String aNullableStringArg = (String) args.get(2); - 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 (Error | RuntimeException exception) { ArrayList wrappedError = wrapError(exception); @@ -1382,7 +1425,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableInt", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableInt", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1391,7 +1436,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { ArrayList args = (ArrayList) message; assert args != null; Number aNullableIntArg = (Number) args.get(0); - Long output = api.echoNullableInt((aNullableIntArg == null) ? null : aNullableIntArg.longValue()); + Long output = + api.echoNullableInt( + (aNullableIntArg == null) ? null : aNullableIntArg.longValue()); wrapped.add(0, output); } catch (Error | RuntimeException exception) { ArrayList wrappedError = wrapError(exception); @@ -1406,7 +1453,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableDouble", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableDouble", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1430,7 +1479,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableBool", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableBool", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1454,7 +1505,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableString", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableString", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1478,7 +1531,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1502,7 +1557,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableObject", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableObject", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1526,7 +1583,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableList", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableList", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1550,7 +1609,9 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableMap", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableMap", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1580,7 +1641,7 @@ static void setup(BinaryMessenger binaryMessenger, HostIntegrationCoreApi api) { (message, reply) -> { ArrayList wrapped = new ArrayList(); try { - Result resultCallback = + Result resultCallback = new Result() { public void success(Void result) { wrapped.add(0, null); @@ -1606,7 +1667,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncInt", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncInt", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1618,7 +1681,7 @@ public void error(Throwable error) { if (anIntArg == null) { throw new NullPointerException("anIntArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(Long result) { wrapped.add(0, result); @@ -1631,7 +1694,8 @@ public void error(Throwable error) { } }; - api.echoAsyncInt((anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.echoAsyncInt( + (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); } catch (Error | RuntimeException exception) { ArrayList wrappedError = wrapError(exception); reply.reply(wrappedError); @@ -1644,7 +1708,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncDouble", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncDouble", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1656,7 +1722,7 @@ public void error(Throwable error) { if (aDoubleArg == null) { throw new NullPointerException("aDoubleArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(Double result) { wrapped.add(0, result); @@ -1682,7 +1748,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncBool", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncBool", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1694,7 +1762,7 @@ public void error(Throwable error) { if (aBoolArg == null) { throw new NullPointerException("aBoolArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(Boolean result) { wrapped.add(0, result); @@ -1720,7 +1788,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncString", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncString", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1732,7 +1802,7 @@ public void error(Throwable error) { if (aStringArg == null) { throw new NullPointerException("aStringArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(String result) { wrapped.add(0, result); @@ -1758,7 +1828,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncUint8List", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncUint8List", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1770,7 +1842,7 @@ public void error(Throwable error) { if (aUint8ListArg == null) { throw new NullPointerException("aUint8ListArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(byte[] result) { wrapped.add(0, result); @@ -1796,7 +1868,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncObject", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncObject", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1808,7 +1882,7 @@ public void error(Throwable error) { if (anObjectArg == null) { throw new NullPointerException("anObjectArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(Object result) { wrapped.add(0, result); @@ -1834,7 +1908,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncList", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncList", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1846,7 +1922,7 @@ public void error(Throwable error) { if (aListArg == null) { throw new NullPointerException("aListArg unexpectedly null."); } - Result> resultCallback = + Result> resultCallback = new Result>() { public void success(List result) { wrapped.add(0, result); @@ -1872,7 +1948,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncMap", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncMap", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1884,7 +1962,7 @@ public void error(Throwable error) { if (aMapArg == null) { throw new NullPointerException("aMapArg unexpectedly null."); } - Result> resultCallback = + Result> resultCallback = new Result>() { public void success(Map result) { wrapped.add(0, result); @@ -1910,13 +1988,15 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncError", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncError", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); try { - Result resultCallback = + Result resultCallback = new Result() { public void success(Object result) { wrapped.add(0, result); @@ -1942,13 +2022,15 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); try { - Result resultCallback = + Result resultCallback = new Result() { public void success(Void result) { wrapped.add(0, null); @@ -1974,7 +2056,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncAllTypes", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncAllTypes", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1986,7 +2070,7 @@ public void error(Throwable error) { if (everythingArg == null) { throw new NullPointerException("everythingArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(AllTypes result) { wrapped.add(0, result); @@ -2012,7 +2096,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2021,7 +2107,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; AllNullableTypes everythingArg = (AllNullableTypes) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(AllNullableTypes result) { wrapped.add(0, result); @@ -2047,7 +2133,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableInt", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableInt", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2056,7 +2144,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Number anIntArg = (Number) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(Long result) { wrapped.add(0, result); @@ -2069,7 +2157,8 @@ public void error(Throwable error) { } }; - api.echoAsyncNullableInt((anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.echoAsyncNullableInt( + (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); } catch (Error | RuntimeException exception) { ArrayList wrappedError = wrapError(exception); reply.reply(wrappedError); @@ -2082,7 +2171,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2091,7 +2182,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Double aDoubleArg = (Double) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(Double result) { wrapped.add(0, result); @@ -2117,7 +2208,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2126,7 +2219,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Boolean aBoolArg = (Boolean) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(Boolean result) { wrapped.add(0, result); @@ -2152,7 +2245,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2161,7 +2256,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; String aStringArg = (String) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(String result) { wrapped.add(0, result); @@ -2187,7 +2282,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2196,7 +2293,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; byte[] aUint8ListArg = (byte[]) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(byte[] result) { wrapped.add(0, result); @@ -2222,7 +2319,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2231,7 +2330,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Object anObjectArg = args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(Object result) { wrapped.add(0, result); @@ -2257,7 +2356,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2266,7 +2367,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; List aListArg = (List) args.get(0); - Result> resultCallback = + Result> resultCallback = new Result>() { public void success(List result) { wrapped.add(0, result); @@ -2292,7 +2393,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableMap", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableMap", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2301,7 +2404,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Map aMapArg = (Map) args.get(0); - Result> resultCallback = + Result> resultCallback = new Result>() { public void success(Map result) { wrapped.add(0, result); @@ -2327,13 +2430,15 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterNoop", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterNoop", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); try { - Result resultCallback = + Result resultCallback = new Result() { public void success(Void result) { wrapped.add(0, null); @@ -2359,13 +2464,15 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); try { - Result resultCallback = + Result resultCallback = new Result() { public void success(Object result) { wrapped.add(0, result); @@ -2391,13 +2498,15 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); try { - Result resultCallback = + Result resultCallback = new Result() { public void success(Void result) { wrapped.add(0, null); @@ -2423,7 +2532,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2435,7 +2546,7 @@ public void error(Throwable error) { if (everythingArg == null) { throw new NullPointerException("everythingArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(AllTypes result) { wrapped.add(0, result); @@ -2461,7 +2572,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2472,7 +2585,7 @@ public void error(Throwable error) { Boolean aNullableBoolArg = (Boolean) args.get(0); Number aNullableIntArg = (Number) args.get(1); String aNullableStringArg = (String) args.get(2); - Result resultCallback = + Result resultCallback = new Result() { public void success(AllNullableTypes result) { wrapped.add(0, result); @@ -2485,7 +2598,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); } catch (Error | RuntimeException exception) { ArrayList wrappedError = wrapError(exception); reply.reply(wrappedError); @@ -2498,7 +2615,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoBool", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoBool", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2510,7 +2629,7 @@ public void error(Throwable error) { if (aBoolArg == null) { throw new NullPointerException("aBoolArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(Boolean result) { wrapped.add(0, result); @@ -2536,7 +2655,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoInt", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoInt", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2548,7 +2669,7 @@ public void error(Throwable error) { if (anIntArg == null) { throw new NullPointerException("anIntArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(Long result) { wrapped.add(0, result); @@ -2561,7 +2682,8 @@ public void error(Throwable error) { } }; - api.callFlutterEchoInt((anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.callFlutterEchoInt( + (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); } catch (Error | RuntimeException exception) { ArrayList wrappedError = wrapError(exception); reply.reply(wrappedError); @@ -2574,7 +2696,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2586,7 +2710,7 @@ public void error(Throwable error) { if (aDoubleArg == null) { throw new NullPointerException("aDoubleArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(Double result) { wrapped.add(0, result); @@ -2612,7 +2736,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2624,7 +2750,7 @@ public void error(Throwable error) { if (aStringArg == null) { throw new NullPointerException("aStringArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(String result) { wrapped.add(0, result); @@ -2650,7 +2776,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2662,7 +2790,7 @@ public void error(Throwable error) { if (aListArg == null) { throw new NullPointerException("aListArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(byte[] result) { wrapped.add(0, result); @@ -2688,7 +2816,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoList", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoList", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2700,7 +2830,7 @@ public void error(Throwable error) { if (aListArg == null) { throw new NullPointerException("aListArg unexpectedly null."); } - Result> resultCallback = + Result> resultCallback = new Result>() { public void success(List result) { wrapped.add(0, result); @@ -2726,7 +2856,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoMap", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoMap", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2738,7 +2870,7 @@ public void error(Throwable error) { if (aMapArg == null) { throw new NullPointerException("aMapArg unexpectedly null."); } - Result> resultCallback = + Result> resultCallback = new Result>() { public void success(Map result) { wrapped.add(0, result); @@ -2764,7 +2896,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2773,7 +2907,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Boolean aBoolArg = (Boolean) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(Boolean result) { wrapped.add(0, result); @@ -2799,7 +2933,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2808,7 +2944,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Number anIntArg = (Number) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(Long result) { wrapped.add(0, result); @@ -2821,7 +2957,8 @@ public void error(Throwable error) { } }; - api.callFlutterEchoNullableInt((anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.callFlutterEchoNullableInt( + (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); } catch (Error | RuntimeException exception) { ArrayList wrappedError = wrapError(exception); reply.reply(wrappedError); @@ -2834,7 +2971,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableDouble", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableDouble", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2843,7 +2982,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Double aDoubleArg = (Double) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(Double result) { wrapped.add(0, result); @@ -2869,7 +3008,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableString", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableString", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2878,7 +3019,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; String aStringArg = (String) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(String result) { wrapped.add(0, result); @@ -2904,7 +3045,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableUint8List", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableUint8List", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2913,7 +3056,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; byte[] aListArg = (byte[]) args.get(0); - Result resultCallback = + Result resultCallback = new Result() { public void success(byte[] result) { wrapped.add(0, result); @@ -2939,7 +3082,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2948,7 +3093,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; List aListArg = (List) args.get(0); - Result> resultCallback = + Result> resultCallback = new Result>() { public void success(List result) { wrapped.add(0, result); @@ -2974,7 +3119,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2983,7 +3130,7 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; assert args != null; Map aMapArg = (Map) args.get(0); - Result> resultCallback = + Result> resultCallback = new Result>() { public void success(Map result) { wrapped.add(0, result); @@ -3010,7 +3157,8 @@ public void error(Throwable error) { } private static class FlutterIntegrationCoreApiCodec extends StandardMessageCodec { - public static final FlutterIntegrationCoreApiCodec INSTANCE = new FlutterIntegrationCoreApiCodec(); + public static final FlutterIntegrationCoreApiCodec INSTANCE = + new FlutterIntegrationCoreApiCodec(); private FlutterIntegrationCoreApiCodec() {} @@ -3051,10 +3199,10 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { } /** - * 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 BinaryMessenger binaryMessenger; @@ -3063,7 +3211,8 @@ public FlutterIntegrationCoreApi(BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ public interface Reply { + /** Public interface for sending reply. */ + public interface Reply { void reply(T reply); } /** The codec used by FlutterIntegrationCoreApi. */ @@ -3071,22 +3220,21 @@ static MessageCodec getCodec() { return FlutterIntegrationCoreApiCodec.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(Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.noop", getCodec()); - channel.send( - null, - channelReply -> callback.reply(null)); + channel.send(null, channelReply -> callback.reply(null)); } /** Responds with an error from an async function returning a value. */ public void throwError(Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.throwError", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.throwError", + getCodec()); channel.send( null, channelReply -> { @@ -3099,16 +3247,18 @@ public void throwError(Reply callback) { public void throwErrorFromVoid(Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.throwErrorFromVoid", getCodec()); - channel.send( - null, - channelReply -> callback.reply(null)); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.throwErrorFromVoid", + getCodec()); + channel.send(null, channelReply -> callback.reply(null)); } /** Returns the passed object, to test serialization and deserialization. */ public void echoAllTypes(@NonNull AllTypes everythingArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllTypes", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllTypes", + getCodec()); channel.send( new ArrayList(Collections.singletonList(everythingArg)), channelReply -> { @@ -3118,10 +3268,13 @@ public void echoAllTypes(@NonNull AllTypes everythingArg, Reply callba }); } /** Returns the passed object, to test serialization and deserialization. */ - public void echoAllNullableTypes(@NonNull AllNullableTypes everythingArg, Reply callback) { + public void echoAllNullableTypes( + @NonNull AllNullableTypes everythingArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes", + getCodec()); channel.send( new ArrayList(Collections.singletonList(everythingArg)), channelReply -> { @@ -3133,14 +3286,21 @@ public void echoAllNullableTypes(@NonNull AllNullableTypes everythingArg, Reply< /** * 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, Reply callback) { + public void sendMultipleNullableTypes( + @Nullable Boolean aNullableBoolArg, + @Nullable Long aNullableIntArg, + @Nullable String aNullableStringArg, + Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes", + getCodec()); channel.send( - new ArrayList(Arrays.asList(aNullableBoolArg, aNullableIntArg, aNullableStringArg)), + new ArrayList( + Arrays.asList(aNullableBoolArg, aNullableIntArg, aNullableStringArg)), channelReply -> { @SuppressWarnings("ConstantConditions") AllNullableTypes output = (AllNullableTypes) channelReply; @@ -3177,7 +3337,9 @@ public void echoInt(@NonNull Long anIntArg, Reply callback) { public void echoDouble(@NonNull Double aDoubleArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoDouble", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoDouble", + getCodec()); channel.send( new ArrayList(Collections.singletonList(aDoubleArg)), channelReply -> { @@ -3190,7 +3352,9 @@ public void echoDouble(@NonNull Double aDoubleArg, Reply callback) { public void echoString(@NonNull String aStringArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoString", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoString", + getCodec()); channel.send( new ArrayList(Collections.singletonList(aStringArg)), channelReply -> { @@ -3203,7 +3367,9 @@ public void echoString(@NonNull String aStringArg, Reply callback) { public void echoUint8List(@NonNull byte[] aListArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoUint8List", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoUint8List", + getCodec()); channel.send( new ArrayList(Collections.singletonList(aListArg)), channelReply -> { @@ -3242,7 +3408,9 @@ public void echoMap(@NonNull Map aMapArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool", + getCodec()); channel.send( new ArrayList(Collections.singletonList(aBoolArg)), channelReply -> { @@ -3255,7 +3423,9 @@ public void echoNullableBool(@Nullable Boolean aBoolArg, Reply callback public void echoNullableInt(@Nullable Long anIntArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableInt", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableInt", + getCodec()); channel.send( new ArrayList(Collections.singletonList(anIntArg)), channelReply -> { @@ -3268,7 +3438,9 @@ public void echoNullableInt(@Nullable Long anIntArg, Reply callback) { public void echoNullableDouble(@Nullable Double aDoubleArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble", + getCodec()); channel.send( new ArrayList(Collections.singletonList(aDoubleArg)), channelReply -> { @@ -3281,7 +3453,9 @@ public void echoNullableDouble(@Nullable Double aDoubleArg, Reply callba public void echoNullableString(@Nullable String aStringArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString", + getCodec()); channel.send( new ArrayList(Collections.singletonList(aStringArg)), channelReply -> { @@ -3294,7 +3468,9 @@ public void echoNullableString(@Nullable String aStringArg, Reply callba public void echoNullableUint8List(@Nullable byte[] aListArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List", + getCodec()); channel.send( new ArrayList(Collections.singletonList(aListArg)), channelReply -> { @@ -3307,7 +3483,9 @@ public void echoNullableUint8List(@Nullable byte[] aListArg, Reply callb public void echoNullableList(@Nullable List aListArg, Reply> callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList", + getCodec()); channel.send( new ArrayList(Collections.singletonList(aListArg)), channelReply -> { @@ -3317,10 +3495,13 @@ public void echoNullableList(@Nullable List aListArg, Reply }); } /** Returns the passed map, to test serialization and deserialization. */ - public void echoNullableMap(@Nullable Map aMapArg, Reply> callback) { + public void echoNullableMap( + @Nullable Map aMapArg, Reply> callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableMap", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableMap", + getCodec()); channel.send( new ArrayList(Collections.singletonList(aMapArg)), channelReply -> { @@ -3330,22 +3511,24 @@ public void echoNullableMap(@Nullable Map aMapArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync", getCodec()); - channel.send( - null, - channelReply -> callback.reply(null)); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync", + getCodec()); + channel.send(null, channelReply -> callback.reply(null)); } /** Returns the passed in generic Object asynchronously. */ public void echoAsyncString(@NonNull String aStringArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString", + getCodec()); channel.send( new ArrayList(Collections.singletonList(aStringArg)), channelReply -> { @@ -3358,7 +3541,7 @@ public void echoAsyncString(@NonNull String aStringArg, Reply callback) /** * 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 { @@ -3368,7 +3551,7 @@ public interface HostTrivialApi { static MessageCodec getCodec() { return new StandardMessageCodec(); } - /**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(BinaryMessenger binaryMessenger, HostTrivialApi api) { { BasicMessageChannel channel = @@ -3396,7 +3579,7 @@ static void setup(BinaryMessenger binaryMessenger, HostTrivialApi api) { /** * 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 { @@ -3408,7 +3591,7 @@ public interface HostSmallApi { static MessageCodec getCodec() { return new StandardMessageCodec(); } - /**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(BinaryMessenger binaryMessenger, HostSmallApi api) { { BasicMessageChannel channel = @@ -3425,7 +3608,7 @@ static void setup(BinaryMessenger binaryMessenger, HostSmallApi api) { if (aStringArg == null) { throw new NullPointerException("aStringArg unexpectedly null."); } - Result resultCallback = + Result resultCallback = new Result() { public void success(String result) { wrapped.add(0, result); @@ -3457,7 +3640,7 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList(); try { - Result resultCallback = + Result resultCallback = new Result() { public void success(Void result) { wrapped.add(0, null); @@ -3512,7 +3695,7 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** * 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 BinaryMessenger binaryMessenger; @@ -3521,13 +3704,15 @@ public FlutterSmallApi(BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ public interface Reply { + /** Public interface for sending reply. */ + public interface Reply { void reply(T reply); } /** The codec used by FlutterSmallApi. */ static MessageCodec getCodec() { return FlutterSmallApiCodec.INSTANCE; } + public void echoWrappedList(@NonNull TestMessage msgArg, Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( 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 c26e2c3c540..c0f834cfa83 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 @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// +// // Autogenerated from Pigeon (v9.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -29,71 +29,73 @@ typedef NS_ENUM(NSUInteger, AnEnum) { /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithABool:(NSNumber *)aBool - anInt:(NSNumber *)anInt - aDouble:(NSNumber *)aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - aList:(NSArray *)aList - aMap:(NSDictionary *)aMap - anEnum:(AnEnum)anEnum - aString:(NSString *)aString; -@property(nonatomic, strong) NSNumber * aBool; -@property(nonatomic, strong) NSNumber * anInt; -@property(nonatomic, strong) NSNumber * aDouble; -@property(nonatomic, strong) FlutterStandardTypedData * aByteArray; -@property(nonatomic, strong) FlutterStandardTypedData * a4ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData * a8ByteArray; -@property(nonatomic, strong) FlutterStandardTypedData * aFloatArray; -@property(nonatomic, strong) NSArray * aList; -@property(nonatomic, strong) NSDictionary * aMap; + anInt:(NSNumber *)anInt + aDouble:(NSNumber *)aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + aList:(NSArray *)aList + aMap:(NSDictionary *)aMap + anEnum:(AnEnum)anEnum + aString:(NSString *)aString; +@property(nonatomic, strong) NSNumber *aBool; +@property(nonatomic, strong) NSNumber *anInt; +@property(nonatomic, strong) NSNumber *aDouble; +@property(nonatomic, strong) FlutterStandardTypedData *aByteArray; +@property(nonatomic, strong) FlutterStandardTypedData *a4ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData *a8ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData *aFloatArray; +@property(nonatomic, strong) NSArray *aList; +@property(nonatomic, strong) NSDictionary *aMap; @property(nonatomic, assign) AnEnum anEnum; -@property(nonatomic, copy) NSString * aString; +@property(nonatomic, copy) NSString *aString; @end @interface AllNullableTypes : NSObject + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - aNullableList:(nullable NSArray *)aNullableList - aNullableMap:(nullable NSDictionary *)aNullableMap - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(AnEnum)aNullableEnum - aNullableString:(nullable NSString *)aNullableString; -@property(nonatomic, strong, nullable) NSNumber * aNullableBool; -@property(nonatomic, strong, nullable) NSNumber * aNullableInt; -@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, strong, nullable) NSArray * aNullableList; -@property(nonatomic, strong, nullable) NSDictionary * aNullableMap; -@property(nonatomic, strong, nullable) NSArray *> * nullableNestedList; -@property(nonatomic, strong, nullable) NSDictionary * nullableMapWithAnnotations; -@property(nonatomic, strong, nullable) NSDictionary * nullableMapWithObject; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableList:(nullable NSArray *)aNullableList + aNullableMap:(nullable NSDictionary *)aNullableMap + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations: + (nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(AnEnum)aNullableEnum + aNullableString:(nullable NSString *)aNullableString; +@property(nonatomic, strong, nullable) NSNumber *aNullableBool; +@property(nonatomic, strong, nullable) NSNumber *aNullableInt; +@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, strong, nullable) NSArray *aNullableList; +@property(nonatomic, strong, nullable) NSDictionary *aNullableMap; +@property(nonatomic, strong, nullable) NSArray *> *nullableNestedList; +@property(nonatomic, strong, nullable) + NSDictionary *nullableMapWithAnnotations; +@property(nonatomic, strong, nullable) NSDictionary *nullableMapWithObject; @property(nonatomic, assign) AnEnum aNullableEnum; -@property(nonatomic, copy, nullable) NSString * aNullableString; +@property(nonatomic, copy, nullable) NSString *aNullableString; @end @interface AllNullableTypesWrapper : NSObject /// `init` unavailable to enforce nonnull fields, see the `make` class method. - (instancetype)init NS_UNAVAILABLE; + (instancetype)makeWithValues:(AllNullableTypes *)values; -@property(nonatomic, strong) AllNullableTypes * values; +@property(nonatomic, strong) AllNullableTypes *values; @end /// A data class containing a List, used in unit tests. @interface TestMessage : NSObject + (instancetype)makeWithTestList:(nullable NSArray *)testList; -@property(nonatomic, strong, nullable) NSArray * testList; +@property(nonatomic, strong, nullable) NSArray *testList; @end /// The codec used by HostIntegrationCoreApi. @@ -108,7 +110,8 @@ NSObject *HostIntegrationCoreApiGetCodec(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; /// Responds with an error from an async void function. @@ -120,7 +123,8 @@ NSObject *HostIntegrationCoreApiGetCodec(void); /// Returns passed in double. /// /// @return `nil` only when `error != nil`. -- (nullable NSNumber *)echoDouble:(NSNumber *)aDouble error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSNumber *)echoDouble:(NSNumber *)aDouble + error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed in boolean. /// /// @return `nil` only when `error != nil`. @@ -128,11 +132,13 @@ NSObject *HostIntegrationCoreApiGetCodec(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`. @@ -140,106 +146,179 @@ NSObject *HostIntegrationCoreApiGetCodec(void); /// Returns the passed list, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable NSArray *)echoList:(NSArray *)aList error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSArray *)echoList:(NSArray *)aList + 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 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 inner `aString` value from the wrapped object, to test /// sending of nested objects. -- (nullable NSString *)extractNestedNullableStringFrom:(AllNullableTypesWrapper *)wrapper error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSString *)extractNestedNullableStringFrom:(AllNullableTypesWrapper *)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 AllNullableTypesWrapper *)createNestedObjectWithNullableString:(nullable NSString *)nullableString error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable AllNullableTypesWrapper *) + 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 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; +- (nullable NSDictionary *)echoNullableMap: + (nullable NSDictionary *)aNullableMap + 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:(NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncInt:(NSNumber *)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns passed in double asynchronously. -- (void)echoAsyncDouble:(NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncDouble:(NSNumber *)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed in boolean asynchronously. -- (void)echoAsyncBool:(NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncBool:(NSNumber *)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 serialization and deserialization asynchronously. -- (void)echoAsyncList:(NSArray *)aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncList:(NSArray *)aList + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization asynchronously. -- (void)echoAsyncMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncMap:(NSDictionary *)aMap + completion:(void (^)(NSDictionary *_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; /// 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 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 serialization and deserialization asynchronously. -- (void)echoAsyncNullableList:(nullable NSArray *)aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableList:(nullable NSArray *)aList + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization asynchronously. -- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap + completion:(void (^)(NSDictionary *_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)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool anInt:(nullable NSNumber *)aNullableInt aString:(nullable NSString *)aNullableString completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoBool:(NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoInt:(NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoDouble:(NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoString:(NSString *)aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)aList completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoList:(NSArray *)aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoMap:(NSDictionary *)aMap completion:(void (^)(NSDictionary *_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 *)aList completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableList:(nullable NSArray *)aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllTypes:(AllTypes *)everything + completion:(void (^)(AllTypes *_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)callFlutterEchoBool:(NSNumber *)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoInt:(NSNumber *)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoDouble:(NSNumber *)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)aList + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoList:(NSArray *)aList + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoMap:(NSDictionary *)aMap + completion:(void (^)(NSDictionary *_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 *)aList + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableList:(nullable NSArray *)aList + completion: + (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; @end -extern void HostIntegrationCoreApiSetup(id binaryMessenger, NSObject *_Nullable api); +extern void HostIntegrationCoreApiSetup(id binaryMessenger, + NSObject *_Nullable api); /// The codec used by FlutterIntegrationCoreApi. NSObject *FlutterIntegrationCoreApiGetCodec(void); @@ -256,46 +335,72 @@ NSObject *FlutterIntegrationCoreApiGetCodec(void); /// 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:(AllNullableTypes *)everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)echoAllNullableTypes:(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 boolean, to test serialization and deserialization. -- (void)echoBool:(NSNumber *)aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoBool:(NSNumber *)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed int, to test serialization and deserialization. -- (void)echoInt:(NSNumber *)anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoInt:(NSNumber *)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed double, to test serialization and deserialization. -- (void)echoDouble:(NSNumber *)aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)echoDouble:(NSNumber *)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 *)aList completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)echoUint8List:(FlutterStandardTypedData *)aList + completion: + (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed list, to test serialization and deserialization. -- (void)echoList:(NSArray *)aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoList:(NSArray *)aList + 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 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 *)aList completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)aList + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed list, to test serialization and deserialization. -- (void)echoNullableList:(nullable NSArray *)aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)echoNullableList:(nullable NSArray *)aList + 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; /// 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 /// The codec used by HostTrivialApi. @@ -306,18 +411,21 @@ NSObject *HostTrivialApiGetCodec(void); - (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error; @end -extern void HostTrivialApiSetup(id binaryMessenger, NSObject *_Nullable api); +extern void HostTrivialApiSetup(id binaryMessenger, + NSObject *_Nullable api); /// The codec used by HostSmallApi. NSObject *HostSmallApiGetCodec(void); /// 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 HostSmallApiSetup(id binaryMessenger, NSObject *_Nullable api); +extern void HostSmallApiSetup(id binaryMessenger, + NSObject *_Nullable api); /// The codec used by FlutterSmallApi. NSObject *FlutterSmallApiGetCodec(void); @@ -325,7 +433,8 @@ NSObject *FlutterSmallApiGetCodec(void); /// A simple API called in some unit tests. @interface FlutterSmallApi : NSObject - (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (void)echoWrappedList:(TestMessage *)msg completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion; +- (void)echoWrappedList:(TestMessage *)msg + completion:(void (^)(TestMessage *_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 60899fe2ac7..b3f948a4617 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 @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// +// // Autogenerated from Pigeon (v9.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -51,17 +51,17 @@ - (NSArray *)toList; @implementation AllTypes + (instancetype)makeWithABool:(NSNumber *)aBool - anInt:(NSNumber *)anInt - aDouble:(NSNumber *)aDouble - aByteArray:(FlutterStandardTypedData *)aByteArray - a4ByteArray:(FlutterStandardTypedData *)a4ByteArray - a8ByteArray:(FlutterStandardTypedData *)a8ByteArray - aFloatArray:(FlutterStandardTypedData *)aFloatArray - aList:(NSArray *)aList - aMap:(NSDictionary *)aMap - anEnum:(AnEnum)anEnum - aString:(NSString *)aString { - AllTypes* pigeonResult = [[AllTypes alloc] init]; + anInt:(NSNumber *)anInt + aDouble:(NSNumber *)aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + aList:(NSArray *)aList + aMap:(NSDictionary *)aMap + anEnum:(AnEnum)anEnum + aString:(NSString *)aString { + AllTypes *pigeonResult = [[AllTypes alloc] init]; pigeonResult.aBool = aBool; pigeonResult.anInt = anInt; pigeonResult.aDouble = aDouble; @@ -122,20 +122,21 @@ - (NSArray *)toList { @implementation AllNullableTypes + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - aNullableList:(nullable NSArray *)aNullableList - aNullableMap:(nullable NSDictionary *)aNullableMap - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations:(nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject - aNullableEnum:(AnEnum)aNullableEnum - aNullableString:(nullable NSString *)aNullableString { - AllNullableTypes* pigeonResult = [[AllNullableTypes alloc] init]; + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableList:(nullable NSArray *)aNullableList + aNullableMap:(nullable NSDictionary *)aNullableMap + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations: + (nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(AnEnum)aNullableEnum + aNullableString:(nullable NSString *)aNullableString { + AllNullableTypes *pigeonResult = [[AllNullableTypes alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; pigeonResult.aNullableDouble = aNullableDouble; @@ -195,7 +196,7 @@ - (NSArray *)toList { @implementation AllNullableTypesWrapper + (instancetype)makeWithValues:(AllNullableTypes *)values { - AllNullableTypesWrapper* pigeonResult = [[AllNullableTypesWrapper alloc] init]; + AllNullableTypesWrapper *pigeonResult = [[AllNullableTypesWrapper alloc] init]; pigeonResult.values = values; return pigeonResult; } @@ -217,7 +218,7 @@ - (NSArray *)toList { @implementation TestMessage + (instancetype)makeWithTestList:(nullable NSArray *)testList { - TestMessage* pigeonResult = [[TestMessage alloc] init]; + TestMessage *pigeonResult = [[TestMessage alloc] init]; pigeonResult.testList = testList; return pigeonResult; } @@ -241,13 +242,13 @@ @interface HostIntegrationCoreApiCodecReader : FlutterStandardReader @implementation HostIntegrationCoreApiCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: + case 128: return [AllNullableTypes fromList:[self readValue]]; - case 129: + case 129: return [AllNullableTypesWrapper fromList:[self readValue]]; - case 130: + case 130: return [AllTypes fromList:[self readValue]]; - case 131: + case 131: return [TestMessage fromList:[self readValue]]; default: return [super readValueOfType:type]; @@ -292,23 +293,26 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - HostIntegrationCoreApiCodecReaderWriter *readerWriter = [[HostIntegrationCoreApiCodecReaderWriter alloc] init]; + HostIntegrationCoreApiCodecReaderWriter *readerWriter = + [[HostIntegrationCoreApiCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; } -void HostIntegrationCoreApiSetup(id binaryMessenger, NSObject *api) { +void HostIntegrationCoreApiSetup(id binaryMessenger, + NSObject *api) { /// A no-op function taking no arguments and returning no value, to sanity /// test basic calling. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.noop" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.noop" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -320,13 +324,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAllTypes" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAllTypes" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -340,13 +346,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns an error, to test error handling. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwError" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwError" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -358,13 +366,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Responds with an error from an async void function. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwErrorFromVoid" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwErrorFromVoid" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -376,13 +386,14 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoInt" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoInt" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); @@ -396,13 +407,14 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoDouble" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoDouble" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); @@ -416,13 +428,14 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed in boolean. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoBool" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoBool" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); @@ -436,13 +449,14 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoString" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -456,13 +470,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed in Uint8List. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoUint8List" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoUint8List" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -476,13 +492,14 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed in generic Object. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoObject" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoObject" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -496,13 +513,14 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed list, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoList" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoList" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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_aList = GetNullableObjectAtIndex(args, 0); @@ -516,13 +534,14 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed map, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoMap" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoMap" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -536,13 +555,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAllNullableTypes" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAllNullableTypes" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -557,13 +578,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; AllNullableTypesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); @@ -578,18 +601,21 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; - AllNullableTypesWrapper *output = [api createNestedObjectWithNullableString:arg_nullableString error:&error]; + AllNullableTypesWrapper *output = + [api createNestedObjectWithNullableString:arg_nullableString error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -598,20 +624,26 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns passed in arguments of multiple types. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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 { @@ -620,13 +652,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns passed in int. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableInt" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableInt" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -640,13 +674,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns passed in double. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableDouble" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableDouble" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -660,13 +696,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed in boolean. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableBool" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableBool" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -680,13 +718,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed in string. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableString" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -700,18 +740,21 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed in Uint8List. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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 { @@ -720,13 +763,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed in generic Object. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableObject" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableObject" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -740,13 +785,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed list, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableList" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableList" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -760,13 +807,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed map, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableMap" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableMap" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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); @@ -781,13 +830,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO /// A no-op function taking no arguments and returning no value, to sanity /// test basic asynchronous calling. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.noopAsync" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.noopAsync" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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)); @@ -799,19 +850,22 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns passed in int asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncInt" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncInt" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [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]; @@ -819,19 +873,22 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns passed in double asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncDouble" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncDouble" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [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]; @@ -839,19 +896,22 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed in boolean asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncBool" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncBool" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [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]; @@ -859,19 +919,22 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed string asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncString" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -879,19 +942,23 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed in Uint8List asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncUint8List" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncUint8List" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -899,19 +966,22 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed in generic Object asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncObject" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncObject" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -919,19 +989,22 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed list, to test serialization and deserialization asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncList" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncList" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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_aList = GetNullableObjectAtIndex(args, 0); - [api echoAsyncList:arg_aList completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncList:arg_aList + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -939,19 +1012,23 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed map, to test serialization and deserialization asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncMap" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncMap" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -959,13 +1036,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Responds with an error from an async function returning a value. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncError" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncError" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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)); @@ -977,13 +1056,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Responds with an error from an async void function. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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)); @@ -995,19 +1076,22 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed object, to test async serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncAllTypes" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncAllTypes" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1015,19 +1099,24 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed object, to test serialization and deserialization. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + @"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1035,19 +1124,22 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns passed in int asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableInt" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableInt" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1055,19 +1147,22 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns passed in double asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1075,19 +1170,22 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed in boolean asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1095,19 +1193,22 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed string asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1115,19 +1216,23 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed in Uint8List asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1135,19 +1240,22 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed in generic Object asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1155,19 +1263,22 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed list, to test serialization and deserialization asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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_aList = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableList:arg_aList completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api echoAsyncNullableList:arg_aList + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; @@ -1175,32 +1286,38 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } /// Returns the passed map, to test serialization and deserialization asynchronously. { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableMap" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableMap" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterNoop" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterNoop" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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)); @@ -1211,15 +1328,18 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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)); }]; }]; @@ -1228,13 +1348,15 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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)); @@ -1245,306 +1367,369 @@ void HostIntegrationCoreApiSetup(id binaryMessenger, NSO } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + @"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoBool" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoBool" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); - [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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoInt" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoInt" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); - [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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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; NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); - [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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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_aList = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoUint8List:arg_aList completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoUint8List:arg_aList + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoList" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoList" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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_aList = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoList:arg_aList completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoList:arg_aList + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoMap" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoMap" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableDouble" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableDouble" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableString" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableString" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableUint8List" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + @"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableUint8List" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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_aList = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableUint8List:arg_aList completion:^(FlutterStandardTypedData *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableUint8List:arg_aList + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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_aList = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableList:arg_aList completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { - callback(wrapResult(output, error)); - }]; + [api callFlutterEchoNullableList:arg_aList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; }]; } else { [channel setMessageHandler:nil]; } } { - FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap" + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap" binaryMessenger:binaryMessenger - codec:HostIntegrationCoreApiGetCodec()]; + codec:HostIntegrationCoreApiGetCodec()]; 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]; @@ -1556,13 +1741,13 @@ @interface FlutterIntegrationCoreApiCodecReader : FlutterStandardReader @implementation FlutterIntegrationCoreApiCodecReader - (nullable id)readValueOfType:(UInt8)type { switch (type) { - case 128: + case 128: return [AllNullableTypes fromList:[self readValue]]; - case 129: + case 129: return [AllNullableTypesWrapper fromList:[self readValue]]; - case 130: + case 130: return [AllTypes fromList:[self readValue]]; - case 131: + case 131: return [TestMessage fromList:[self readValue]]; default: return [super readValueOfType:type]; @@ -1607,7 +1792,8 @@ - (FlutterStandardReader *)readerWithData:(NSData *)data { static FlutterStandardMessageCodec *sSharedObject = nil; static dispatch_once_t sPred = 0; dispatch_once(&sPred, ^{ - FlutterIntegrationCoreApiCodecReaderWriter *readerWriter = [[FlutterIntegrationCoreApiCodecReaderWriter alloc] init]; + FlutterIntegrationCoreApiCodecReaderWriter *readerWriter = + [[FlutterIntegrationCoreApiCodecReaderWriter alloc] init]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; }); return sSharedObject; @@ -1627,243 +1813,273 @@ - (instancetype)initWithBinaryMessenger:(NSObject *)bina return self; } - (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.noop" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:nil reply:^(id reply) { - completion(nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil + reply:^(id reply) { + completion(nil); + }]; } - (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.throwError" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:nil reply:^(id reply) { - id output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil + reply:^(id reply) { + id output = reply; + completion(output, nil); + }]; } - (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.throwErrorFromVoid" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:nil reply:^(id reply) { - completion(nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil + reply:^(id reply) { + completion(nil); + }]; } -- (void)echoAllTypes:(AllTypes *)arg_everything completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoAllTypes:(AllTypes *)arg_everything + completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllTypes" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(id reply) { - AllTypes *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + reply:^(id reply) { + AllTypes *output = reply; + completion(output, nil); + }]; } -- (void)echoAllNullableTypes:(AllNullableTypes *)arg_everything completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoAllNullableTypes:(AllNullableTypes *)arg_everything + completion: + (void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_everything ?: [NSNull null]] reply:^(id reply) { - AllNullableTypes *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + reply:^(id reply) { + AllNullableTypes *output = reply; + completion(output, nil); + }]; } -- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool anInt:(nullable NSNumber *)arg_aNullableInt aString:(nullable NSString *)arg_aNullableString completion:(void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel - messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], arg_aNullableString ?: [NSNull null]] reply:^(id reply) { - AllNullableTypes *output = reply; - completion(output, nil); - }]; +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool + anInt:(nullable NSNumber *)arg_aNullableInt + aString:(nullable NSString *)arg_aNullableString + completion:(void (^)(AllNullableTypes *_Nullable, + FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName: + @"dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ + arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], + arg_aNullableString ?: [NSNull null] + ] + reply:^(id reply) { + AllNullableTypes *output = reply; + completion(output, nil); + }]; } -- (void)echoBool:(NSNumber *)arg_aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoBool:(NSNumber *)arg_aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoBool" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_aBool ?: [NSNull null]] reply:^(id reply) { - NSNumber *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] + reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; } -- (void)echoInt:(NSNumber *)arg_anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoInt:(NSNumber *)arg_anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoInt" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_anInt ?: [NSNull null]] reply:^(id reply) { - NSNumber *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] + reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; } -- (void)echoDouble:(NSNumber *)arg_aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoDouble:(NSNumber *)arg_aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoDouble" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_aDouble ?: [NSNull null]] reply:^(id reply) { - NSNumber *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] + reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; } -- (void)echoString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoString:(NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoString" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(id reply) { - NSString *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(id reply) { + NSString *output = reply; + completion(output, nil); + }]; } -- (void)echoUint8List:(FlutterStandardTypedData *)arg_aList completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoUint8List:(FlutterStandardTypedData *)arg_aList + completion: + (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoUint8List" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_aList ?: [NSNull null]] reply:^(id reply) { - FlutterStandardTypedData *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aList ?: [NSNull null] ] + reply:^(id reply) { + FlutterStandardTypedData *output = reply; + completion(output, nil); + }]; } -- (void)echoList:(NSArray *)arg_aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoList:(NSArray *)arg_aList + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoList" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_aList ?: [NSNull null]] reply:^(id reply) { - NSArray *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aList ?: [NSNull null] ] + reply:^(id reply) { + NSArray *output = reply; + completion(output, nil); + }]; } -- (void)echoMap:(NSDictionary *)arg_aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoMap:(NSDictionary *)arg_aMap + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoMap" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_aMap ?: [NSNull null]] reply:^(id reply) { - NSDictionary *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] + reply:^(id reply) { + NSDictionary *output = reply; + completion(output, nil); + }]; } -- (void)echoNullableBool:(nullable NSNumber *)arg_aBool completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoNullableBool:(nullable NSNumber *)arg_aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_aBool ?: [NSNull null]] reply:^(id reply) { - NSNumber *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] + reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; } -- (void)echoNullableInt:(nullable NSNumber *)arg_anInt completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoNullableInt:(nullable NSNumber *)arg_anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableInt" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_anInt ?: [NSNull null]] reply:^(id reply) { - NSNumber *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] + reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; } -- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_aDouble ?: [NSNull null]] reply:^(id reply) { - NSNumber *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] + reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; } -- (void)echoNullableString:(nullable NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoNullableString:(nullable NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(id reply) { - NSString *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(id reply) { + NSString *output = reply; + completion(output, nil); + }]; } -- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_aList completion:(void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_aList + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_aList ?: [NSNull null]] reply:^(id reply) { - FlutterStandardTypedData *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aList ?: [NSNull null] ] + reply:^(id reply) { + FlutterStandardTypedData *output = reply; + completion(output, nil); + }]; } -- (void)echoNullableList:(nullable NSArray *)arg_aList completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoNullableList:(nullable NSArray *)arg_aList + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_aList ?: [NSNull null]] reply:^(id reply) { - NSArray *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aList ?: [NSNull null] ] + reply:^(id reply) { + NSArray *output = reply; + completion(output, nil); + }]; } -- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableMap" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_aMap ?: [NSNull null]] reply:^(id reply) { - NSDictionary *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] + reply:^(id reply) { + NSDictionary *output = reply; + completion(output, nil); + }]; } - (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:nil reply:^(id reply) { - completion(nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil + reply:^(id reply) { + completion(nil); + }]; } -- (void)echoAsyncString:(NSString *)arg_aString completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoAsyncString:(NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString" - binaryMessenger:self.binaryMessenger - codec:FlutterIntegrationCoreApiGetCodec()]; - [channel sendMessage:@[arg_aString ?: [NSNull null]] reply:^(id reply) { - NSString *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(id reply) { + NSString *output = reply; + completion(output, nil); + }]; } @end @@ -1873,15 +2089,16 @@ - (void)echoAsyncString:(NSString *)arg_aString completion:(void (^)(NSString *_ return sSharedObject; } -void HostTrivialApiSetup(id binaryMessenger, NSObject *api) { +void HostTrivialApiSetup(id binaryMessenger, + NSObject *api) { { FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostTrivialApi.noop" - binaryMessenger:binaryMessenger - codec:HostTrivialApiGetCodec()]; + [[FlutterBasicMessageChannel alloc] initWithName:@"dev.flutter.pigeon.HostTrivialApi.noop" + binaryMessenger:binaryMessenger + codec:HostTrivialApiGetCodec()]; 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]; @@ -1901,18 +2118,19 @@ void HostTrivialApiSetup(id binaryMessenger, NSObject binaryMessenger, NSObject *api) { { FlutterBasicMessageChannel *channel = - [[FlutterBasicMessageChannel alloc] - initWithName:@"dev.flutter.pigeon.HostSmallApi.echo" - binaryMessenger:binaryMessenger - codec:HostSmallApiGetCodec()]; + [[FlutterBasicMessageChannel alloc] initWithName:@"dev.flutter.pigeon.HostSmallApi.echo" + binaryMessenger:binaryMessenger + codec:HostSmallApiGetCodec()]; 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]; @@ -1920,12 +2138,13 @@ void HostSmallApiSetup(id binaryMessenger, NSObject *)bina } return self; } -- (void)echoWrappedList:(TestMessage *)arg_msg completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion { - FlutterBasicMessageChannel *channel = - [FlutterBasicMessageChannel +- (void)echoWrappedList:(TestMessage *)arg_msg + completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel messageChannelWithName:@"dev.flutter.pigeon.FlutterSmallApi.echoWrappedList" - binaryMessenger:self.binaryMessenger - codec:FlutterSmallApiGetCodec()]; - [channel sendMessage:@[arg_msg ?: [NSNull null]] reply:^(id reply) { - TestMessage *output = reply; - completion(output, nil); - }]; + binaryMessenger:self.binaryMessenger + codec:FlutterSmallApiGetCodec()]; + [channel sendMessage:@[ arg_msg ?: [NSNull null] ] + reply:^(id reply) { + TestMessage *output = reply; + completion(output, nil); + }]; } @end - 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 61ec8c13b21..a4f08bc5f3e 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 @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// +// // Autogenerated from Pigeon (v9.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import @@ -167,11 +167,12 @@ class AllNullableTypes { aNullableList: result[7] as List?, aNullableMap: result[8] as Map?, nullableNestedList: (result[9] as List?)?.cast?>(), - nullableMapWithAnnotations: (result[10] as Map?)?.cast(), - nullableMapWithObject: (result[11] as Map?)?.cast(), - aNullableEnum: result[12] != null - ? AnEnum.values[result[12]! as int] - : null, + nullableMapWithAnnotations: + (result[10] as Map?)?.cast(), + nullableMapWithObject: + (result[11] as Map?)?.cast(), + aNullableEnum: + result[12] != null ? AnEnum.values[result[12]! as int] : null, aNullableString: result[13] as String?, ); } @@ -244,13 +245,13 @@ class _HostIntegrationCoreApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return AllNullableTypes.decode(readValue(buffer)!); - case 129: + case 129: return AllNullableTypesWrapper.decode(readValue(buffer)!); - case 130: + case 130: return AllTypes.decode(readValue(buffer)!); - case 131: + case 131: return TestMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -276,8 +277,7 @@ class HostIntegrationCoreApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.noop', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -327,8 +327,7 @@ class HostIntegrationCoreApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.throwError', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -350,8 +349,7 @@ class HostIntegrationCoreApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.throwErrorFromVoid', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -593,7 +591,8 @@ class HostIntegrationCoreApi { } /// Returns the passed object, to test serialization and deserialization. - Future echoAllNullableTypes(AllNullableTypes? arg_everything) async { + Future echoAllNullableTypes( + AllNullableTypes? arg_everything) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAllNullableTypes', codec, binaryMessenger: _binaryMessenger); @@ -617,9 +616,11 @@ class HostIntegrationCoreApi { /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. - Future extractNestedNullableString(AllNullableTypesWrapper arg_wrapper) async { + Future extractNestedNullableString( + AllNullableTypesWrapper arg_wrapper) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_wrapper]) as List?; @@ -641,9 +642,11 @@ class HostIntegrationCoreApi { /// Returns the inner `aString` value from the wrapped object, to test /// sending of nested objects. - Future createNestedNullableString(String? arg_nullableString) async { + Future createNestedNullableString( + String? arg_nullableString) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_nullableString]) as List?; @@ -669,12 +672,15 @@ class HostIntegrationCoreApi { } /// Returns passed in arguments of multiple types. - Future sendMultipleNullableTypes(bool? arg_aNullableBool, int? arg_aNullableInt, String? arg_aNullableString) async { + Future sendMultipleNullableTypes(bool? arg_aNullableBool, + int? arg_aNullableInt, String? arg_aNullableString) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_aNullableBool, arg_aNullableInt, arg_aNullableString]) as List?; + final List? replyList = await channel.send( + [arg_aNullableBool, arg_aNullableInt, arg_aNullableString]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -789,9 +795,11 @@ class HostIntegrationCoreApi { } /// Returns the passed in Uint8List. - Future echoNullableUint8List(Uint8List? arg_aNullableUint8List) async { + Future echoNullableUint8List( + Uint8List? arg_aNullableUint8List) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aNullableUint8List]) as List?; @@ -835,7 +843,8 @@ class HostIntegrationCoreApi { } /// Returns the passed list, to test serialization and deserialization. - Future?> echoNullableList(List? arg_aNullableList) async { + Future?> echoNullableList( + List? arg_aNullableList) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableList', codec, binaryMessenger: _binaryMessenger); @@ -858,7 +867,8 @@ class HostIntegrationCoreApi { } /// Returns the passed map, to test serialization and deserialization. - Future?> echoNullableMap(Map? arg_aNullableMap) async { + Future?> echoNullableMap( + Map? arg_aNullableMap) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableMap', codec, binaryMessenger: _binaryMessenger); @@ -886,8 +896,7 @@ class HostIntegrationCoreApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.noopAsync', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1101,7 +1110,8 @@ class HostIntegrationCoreApi { } /// Returns the passed map, to test serialization and deserialization asynchronously. - Future> echoAsyncMap(Map arg_aMap) async { + Future> echoAsyncMap( + Map arg_aMap) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncMap', codec, binaryMessenger: _binaryMessenger); @@ -1133,8 +1143,7 @@ class HostIntegrationCoreApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncError', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1154,10 +1163,10 @@ class HostIntegrationCoreApi { /// Responds with an error from an async void function. Future throwAsyncErrorFromVoid() async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1203,9 +1212,11 @@ class HostIntegrationCoreApi { } /// Returns the passed object, to test serialization and deserialization. - Future echoAsyncNullableAllNullableTypes(AllNullableTypes? arg_everything) async { + Future echoAsyncNullableAllNullableTypes( + AllNullableTypes? arg_everything) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_everything]) as List?; @@ -1251,7 +1262,8 @@ class HostIntegrationCoreApi { /// Returns passed in double asynchronously. Future echoAsyncNullableDouble(double? arg_aDouble) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aDouble]) as List?; @@ -1274,7 +1286,8 @@ class HostIntegrationCoreApi { /// Returns the passed in boolean asynchronously. Future echoAsyncNullableBool(bool? arg_aBool) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aBool]) as List?; @@ -1297,7 +1310,8 @@ class HostIntegrationCoreApi { /// Returns the passed string asynchronously. Future echoAsyncNullableString(String? arg_aString) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aString]) as List?; @@ -1318,9 +1332,11 @@ class HostIntegrationCoreApi { } /// Returns the passed in Uint8List asynchronously. - Future echoAsyncNullableUint8List(Uint8List? arg_aUint8List) async { + Future echoAsyncNullableUint8List( + Uint8List? arg_aUint8List) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aUint8List]) as List?; @@ -1343,7 +1359,8 @@ class HostIntegrationCoreApi { /// Returns the passed in generic Object asynchronously. Future echoAsyncNullableObject(Object? arg_anObject) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_anObject]) as List?; @@ -1366,7 +1383,8 @@ class HostIntegrationCoreApi { /// Returns the passed list, to test serialization and deserialization asynchronously. Future?> echoAsyncNullableList(List? arg_aList) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aList]) as List?; @@ -1387,7 +1405,8 @@ class HostIntegrationCoreApi { } /// Returns the passed map, to test serialization and deserialization asynchronously. - Future?> echoAsyncNullableMap(Map? arg_aMap) async { + Future?> echoAsyncNullableMap( + Map? arg_aMap) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableMap', codec, binaryMessenger: _binaryMessenger); @@ -1413,8 +1432,7 @@ class HostIntegrationCoreApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterNoop', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1433,10 +1451,10 @@ class HostIntegrationCoreApi { Future callFlutterThrowError() async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1455,10 +1473,10 @@ class HostIntegrationCoreApi { Future callFlutterThrowErrorFromVoid() async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1477,7 +1495,8 @@ class HostIntegrationCoreApi { Future callFlutterEchoAllTypes(AllTypes arg_everything) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_everything]) as List?; @@ -1502,12 +1521,17 @@ class HostIntegrationCoreApi { } } - Future callFlutterSendMultipleNullableTypes(bool? arg_aNullableBool, int? arg_aNullableInt, String? arg_aNullableString) async { + Future callFlutterSendMultipleNullableTypes( + bool? arg_aNullableBool, + int? arg_aNullableInt, + String? arg_aNullableString) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_aNullableBool, arg_aNullableInt, arg_aNullableString]) as List?; + final List? replyList = await channel.send( + [arg_aNullableBool, arg_aNullableInt, arg_aNullableString]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1585,7 +1609,8 @@ class HostIntegrationCoreApi { Future callFlutterEchoDouble(double arg_aDouble) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aDouble]) as List?; @@ -1612,7 +1637,8 @@ class HostIntegrationCoreApi { Future callFlutterEchoString(String arg_aString) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aString]) as List?; @@ -1639,7 +1665,8 @@ class HostIntegrationCoreApi { Future callFlutterEchoUint8List(Uint8List arg_aList) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aList]) as List?; @@ -1691,7 +1718,8 @@ class HostIntegrationCoreApi { } } - Future> callFlutterEchoMap(Map arg_aMap) async { + Future> callFlutterEchoMap( + Map arg_aMap) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoMap', codec, binaryMessenger: _binaryMessenger); @@ -1720,7 +1748,8 @@ class HostIntegrationCoreApi { Future callFlutterEchoNullableBool(bool? arg_aBool) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aBool]) as List?; @@ -1742,7 +1771,8 @@ class HostIntegrationCoreApi { Future callFlutterEchoNullableInt(int? arg_anInt) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_anInt]) as List?; @@ -1764,7 +1794,8 @@ class HostIntegrationCoreApi { Future callFlutterEchoNullableDouble(double? arg_aDouble) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableDouble', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableDouble', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aDouble]) as List?; @@ -1786,7 +1817,8 @@ class HostIntegrationCoreApi { Future callFlutterEchoNullableString(String? arg_aString) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableString', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableString', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aString]) as List?; @@ -1806,9 +1838,11 @@ class HostIntegrationCoreApi { } } - Future callFlutterEchoNullableUint8List(Uint8List? arg_aList) async { + Future callFlutterEchoNullableUint8List( + Uint8List? arg_aList) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableUint8List', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableUint8List', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aList]) as List?; @@ -1828,9 +1862,11 @@ class HostIntegrationCoreApi { } } - Future?> callFlutterEchoNullableList(List? arg_aList) async { + Future?> callFlutterEchoNullableList( + List? arg_aList) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aList]) as List?; @@ -1850,9 +1886,11 @@ class HostIntegrationCoreApi { } } - Future?> callFlutterEchoNullableMap(Map? arg_aMap) async { + Future?> callFlutterEchoNullableMap( + Map? arg_aMap) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap', codec, + 'dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_aMap]) as List?; @@ -1897,13 +1935,13 @@ class _FlutterIntegrationCoreApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return AllNullableTypes.decode(readValue(buffer)!); - case 129: + case 129: return AllNullableTypesWrapper.decode(readValue(buffer)!); - case 130: + case 130: return AllTypes.decode(readValue(buffer)!); - case 131: + case 131: return TestMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1935,7 +1973,8 @@ 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 boolean, to test serialization and deserialization. bool echoBool(bool aBool); @@ -1986,7 +2025,8 @@ abstract class FlutterIntegrationCoreApi { /// Returns the passed in generic Object asynchronously. Future echoAsyncString(String aString); - static void setup(FlutterIntegrationCoreApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(FlutterIntegrationCoreApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FlutterIntegrationCoreApi.noop', codec, @@ -2017,7 +2057,8 @@ abstract class FlutterIntegrationCoreApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FlutterIntegrationCoreApi.throwErrorFromVoid', codec, + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.throwErrorFromVoid', + codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); @@ -2038,7 +2079,7 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllTypes was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllTypes was null.'); final List args = (message as List?)!; final AllTypes? arg_everything = (args[0] as AllTypes?); assert(arg_everything != null, @@ -2050,38 +2091,43 @@ abstract class FlutterIntegrationCoreApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes', codec, + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes', + codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes was null.'); + 'Argument for dev.flutter.pigeon.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?); assert(arg_everything != null, 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes was null, expected non-null AllNullableTypes.'); - final AllNullableTypes output = api.echoAllNullableTypes(arg_everything!); + final AllNullableTypes output = + api.echoAllNullableTypes(arg_everything!); return output; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes', codec, + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes', + codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes was null.'); + 'Argument for dev.flutter.pigeon.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?); - final AllNullableTypes output = api.sendMultipleNullableTypes(arg_aNullableBool, arg_aNullableInt, arg_aNullableString); + final AllNullableTypes output = api.sendMultipleNullableTypes( + arg_aNullableBool, arg_aNullableInt, arg_aNullableString); return output; }); } @@ -2095,7 +2141,7 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoBool was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoBool was null.'); final List args = (message as List?)!; final bool? arg_aBool = (args[0] as bool?); assert(arg_aBool != null, @@ -2114,7 +2160,7 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoInt was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoInt was null.'); final List args = (message as List?)!; final int? arg_anInt = (args[0] as int?); assert(arg_anInt != null, @@ -2133,7 +2179,7 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoDouble was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoDouble was null.'); final List args = (message as List?)!; final double? arg_aDouble = (args[0] as double?); assert(arg_aDouble != null, @@ -2152,7 +2198,7 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoString was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoString was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); assert(arg_aString != null, @@ -2171,7 +2217,7 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoUint8List was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoUint8List was null.'); final List args = (message as List?)!; final Uint8List? arg_aList = (args[0] as Uint8List?); assert(arg_aList != null, @@ -2190,9 +2236,10 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoList was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoList was null.'); final List args = (message as List?)!; - final List? arg_aList = (args[0] as List?)?.cast(); + final List? arg_aList = + (args[0] as List?)?.cast(); assert(arg_aList != null, 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoList was null, expected non-null List.'); final List output = api.echoList(arg_aList!); @@ -2209,9 +2256,10 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoMap was null.'); + 'Argument for dev.flutter.pigeon.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.FlutterIntegrationCoreApi.echoMap was null, expected non-null Map.'); final Map output = api.echoMap(arg_aMap!); @@ -2221,14 +2269,15 @@ abstract class FlutterIntegrationCoreApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool', codec, + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool', + codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool was null.'); final List args = (message as List?)!; final bool? arg_aBool = (args[0] as bool?); final bool? output = api.echoNullableBool(arg_aBool); @@ -2245,7 +2294,7 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableInt was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableInt was null.'); final List args = (message as List?)!; final int? arg_anInt = (args[0] as int?); final int? output = api.echoNullableInt(arg_anInt); @@ -2255,14 +2304,15 @@ abstract class FlutterIntegrationCoreApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble', codec, + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble', + codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble was null.'); final List args = (message as List?)!; final double? arg_aDouble = (args[0] as double?); final double? output = api.echoNullableDouble(arg_aDouble); @@ -2272,14 +2322,15 @@ abstract class FlutterIntegrationCoreApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString', codec, + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString', + codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); final String? output = api.echoNullableString(arg_aString); @@ -2289,14 +2340,15 @@ abstract class FlutterIntegrationCoreApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List', codec, + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List', + codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List was null.'); final List args = (message as List?)!; final Uint8List? arg_aList = (args[0] as Uint8List?); final Uint8List? output = api.echoNullableUint8List(arg_aList); @@ -2306,16 +2358,18 @@ abstract class FlutterIntegrationCoreApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList', codec, + 'dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList', + codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList was null.'); final List args = (message as List?)!; - final List? arg_aList = (args[0] as List?)?.cast(); + final List? arg_aList = + (args[0] as List?)?.cast(); final List? output = api.echoNullableList(arg_aList); return output; }); @@ -2330,9 +2384,10 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableMap was null.'); + 'Argument for dev.flutter.pigeon.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(); final Map? output = api.echoNullableMap(arg_aMap); return output; }); @@ -2361,7 +2416,7 @@ abstract class FlutterIntegrationCoreApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString was null.'); + 'Argument for dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString was null.'); final List args = (message as List?)!; final String? arg_aString = (args[0] as String?); assert(arg_aString != null, @@ -2389,8 +2444,7 @@ class HostTrivialApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostTrivialApi.noop', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2450,8 +2504,7 @@ class HostSmallApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostSmallApi.voidVoid', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2484,7 +2537,7 @@ class _FlutterSmallApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return TestMessage.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2508,7 +2561,7 @@ abstract class FlutterSmallApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FlutterSmallApi.echoWrappedList was null.'); + 'Argument for dev.flutter.pigeon.FlutterSmallApi.echoWrappedList was null.'); final List args = (message as List?)!; final TestMessage? arg_msg = (args[0] as TestMessage?); assert(arg_msg != null, 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 94350e81b5e..d390add4913 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 @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// +// // Autogenerated from Pigeon (v9.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -36,20 +36,38 @@ void AllTypes::set_an_int(int64_t value_arg) { an_int_ = 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_; } -void AllTypes::set_a_byte_array(const std::vector& value_arg) { a_byte_array_ = value_arg; } +const std::vector& AllTypes::a_byte_array() const { + return a_byte_array_; +} +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_; } -void AllTypes::set_a4_byte_array(const std::vector& value_arg) { a4_byte_array_ = value_arg; } +const std::vector& AllTypes::a4_byte_array() const { + return a4_byte_array_; +} +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_; } -void AllTypes::set_a8_byte_array(const std::vector& value_arg) { a8_byte_array_ = value_arg; } +const std::vector& AllTypes::a8_byte_array() const { + return a8_byte_array_; +} +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_; } -void AllTypes::set_a_float_array(const std::vector& value_arg) { a_float_array_ = value_arg; } +const std::vector& AllTypes::a_float_array() const { + return a_float_array_; +} +void AllTypes::set_a_float_array(const std::vector& value_arg) { + a_float_array_ = value_arg; +} const EncodableList& AllTypes::a_list() const { return a_list_; } -void AllTypes::set_a_list(const EncodableList& value_arg) { a_list_ = value_arg; } +void AllTypes::set_a_list(const EncodableList& value_arg) { + a_list_ = value_arg; +} const EncodableMap& AllTypes::a_map() const { return a_map_; } void AllTypes::set_a_map(const EncodableMap& value_arg) { a_map_ = value_arg; } @@ -58,7 +76,9 @@ 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_; } -void AllTypes::set_a_string(std::string_view value_arg) { a_string_ = value_arg; } +void AllTypes::set_a_string(std::string_view value_arg) { + a_string_ = value_arg; +} EncodableList AllTypes::ToEncodableList() const { EncodableList list; @@ -87,119 +107,265 @@ AllTypes::AllTypes(const EncodableList& list) { auto& encodable_an_int = list[1]; if (const int32_t* pointer_an_int = std::get_if(&encodable_an_int)) an_int_ = *pointer_an_int; - else if (const int64_t* pointer_an_int_64 = std::get_if(&encodable_an_int)) + else if (const int64_t* pointer_an_int_64 = + std::get_if(&encodable_an_int)) an_int_ = *pointer_an_int_64; auto& encodable_a_double = list[2]; - if (const double* pointer_a_double = std::get_if(&encodable_a_double)) { + if (const double* pointer_a_double = + std::get_if(&encodable_a_double)) { a_double_ = *pointer_a_double; } auto& encodable_a_byte_array = list[3]; - if (const std::vector* pointer_a_byte_array = std::get_if>(&encodable_a_byte_array)) { + if (const std::vector* pointer_a_byte_array = + std::get_if>(&encodable_a_byte_array)) { a_byte_array_ = *pointer_a_byte_array; } auto& encodable_a4_byte_array = list[4]; - if (const std::vector* pointer_a4_byte_array = std::get_if>(&encodable_a4_byte_array)) { + if (const std::vector* pointer_a4_byte_array = + std::get_if>(&encodable_a4_byte_array)) { a4_byte_array_ = *pointer_a4_byte_array; } auto& encodable_a8_byte_array = list[5]; - if (const std::vector* pointer_a8_byte_array = std::get_if>(&encodable_a8_byte_array)) { + if (const std::vector* pointer_a8_byte_array = + std::get_if>(&encodable_a8_byte_array)) { a8_byte_array_ = *pointer_a8_byte_array; } auto& encodable_a_float_array = list[6]; - if (const std::vector* pointer_a_float_array = std::get_if>(&encodable_a_float_array)) { + if (const std::vector* pointer_a_float_array = + std::get_if>(&encodable_a_float_array)) { a_float_array_ = *pointer_a_float_array; } auto& encodable_a_list = list[7]; - if (const EncodableList* pointer_a_list = std::get_if(&encodable_a_list)) { + if (const EncodableList* pointer_a_list = + std::get_if(&encodable_a_list)) { a_list_ = *pointer_a_list; } auto& encodable_a_map = list[8]; - if (const EncodableMap* pointer_a_map = std::get_if(&encodable_a_map)) { + if (const EncodableMap* pointer_a_map = + std::get_if(&encodable_a_map)) { a_map_ = *pointer_a_map; } auto& encodable_an_enum = list[9]; - if (const int32_t* pointer_an_enum = std::get_if(&encodable_an_enum)) an_enum_ = (AnEnum)*pointer_an_enum; + if (const int32_t* pointer_an_enum = std::get_if(&encodable_an_enum)) + an_enum_ = (AnEnum)*pointer_an_enum; auto& encodable_a_string = list[10]; - if (const std::string* pointer_a_string = std::get_if(&encodable_a_string)) { + if (const std::string* pointer_a_string = + std::get_if(&encodable_a_string)) { a_string_ = *pointer_a_string; } } // AllNullableTypes -const bool* AllNullableTypes::a_nullable_bool() const { return a_nullable_bool_ ? &(*a_nullable_bool_) : nullptr; } -void AllNullableTypes::set_a_nullable_bool(const bool* value_arg) { a_nullable_bool_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypes::set_a_nullable_bool(bool value_arg) { a_nullable_bool_ = value_arg; } +const bool* AllNullableTypes::a_nullable_bool() const { + return a_nullable_bool_ ? &(*a_nullable_bool_) : nullptr; +} +void AllNullableTypes::set_a_nullable_bool(const bool* value_arg) { + a_nullable_bool_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} +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; } -void AllNullableTypes::set_a_nullable_int(int64_t value_arg) { a_nullable_int_ = 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; +} +void AllNullableTypes::set_a_nullable_int(int64_t value_arg) { + a_nullable_int_ = 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; } -void AllNullableTypes::set_a_nullable_double(double value_arg) { a_nullable_double_ = 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; +} +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; } +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; +} -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; } +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; +} -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; } +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; +} -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; } +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; +} -const EncodableList* AllNullableTypes::a_nullable_list() const { return a_nullable_list_ ? &(*a_nullable_list_) : nullptr; } -void AllNullableTypes::set_a_nullable_list(const EncodableList* value_arg) { a_nullable_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypes::set_a_nullable_list(const EncodableList& value_arg) { a_nullable_list_ = value_arg; } +const EncodableList* AllNullableTypes::a_nullable_list() const { + return a_nullable_list_ ? &(*a_nullable_list_) : nullptr; +} +void AllNullableTypes::set_a_nullable_list(const EncodableList* value_arg) { + a_nullable_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} +void AllNullableTypes::set_a_nullable_list(const EncodableList& value_arg) { + a_nullable_list_ = value_arg; +} -const EncodableMap* AllNullableTypes::a_nullable_map() const { return a_nullable_map_ ? &(*a_nullable_map_) : nullptr; } -void AllNullableTypes::set_a_nullable_map(const EncodableMap* value_arg) { a_nullable_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypes::set_a_nullable_map(const EncodableMap& value_arg) { a_nullable_map_ = value_arg; } +const EncodableMap* AllNullableTypes::a_nullable_map() const { + return a_nullable_map_ ? &(*a_nullable_map_) : nullptr; +} +void AllNullableTypes::set_a_nullable_map(const EncodableMap* value_arg) { + a_nullable_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} +void AllNullableTypes::set_a_nullable_map(const EncodableMap& value_arg) { + a_nullable_map_ = 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; } +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; +} -const EncodableMap* AllNullableTypes::nullable_map_with_annotations() const { 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; } +const EncodableMap* AllNullableTypes::nullable_map_with_annotations() const { + 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; +} -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; } +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; +} -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; } -void AllNullableTypes::set_a_nullable_enum(const AnEnum& value_arg) { a_nullable_enum_ = 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; +} +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(std::string_view value_arg) { a_nullable_string_ = 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(std::string_view value_arg) { + a_nullable_string_ = value_arg; +} EncodableList AllNullableTypes::ToEncodableList() const { EncodableList list; list.reserve(14); - 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_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(a_nullable_list_ ? EncodableValue(*a_nullable_list_) : EncodableValue()); - list.push_back(a_nullable_map_ ? EncodableValue(*a_nullable_map_) : 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_ ? EncodableValue((int)(*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_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(a_nullable_list_ ? EncodableValue(*a_nullable_list_) + : EncodableValue()); + list.push_back(a_nullable_map_ ? EncodableValue(*a_nullable_map_) + : 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_ ? EncodableValue((int)(*a_nullable_enum_)) + : EncodableValue()); + list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_) + : EncodableValue()); return list; } @@ -207,66 +373,88 @@ AllNullableTypes::AllNullableTypes() {} AllNullableTypes::AllNullableTypes(const EncodableList& list) { auto& encodable_a_nullable_bool = list[0]; - if (const bool* pointer_a_nullable_bool = std::get_if(&encodable_a_nullable_bool)) { + if (const bool* pointer_a_nullable_bool = + std::get_if(&encodable_a_nullable_bool)) { a_nullable_bool_ = *pointer_a_nullable_bool; } auto& encodable_a_nullable_int = list[1]; - if (const int32_t* pointer_a_nullable_int = std::get_if(&encodable_a_nullable_int)) + if (const int32_t* pointer_a_nullable_int = + std::get_if(&encodable_a_nullable_int)) a_nullable_int_ = *pointer_a_nullable_int; - else if (const int64_t* pointer_a_nullable_int_64 = std::get_if(&encodable_a_nullable_int)) + else if (const int64_t* pointer_a_nullable_int_64 = + std::get_if(&encodable_a_nullable_int)) a_nullable_int_ = *pointer_a_nullable_int_64; auto& encodable_a_nullable_double = list[2]; - if (const double* pointer_a_nullable_double = std::get_if(&encodable_a_nullable_double)) { + if (const double* pointer_a_nullable_double = + std::get_if(&encodable_a_nullable_double)) { a_nullable_double_ = *pointer_a_nullable_double; } auto& encodable_a_nullable_byte_array = list[3]; - if (const std::vector* pointer_a_nullable_byte_array = std::get_if>(&encodable_a_nullable_byte_array)) { + if (const std::vector* pointer_a_nullable_byte_array = + std::get_if>(&encodable_a_nullable_byte_array)) { a_nullable_byte_array_ = *pointer_a_nullable_byte_array; } auto& encodable_a_nullable4_byte_array = list[4]; - if (const std::vector* pointer_a_nullable4_byte_array = std::get_if>(&encodable_a_nullable4_byte_array)) { + if (const std::vector* pointer_a_nullable4_byte_array = + std::get_if>( + &encodable_a_nullable4_byte_array)) { a_nullable4_byte_array_ = *pointer_a_nullable4_byte_array; } auto& encodable_a_nullable8_byte_array = list[5]; - if (const std::vector* pointer_a_nullable8_byte_array = std::get_if>(&encodable_a_nullable8_byte_array)) { + if (const std::vector* pointer_a_nullable8_byte_array = + std::get_if>( + &encodable_a_nullable8_byte_array)) { a_nullable8_byte_array_ = *pointer_a_nullable8_byte_array; } auto& encodable_a_nullable_float_array = list[6]; - if (const std::vector* pointer_a_nullable_float_array = std::get_if>(&encodable_a_nullable_float_array)) { + if (const std::vector* pointer_a_nullable_float_array = + std::get_if>(&encodable_a_nullable_float_array)) { a_nullable_float_array_ = *pointer_a_nullable_float_array; } auto& encodable_a_nullable_list = list[7]; - if (const EncodableList* pointer_a_nullable_list = std::get_if(&encodable_a_nullable_list)) { + if (const EncodableList* pointer_a_nullable_list = + std::get_if(&encodable_a_nullable_list)) { a_nullable_list_ = *pointer_a_nullable_list; } auto& encodable_a_nullable_map = list[8]; - if (const EncodableMap* pointer_a_nullable_map = std::get_if(&encodable_a_nullable_map)) { + if (const EncodableMap* pointer_a_nullable_map = + std::get_if(&encodable_a_nullable_map)) { a_nullable_map_ = *pointer_a_nullable_map; } auto& encodable_nullable_nested_list = list[9]; - if (const EncodableList* pointer_nullable_nested_list = std::get_if(&encodable_nullable_nested_list)) { + if (const EncodableList* pointer_nullable_nested_list = + std::get_if(&encodable_nullable_nested_list)) { nullable_nested_list_ = *pointer_nullable_nested_list; } auto& encodable_nullable_map_with_annotations = list[10]; - if (const EncodableMap* pointer_nullable_map_with_annotations = std::get_if(&encodable_nullable_map_with_annotations)) { + if (const EncodableMap* pointer_nullable_map_with_annotations = + std::get_if(&encodable_nullable_map_with_annotations)) { nullable_map_with_annotations_ = *pointer_nullable_map_with_annotations; } auto& encodable_nullable_map_with_object = list[11]; - if (const EncodableMap* pointer_nullable_map_with_object = std::get_if(&encodable_nullable_map_with_object)) { + if (const EncodableMap* pointer_nullable_map_with_object = + std::get_if(&encodable_nullable_map_with_object)) { nullable_map_with_object_ = *pointer_nullable_map_with_object; } auto& encodable_a_nullable_enum = list[12]; - if (const int32_t* pointer_a_nullable_enum = std::get_if(&encodable_a_nullable_enum)) a_nullable_enum_ = (AnEnum)*pointer_a_nullable_enum; + if (const int32_t* pointer_a_nullable_enum = + std::get_if(&encodable_a_nullable_enum)) + a_nullable_enum_ = (AnEnum)*pointer_a_nullable_enum; auto& encodable_a_nullable_string = list[13]; - if (const std::string* pointer_a_nullable_string = std::get_if(&encodable_a_nullable_string)) { + if (const std::string* pointer_a_nullable_string = + std::get_if(&encodable_a_nullable_string)) { a_nullable_string_ = *pointer_a_nullable_string; } } // AllNullableTypesWrapper -const AllNullableTypes& AllNullableTypesWrapper::values() const { return values_; } -void AllNullableTypesWrapper::set_values(const AllNullableTypes& value_arg) { values_ = value_arg; } +const AllNullableTypes& AllNullableTypesWrapper::values() const { + return values_; +} +void AllNullableTypesWrapper::set_values(const AllNullableTypes& value_arg) { + values_ = value_arg; +} EncodableList AllNullableTypesWrapper::ToEncodableList() const { EncodableList list; @@ -279,16 +467,24 @@ AllNullableTypesWrapper::AllNullableTypesWrapper() {} AllNullableTypesWrapper::AllNullableTypesWrapper(const EncodableList& list) { auto& encodable_values = list[0]; - if (const EncodableList* pointer_values = std::get_if(&encodable_values)) { + if (const EncodableList* pointer_values = + std::get_if(&encodable_values)) { values_ = AllNullableTypes(*pointer_values); } } // TestMessage -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; } -void TestMessage::set_test_list(const EncodableList& value_arg) { test_list_ = value_arg; } +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; +} +void TestMessage::set_test_list(const EncodableList& value_arg) { + test_list_ = value_arg; +} EncodableList TestMessage::ToEncodableList() const { EncodableList list; @@ -301,47 +497,67 @@ TestMessage::TestMessage() {} TestMessage::TestMessage(const EncodableList& list) { auto& encodable_test_list = list[0]; - if (const EncodableList* pointer_test_list = std::get_if(&encodable_test_list)) { + if (const EncodableList* pointer_test_list = + std::get_if(&encodable_test_list)) { test_list_ = *pointer_test_list; } } -HostIntegrationCoreApiCodecSerializer::HostIntegrationCoreApiCodecSerializer() {} -EncodableValue HostIntegrationCoreApiCodecSerializer::ReadValueOfType(uint8_t type, flutter::ByteStreamReader* stream) const { +HostIntegrationCoreApiCodecSerializer::HostIntegrationCoreApiCodecSerializer() { +} +EncodableValue HostIntegrationCoreApiCodecSerializer::ReadValueOfType( + uint8_t type, flutter::ByteStreamReader* stream) const { switch (type) { case 128: - return CustomEncodableValue(AllNullableTypes(std::get(ReadValue(stream)))); + return CustomEncodableValue( + AllNullableTypes(std::get(ReadValue(stream)))); case 129: - return CustomEncodableValue(AllNullableTypesWrapper(std::get(ReadValue(stream)))); + return CustomEncodableValue( + AllNullableTypesWrapper(std::get(ReadValue(stream)))); case 130: - return CustomEncodableValue(AllTypes(std::get(ReadValue(stream)))); + return CustomEncodableValue( + AllTypes(std::get(ReadValue(stream)))); case 131: - return CustomEncodableValue(TestMessage(std::get(ReadValue(stream)))); + return CustomEncodableValue( + TestMessage(std::get(ReadValue(stream)))); default: return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } } -void HostIntegrationCoreApiCodecSerializer::WriteValue(const EncodableValue& value, flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = std::get_if(&value)) { +void HostIntegrationCoreApiCodecSerializer::WriteValue( + const EncodableValue& value, flutter::ByteStreamWriter* stream) const { + if (const CustomEncodableValue* custom_value = + std::get_if(&value)) { if (custom_value->type() == typeid(AllNullableTypes)) { stream->WriteByte(128); - WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); return; } if (custom_value->type() == typeid(AllNullableTypesWrapper)) { 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(AllTypes)) { 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(TestMessage)) { stream->WriteByte(131); - WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); return; } } @@ -350,2169 +566,2913 @@ void HostIntegrationCoreApiCodecSerializer::WriteValue(const EncodableValue& val /// The codec used by HostIntegrationCoreApi. const flutter::StandardMessageCodec& HostIntegrationCoreApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance(&HostIntegrationCoreApiCodecSerializer::GetInstance()); -} - -// Sets up an instance of `HostIntegrationCoreApi` to handle messages through the `binary_messenger`. -void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, HostIntegrationCoreApi* api) { - { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.noop", &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())); - } - }); + return flutter::StandardMessageCodec::GetInstance( + &HostIntegrationCoreApiCodecSerializer::GetInstance()); +} + +// Sets up an instance of `HostIntegrationCoreApi` to handle messages through +// the `binary_messenger`. +void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, + HostIntegrationCoreApi* api) { + { + auto channel = std::make_unique>( + binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.noop", + &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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAllTypes", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAllTypes", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.throwError", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.throwError", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.throwErrorFromVoid", &GetCodec()); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.throwErrorFromVoid", + &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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoInt", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoInt", + &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoDouble", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoDouble", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoBool", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoBool", + &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoString", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoString", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoUint8List", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoUint8List", &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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoObject", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoObject", &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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoList", &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_list_arg = args.at(0); - if (encodable_a_list_arg.IsNull()) { - reply(WrapError("a_list_arg unexpectedly null.")); - return; - } - const auto& a_list_arg = std::get(encodable_a_list_arg); - ErrorOr output = api->EchoList(a_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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoList", + &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_list_arg = args.at(0); + if (encodable_a_list_arg.IsNull()) { + reply(WrapError("a_list_arg unexpectedly null.")); + return; + } + const auto& a_list_arg = + std::get(encodable_a_list_arg); + ErrorOr output = api->EchoList(a_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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoMap", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoMap", + &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAllNullableTypes", &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 = &(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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAllNullableTypes", + &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 = + &(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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString", + &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString", + &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes", + &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableInt", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableInt", + &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableDouble", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableDouble", + &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableBool", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableBool", + &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableString", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableString", + &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List", + &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableObject", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableObject", + &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableList", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableList", + &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableMap", &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())); - } - }); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableMap", + &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.noopAsync", &GetCodec()); + auto channel = std::make_unique>( + binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.noopAsync", + &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 { + 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()); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncInt", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncInt", &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncDouble", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncDouble", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncBool", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncBool", &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncString", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncString", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncUint8List", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncUint8List", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncObject", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncObject", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncList", &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_list_arg = args.at(0); - if (encodable_a_list_arg.IsNull()) { - reply(WrapError("a_list_arg unexpectedly null.")); - return; - } - const auto& a_list_arg = std::get(encodable_a_list_arg); - api->EchoAsyncList(a_list_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncList", &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_list_arg = args.at(0); + if (encodable_a_list_arg.IsNull()) { + reply(WrapError("a_list_arg unexpectedly null.")); + return; + } + const auto& a_list_arg = + std::get(encodable_a_list_arg); + api->EchoAsyncList( + a_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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncMap", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncMap", &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncError", &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()); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncError", + &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())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid", &GetCodec()); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid", + &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->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())); } - EncodableList wrapped; - wrapped.push_back(EncodableValue()); - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncAllTypes", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncAllTypes", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes", &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 = &(std::any_cast(std::get(encodable_everything_arg))); - api->EchoAsyncNullableAllNullableTypes(everything_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi." + "echoAsyncNullableAllNullableTypes", + &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 = + &(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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableInt", &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()); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableInt", + &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())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble", &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()); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble", + &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())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString", &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()); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString", + &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())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject", &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()); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject", + &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())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList", &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_list_arg = args.at(0); - const auto* a_list_arg = std::get_if(&encodable_a_list_arg); - api->EchoAsyncNullableList(a_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()); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList", + &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_list_arg = args.at(0); + const auto* a_list_arg = + std::get_if(&encodable_a_list_arg); + api->EchoAsyncNullableList( + a_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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableMap", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableMap", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterNoop", &GetCodec()); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterNoop", + &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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid", &GetCodec()); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi." + "callFlutterThrowErrorFromVoid", + &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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi." + "callFlutterSendMultipleNullableTypes", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoBool", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoBool", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoInt", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoInt", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List", &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_list_arg = args.at(0); - if (encodable_a_list_arg.IsNull()) { - reply(WrapError("a_list_arg unexpectedly null.")); - return; - } - const auto& a_list_arg = std::get>(encodable_a_list_arg); - api->CallFlutterEchoUint8List(a_list_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List", + &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_list_arg = args.at(0); + if (encodable_a_list_arg.IsNull()) { + reply(WrapError("a_list_arg unexpectedly null.")); + return; + } + const auto& a_list_arg = + std::get>(encodable_a_list_arg); + api->CallFlutterEchoUint8List( + a_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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoList", &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_list_arg = args.at(0); - if (encodable_a_list_arg.IsNull()) { - reply(WrapError("a_list_arg unexpectedly null.")); - return; - } - const auto& a_list_arg = std::get(encodable_a_list_arg); - api->CallFlutterEchoList(a_list_arg, [reply](ErrorOr&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoList", + &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_list_arg = args.at(0); + if (encodable_a_list_arg.IsNull()) { + reply(WrapError("a_list_arg unexpectedly null.")); + return; + } + const auto& a_list_arg = + std::get(encodable_a_list_arg); + api->CallFlutterEchoList( + a_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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoMap", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoMap", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt", &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()); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt", + &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())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableDouble", &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()); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi." + "callFlutterEchoNullableDouble", + &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())); } - reply(EncodableValue(std::move(wrapped))); }); - } catch (const std::exception& exception) { - reply(WrapError(exception.what())); - } - }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableString", &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; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi." + "callFlutterEchoNullableString", + &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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableUint8List", &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_list_arg = args.at(0); - const auto* a_list_arg = std::get_if>(&encodable_a_list_arg); - api->CallFlutterEchoNullableUint8List(a_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()); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi." + "callFlutterEchoNullableUint8List", + &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_list_arg = args.at(0); + const auto* a_list_arg = + std::get_if>(&encodable_a_list_arg); + api->CallFlutterEchoNullableUint8List( + a_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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList", &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_list_arg = args.at(0); - const auto* a_list_arg = std::get_if(&encodable_a_list_arg); - api->CallFlutterEchoNullableList(a_list_arg, [reply](ErrorOr>&& output) { - if (output.has_error()) { - reply(WrapError(output.error())); - return; + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList", + &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_list_arg = args.at(0); + const auto* a_list_arg = + std::get_if(&encodable_a_list_arg); + api->CallFlutterEchoNullableList( + a_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())); } - 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); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap", &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()); + auto channel = std::make_unique>( + binary_messenger, + "dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap", + &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())); } - 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.message()), - EncodableValue(error.code()), - error.details() - }); + return EncodableValue(EncodableList{EncodableValue(error.message()), + EncodableValue(error.code()), + error.details()}); } - -FlutterIntegrationCoreApiCodecSerializer::FlutterIntegrationCoreApiCodecSerializer() {} -EncodableValue FlutterIntegrationCoreApiCodecSerializer::ReadValueOfType(uint8_t type, flutter::ByteStreamReader* stream) const { +FlutterIntegrationCoreApiCodecSerializer:: + FlutterIntegrationCoreApiCodecSerializer() {} +EncodableValue FlutterIntegrationCoreApiCodecSerializer::ReadValueOfType( + uint8_t type, flutter::ByteStreamReader* stream) const { switch (type) { case 128: - return CustomEncodableValue(AllNullableTypes(std::get(ReadValue(stream)))); + return CustomEncodableValue( + AllNullableTypes(std::get(ReadValue(stream)))); case 129: - return CustomEncodableValue(AllNullableTypesWrapper(std::get(ReadValue(stream)))); + return CustomEncodableValue( + AllNullableTypesWrapper(std::get(ReadValue(stream)))); case 130: - return CustomEncodableValue(AllTypes(std::get(ReadValue(stream)))); + return CustomEncodableValue( + AllTypes(std::get(ReadValue(stream)))); case 131: - return CustomEncodableValue(TestMessage(std::get(ReadValue(stream)))); + return CustomEncodableValue( + TestMessage(std::get(ReadValue(stream)))); default: return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } } -void FlutterIntegrationCoreApiCodecSerializer::WriteValue(const EncodableValue& value, flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = std::get_if(&value)) { +void FlutterIntegrationCoreApiCodecSerializer::WriteValue( + const EncodableValue& value, flutter::ByteStreamWriter* stream) const { + if (const CustomEncodableValue* custom_value = + std::get_if(&value)) { if (custom_value->type() == typeid(AllNullableTypes)) { stream->WriteByte(128); - WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); return; } if (custom_value->type() == typeid(AllNullableTypesWrapper)) { 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(AllTypes)) { 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(TestMessage)) { stream->WriteByte(131); - WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); return; } } flutter::StandardCodecSerializer::WriteValue(value, stream); } -// Generated class from Pigeon that represents Flutter messages that can be called from C++. -FlutterIntegrationCoreApi::FlutterIntegrationCoreApi(flutter::BinaryMessenger* binary_messenger) { +// Generated class from Pigeon that represents Flutter messages that can be +// called from C++. +FlutterIntegrationCoreApi::FlutterIntegrationCoreApi( + flutter::BinaryMessenger* binary_messenger) { this->binary_messenger_ = binary_messenger; } const flutter::StandardMessageCodec& FlutterIntegrationCoreApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance(&FlutterIntegrationCoreApiCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance( + &FlutterIntegrationCoreApiCodecSerializer::GetInstance()); } -void FlutterIntegrationCoreApi::Noop(std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.noop", &GetCodec()); +void FlutterIntegrationCoreApi::Noop( + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.noop", + &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel->Send(encoded_api_arguments, [on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - on_success(); - }); + channel->Send( + encoded_api_arguments, + [on_success = std::move(on_success), on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { on_success(); }); } -void FlutterIntegrationCoreApi::ThrowError(std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.throwError", &GetCodec()); +void FlutterIntegrationCoreApi::ThrowError( + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.throwError", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel->Send(encoded_api_arguments, [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* return_value = &encodable_return_value; - on_success(return_value); - }); + channel->Send( + encoded_api_arguments, + [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* return_value = &encodable_return_value; + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::ThrowErrorFromVoid(std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.throwErrorFromVoid", &GetCodec()); +void FlutterIntegrationCoreApi::ThrowErrorFromVoid( + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.throwErrorFromVoid", + &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel->Send(encoded_api_arguments, [on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - on_success(); - }); + channel->Send( + encoded_api_arguments, + [on_success = std::move(on_success), on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { on_success(); }); } -void FlutterIntegrationCoreApi::EchoAllTypes(const AllTypes& everything_arg, std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllTypes", &GetCodec()); +void FlutterIntegrationCoreApi::EchoAllTypes( + const AllTypes& everything_arg, + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllTypes", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(everything_arg.ToEncodableList()), - }); - channel->Send(encoded_api_arguments, [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& return_value = std::any_cast(std::get(encodable_return_value)); - on_success(return_value); + EncodableValue(everything_arg.ToEncodableList()), }); + channel->Send( + encoded_api_arguments, + [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& return_value = std::any_cast( + std::get(encodable_return_value)); + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::EchoAllNullableTypes(const AllNullableTypes& everything_arg, std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes", &GetCodec()); +void FlutterIntegrationCoreApi::EchoAllNullableTypes( + const AllNullableTypes& everything_arg, + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes", + &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(everything_arg.ToEncodableList()), - }); - channel->Send(encoded_api_arguments, [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& return_value = std::any_cast(std::get(encodable_return_value)); - on_success(return_value); + EncodableValue(everything_arg.ToEncodableList()), }); + channel->Send( + encoded_api_arguments, + [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& return_value = std::any_cast( + std::get(encodable_return_value)); + on_success(return_value); + }); } -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) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes", &GetCodec()); +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) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes", + &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, [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& return_value = std::any_cast(std::get(encodable_return_value)); - on_success(return_value); + 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, + [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& return_value = std::any_cast( + std::get(encodable_return_value)); + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::EchoBool(bool a_bool_arg, std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoBool", &GetCodec()); +void FlutterIntegrationCoreApi::EchoBool( + bool a_bool_arg, std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoBool", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_bool_arg), - }); - channel->Send(encoded_api_arguments, [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& return_value = std::get(encodable_return_value); - on_success(return_value); + EncodableValue(a_bool_arg), }); + channel->Send( + encoded_api_arguments, + [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& return_value = std::get(encodable_return_value); + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::EchoInt(int64_t an_int_arg, std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoInt", &GetCodec()); +void FlutterIntegrationCoreApi::EchoInt( + int64_t an_int_arg, std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoInt", + &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(an_int_arg), - }); - channel->Send(encoded_api_arguments, [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 int64_t return_value = encodable_return_value.LongValue(); - on_success(return_value); + EncodableValue(an_int_arg), }); + channel->Send( + encoded_api_arguments, + [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 int64_t return_value = encodable_return_value.LongValue(); + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::EchoDouble(double a_double_arg, std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoDouble", &GetCodec()); +void FlutterIntegrationCoreApi::EchoDouble( + double a_double_arg, std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoDouble", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_double_arg), - }); - channel->Send(encoded_api_arguments, [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& return_value = std::get(encodable_return_value); - on_success(return_value); + EncodableValue(a_double_arg), }); + channel->Send( + encoded_api_arguments, + [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& return_value = std::get(encodable_return_value); + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::EchoString(const std::string& a_string_arg, std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoString", &GetCodec()); +void FlutterIntegrationCoreApi::EchoString( + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoString", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), - }); - channel->Send(encoded_api_arguments, [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& return_value = std::get(encodable_return_value); - on_success(return_value); + EncodableValue(a_string_arg), }); + channel->Send( + encoded_api_arguments, + [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& return_value = + std::get(encodable_return_value); + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::EchoUint8List(const std::vector& a_list_arg, std::function&)>&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoUint8List", &GetCodec()); +void FlutterIntegrationCoreApi::EchoUint8List( + const std::vector& a_list_arg, + std::function&)>&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoUint8List", + &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_list_arg), - }); - channel->Send(encoded_api_arguments, [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& return_value = std::get>(encodable_return_value); - on_success(return_value); + EncodableValue(a_list_arg), }); + channel->Send( + encoded_api_arguments, + [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& return_value = + std::get>(encodable_return_value); + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::EchoList(const EncodableList& a_list_arg, std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoList", &GetCodec()); +void FlutterIntegrationCoreApi::EchoList( + const EncodableList& a_list_arg, + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoList", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_list_arg), - }); - channel->Send(encoded_api_arguments, [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& return_value = std::get(encodable_return_value); - on_success(return_value); + EncodableValue(a_list_arg), }); + channel->Send( + encoded_api_arguments, + [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& return_value = + std::get(encodable_return_value); + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::EchoMap(const EncodableMap& a_map_arg, std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoMap", &GetCodec()); +void FlutterIntegrationCoreApi::EchoMap( + const EncodableMap& a_map_arg, + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoMap", + &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_map_arg), - }); - channel->Send(encoded_api_arguments, [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& return_value = std::get(encodable_return_value); - on_success(return_value); + EncodableValue(a_map_arg), }); + channel->Send( + encoded_api_arguments, + [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& return_value = + std::get(encodable_return_value); + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::EchoNullableBool(const bool* a_bool_arg, std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool", &GetCodec()); +void FlutterIntegrationCoreApi::EchoNullableBool( + const bool* a_bool_arg, std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool", + &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_bool_arg ? EncodableValue(*a_bool_arg) : EncodableValue(), - }); - channel->Send(encoded_api_arguments, [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* return_value = std::get_if(&encodable_return_value); - on_success(return_value); + a_bool_arg ? EncodableValue(*a_bool_arg) : EncodableValue(), }); + channel->Send( + encoded_api_arguments, + [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* return_value = std::get_if(&encodable_return_value); + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::EchoNullableInt(const int64_t* an_int_arg, std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableInt", &GetCodec()); +void FlutterIntegrationCoreApi::EchoNullableInt( + const int64_t* an_int_arg, std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableInt", + &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - an_int_arg ? EncodableValue(*an_int_arg) : EncodableValue(), - }); - channel->Send(encoded_api_arguments, [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 int64_t return_value_value = encodable_return_value.IsNull() ? 0 : encodable_return_value.LongValue(); - const auto* return_value = encodable_return_value.IsNull() ? nullptr : &return_value_value; - on_success(return_value); + an_int_arg ? EncodableValue(*an_int_arg) : EncodableValue(), }); + channel->Send( + encoded_api_arguments, + [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 int64_t return_value_value = + encodable_return_value.IsNull() + ? 0 + : encodable_return_value.LongValue(); + const auto* return_value = + encodable_return_value.IsNull() ? nullptr : &return_value_value; + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::EchoNullableDouble(const double* a_double_arg, std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble", &GetCodec()); +void FlutterIntegrationCoreApi::EchoNullableDouble( + const double* a_double_arg, std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble", + &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_double_arg ? EncodableValue(*a_double_arg) : EncodableValue(), - }); - channel->Send(encoded_api_arguments, [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* return_value = std::get_if(&encodable_return_value); - on_success(return_value); + a_double_arg ? EncodableValue(*a_double_arg) : EncodableValue(), }); + channel->Send( + encoded_api_arguments, + [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* return_value = std::get_if(&encodable_return_value); + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::EchoNullableString(const std::string* a_string_arg, std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString", &GetCodec()); +void FlutterIntegrationCoreApi::EchoNullableString( + const std::string* a_string_arg, + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString", + &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), - }); - channel->Send(encoded_api_arguments, [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* return_value = std::get_if(&encodable_return_value); - on_success(return_value); + a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(), }); + channel->Send( + encoded_api_arguments, + [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* return_value = + std::get_if(&encodable_return_value); + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::EchoNullableUint8List(const std::vector* a_list_arg, std::function*)>&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List", &GetCodec()); +void FlutterIntegrationCoreApi::EchoNullableUint8List( + const std::vector* a_list_arg, + std::function*)>&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List", + &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_list_arg ? EncodableValue(*a_list_arg) : EncodableValue(), - }); - channel->Send(encoded_api_arguments, [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* return_value = std::get_if>(&encodable_return_value); - on_success(return_value); + a_list_arg ? EncodableValue(*a_list_arg) : EncodableValue(), }); + channel->Send( + encoded_api_arguments, + [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* return_value = + std::get_if>(&encodable_return_value); + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::EchoNullableList(const EncodableList* a_list_arg, std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList", &GetCodec()); +void FlutterIntegrationCoreApi::EchoNullableList( + const EncodableList* a_list_arg, + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList", + &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_list_arg ? EncodableValue(*a_list_arg) : EncodableValue(), - }); - channel->Send(encoded_api_arguments, [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* return_value = std::get_if(&encodable_return_value); - on_success(return_value); + a_list_arg ? EncodableValue(*a_list_arg) : EncodableValue(), }); + channel->Send( + encoded_api_arguments, + [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* return_value = + std::get_if(&encodable_return_value); + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::EchoNullableMap(const EncodableMap* a_map_arg, std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableMap", &GetCodec()); +void FlutterIntegrationCoreApi::EchoNullableMap( + const EncodableMap* a_map_arg, + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableMap", + &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_map_arg ? EncodableValue(*a_map_arg) : EncodableValue(), - }); - channel->Send(encoded_api_arguments, [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* return_value = std::get_if(&encodable_return_value); - on_success(return_value); + a_map_arg ? EncodableValue(*a_map_arg) : EncodableValue(), }); + channel->Send( + encoded_api_arguments, + [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* return_value = + std::get_if(&encodable_return_value); + on_success(return_value); + }); } -void FlutterIntegrationCoreApi::NoopAsync(std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync", &GetCodec()); +void FlutterIntegrationCoreApi::NoopAsync( + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync", &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(); - channel->Send(encoded_api_arguments, [on_success = std::move(on_success), on_error = std::move(on_error)](const uint8_t* reply, size_t reply_size) { - on_success(); - }); + channel->Send( + encoded_api_arguments, + [on_success = std::move(on_success), on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { on_success(); }); } -void FlutterIntegrationCoreApi::EchoAsyncString(const std::string& a_string_arg, std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString", &GetCodec()); +void FlutterIntegrationCoreApi::EchoAsyncString( + const std::string& a_string_arg, + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, + "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString", + &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_string_arg), - }); - channel->Send(encoded_api_arguments, [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& return_value = std::get(encodable_return_value); - on_success(return_value); + EncodableValue(a_string_arg), }); + channel->Send( + encoded_api_arguments, + [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& return_value = + std::get(encodable_return_value); + on_success(return_value); + }); } /// The codec used by HostTrivialApi. const flutter::StandardMessageCodec& HostTrivialApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance(&flutter::StandardCodecSerializer::GetInstance()); -} - -// Sets up an instance of `HostTrivialApi` to handle messages through the `binary_messenger`. -void HostTrivialApi::SetUp(flutter::BinaryMessenger* binary_messenger, HostTrivialApi* api) { - { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostTrivialApi.noop", &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())); - } - }); + return flutter::StandardMessageCodec::GetInstance( + &flutter::StandardCodecSerializer::GetInstance()); +} + +// Sets up an instance of `HostTrivialApi` to handle messages through the +// `binary_messenger`. +void HostTrivialApi::SetUp(flutter::BinaryMessenger* binary_messenger, + HostTrivialApi* api) { + { + auto channel = std::make_unique>( + binary_messenger, "dev.flutter.pigeon.HostTrivialApi.noop", + &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); } @@ -2520,74 +3480,82 @@ void HostTrivialApi::SetUp(flutter::BinaryMessenger* binary_messenger, HostTrivi } 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.message()), - EncodableValue(error.code()), - error.details() - }); + return EncodableValue(EncodableList{EncodableValue(error.message()), + EncodableValue(error.code()), + error.details()}); } /// The codec used by HostSmallApi. const flutter::StandardMessageCodec& HostSmallApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance(&flutter::StandardCodecSerializer::GetInstance()); -} - -// Sets up an instance of `HostSmallApi` to handle messages through the `binary_messenger`. -void HostSmallApi::SetUp(flutter::BinaryMessenger* binary_messenger, HostSmallApi* api) { - { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostSmallApi.echo", &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())); - } - }); + return flutter::StandardMessageCodec::GetInstance( + &flutter::StandardCodecSerializer::GetInstance()); +} + +// Sets up an instance of `HostSmallApi` to handle messages through the +// `binary_messenger`. +void HostSmallApi::SetUp(flutter::BinaryMessenger* binary_messenger, + HostSmallApi* api) { + { + auto channel = std::make_unique>( + binary_messenger, "dev.flutter.pigeon.HostSmallApi.echo", &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())); + } + }); } else { channel->SetMessageHandler(nullptr); } } { - auto channel = std::make_unique>(binary_messenger, "dev.flutter.pigeon.HostSmallApi.voidVoid", &GetCodec()); + auto channel = std::make_unique>( + binary_messenger, "dev.flutter.pigeon.HostSmallApi.voidVoid", + &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); } @@ -2595,61 +3563,75 @@ void HostSmallApi::SetUp(flutter::BinaryMessenger* binary_messenger, HostSmallAp } 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.message()), - EncodableValue(error.code()), - error.details() - }); + return EncodableValue(EncodableList{EncodableValue(error.message()), + EncodableValue(error.code()), + error.details()}); } - FlutterSmallApiCodecSerializer::FlutterSmallApiCodecSerializer() {} -EncodableValue FlutterSmallApiCodecSerializer::ReadValueOfType(uint8_t type, flutter::ByteStreamReader* stream) const { +EncodableValue FlutterSmallApiCodecSerializer::ReadValueOfType( + uint8_t type, flutter::ByteStreamReader* stream) const { switch (type) { case 128: - return CustomEncodableValue(TestMessage(std::get(ReadValue(stream)))); + return CustomEncodableValue( + TestMessage(std::get(ReadValue(stream)))); default: return flutter::StandardCodecSerializer::ReadValueOfType(type, stream); } } -void FlutterSmallApiCodecSerializer::WriteValue(const EncodableValue& value, flutter::ByteStreamWriter* stream) const { - if (const CustomEncodableValue* custom_value = std::get_if(&value)) { +void FlutterSmallApiCodecSerializer::WriteValue( + const EncodableValue& value, flutter::ByteStreamWriter* stream) const { + if (const CustomEncodableValue* custom_value = + std::get_if(&value)) { if (custom_value->type() == typeid(TestMessage)) { stream->WriteByte(128); - WriteValue(EncodableValue(std::any_cast(*custom_value).ToEncodableList()), stream); + WriteValue( + EncodableValue( + std::any_cast(*custom_value).ToEncodableList()), + stream); return; } } flutter::StandardCodecSerializer::WriteValue(value, stream); } -// 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) { this->binary_messenger_ = binary_messenger; } const flutter::StandardMessageCodec& FlutterSmallApi::GetCodec() { - return flutter::StandardMessageCodec::GetInstance(&FlutterSmallApiCodecSerializer::GetInstance()); + return flutter::StandardMessageCodec::GetInstance( + &FlutterSmallApiCodecSerializer::GetInstance()); } -void FlutterSmallApi::EchoWrappedList(const TestMessage& msg_arg, std::function&& on_success, std::function&& on_error) { - auto channel = std::make_unique>(binary_messenger_, "dev.flutter.pigeon.FlutterSmallApi.echoWrappedList", &GetCodec()); +void FlutterSmallApi::EchoWrappedList( + const TestMessage& msg_arg, + std::function&& on_success, + std::function&& on_error) { + auto channel = std::make_unique>( + binary_messenger_, "dev.flutter.pigeon.FlutterSmallApi.echoWrappedList", + &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(msg_arg.ToEncodableList()), - }); - channel->Send(encoded_api_arguments, [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& return_value = std::any_cast(std::get(encodable_return_value)); - on_success(return_value); + EncodableValue(msg_arg.ToEncodableList()), }); + channel->Send( + encoded_api_arguments, + [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& return_value = std::any_cast( + std::get(encodable_return_value)); + on_success(return_value); + }); } } // 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 a3315830459..513bae6682f 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 @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// +// // Autogenerated from Pigeon (v9.0.0), do not edit directly. // See also: https://pub.dev/packages/pigeon @@ -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,13 +41,12 @@ class FlutterError { flutter::EncodableValue details_; }; -template class ErrorOr { +template +class ErrorOr { public: - ErrorOr(const T& rhs) { new(&v_) T(rhs); } + ErrorOr(const T& rhs) { new (&v_) T(rhs); } ErrorOr(const T&& rhs) { v_ = std::move(rhs); } - ErrorOr(const FlutterError& rhs) { - new(&v_) FlutterError(rhs); - } + ErrorOr(const FlutterError& rhs) { new (&v_) FlutterError(rhs); } ErrorOr(const FlutterError&& rhs) { v_ = std::move(rhs); } bool has_error() const { return std::holds_alternative(v_); } @@ -66,12 +65,7 @@ template class ErrorOr { std::variant v_; }; - -enum class AnEnum { - one = 0, - two = 1, - three = 2 -}; +enum class AnEnum { one = 0, two = 1, three = 2 }; // Generated class from Pigeon that represents data sent in messages. class AllTypes { @@ -110,7 +104,6 @@ class AllTypes { const std::string& a_string() const; void set_a_string(std::string_view value_arg); - private: AllTypes(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -136,10 +129,8 @@ class AllTypes { flutter::EncodableMap a_map_; AnEnum an_enum_; std::string a_string_; - }; - // Generated class from Pigeon that represents data sent in messages. class AllNullableTypes { public: @@ -185,8 +176,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); @@ -200,7 +193,6 @@ class AllNullableTypes { void set_a_nullable_string(const std::string_view* value_arg); void set_a_nullable_string(std::string_view value_arg); - private: AllNullableTypes(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -230,10 +222,8 @@ class AllNullableTypes { std::optional nullable_map_with_object_; std::optional a_nullable_enum_; std::optional a_nullable_string_; - }; - // Generated class from Pigeon that represents data sent in messages. class AllNullableTypesWrapper { public: @@ -241,7 +231,6 @@ class AllNullableTypesWrapper { const AllNullableTypes& values() const; void set_values(const AllNullableTypes& value_arg); - private: AllNullableTypesWrapper(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -257,10 +246,8 @@ class AllNullableTypesWrapper { friend class FlutterSmallApiCodecSerializer; friend class CoreTestsTest; AllNullableTypes values_; - }; - // A data class containing a List, used in unit tests. // // Generated class from Pigeon that represents data sent in messages. @@ -271,7 +258,6 @@ class TestMessage { void set_test_list(const flutter::EncodableList* value_arg); void set_test_list(const flutter::EncodableList& value_arg); - private: TestMessage(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -287,12 +273,11 @@ class TestMessage { friend class FlutterSmallApiCodecSerializer; friend class CoreTestsTest; std::optional test_list_; - }; -class HostIntegrationCoreApiCodecSerializer : public flutter::StandardCodecSerializer { +class HostIntegrationCoreApiCodecSerializer + : public flutter::StandardCodecSerializer { public: - inline static HostIntegrationCoreApiCodecSerializer& GetInstance() { static HostIntegrationCoreApiCodecSerializer sInstance; return sInstance; @@ -301,17 +286,19 @@ class HostIntegrationCoreApiCodecSerializer : public flutter::StandardCodecSeria HostIntegrationCoreApiCodecSerializer(); public: - 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; - + flutter::EncodableValue ReadValueOfType( + 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; @@ -335,116 +322,219 @@ 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& a_list) = 0; + virtual ErrorOr EchoList( + const flutter::EncodableList& a_list) = 0; // Returns the passed map, to test serialization and deserialization. - virtual ErrorOr EchoMap(const flutter::EncodableMap& a_map) = 0; + virtual ErrorOr EchoMap( + const flutter::EncodableMap& a_map) = 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 inner `aString` value from the wrapped object, to test // sending of nested objects. - virtual ErrorOr> ExtractNestedNullableString(const AllNullableTypesWrapper& wrapper) = 0; + virtual ErrorOr> ExtractNestedNullableString( + const AllNullableTypesWrapper& 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; + virtual ErrorOr SendMultipleNullableTypes( + 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> EchoNullableMap( + const flutter::EncodableMap* a_nullable_map) = 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; + virtual void EchoAsyncInt( + 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; + virtual void EchoAsyncDouble( + 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; + virtual void EchoAsyncBool( + 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; + virtual void EchoAsyncString( + 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; + virtual void EchoAsyncUint8List( + 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 serialization and deserialization asynchronously. - virtual void EchoAsyncList(const flutter::EncodableList& a_list, std::function reply)> result) = 0; - // Returns the passed map, to test serialization and deserialization asynchronously. - virtual void EchoAsyncMap(const flutter::EncodableMap& a_map, std::function reply)> result) = 0; + virtual void EchoAsyncObject( + const flutter::EncodableValue& an_object, + std::function reply)> result) = 0; + // Returns the passed list, to test serialization and deserialization + // asynchronously. + virtual void EchoAsyncList( + const flutter::EncodableList& a_list, + std::function reply)> result) = 0; + // Returns the passed map, to test serialization and deserialization + // asynchronously. + virtual void EchoAsyncMap( + const flutter::EncodableMap& a_map, + 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; // Returns the passed object, to test async serialization and deserialization. - virtual void EchoAsyncAllTypes(const AllTypes& everything, std::function reply)> result) = 0; + virtual void EchoAsyncAllTypes( + 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; + virtual void EchoAsyncNullableAllNullableTypes( + const AllNullableTypes* everything, + std::function> reply)> + result) = 0; // Returns passed in int asynchronously. - virtual void EchoAsyncNullableInt(const int64_t* an_int, std::function> reply)> result) = 0; + virtual void EchoAsyncNullableInt( + 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; + virtual void EchoAsyncNullableDouble( + 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; + virtual void EchoAsyncNullableBool( + 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; + virtual void EchoAsyncNullableString( + 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; + virtual void EchoAsyncNullableUint8List( + 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 serialization and deserialization asynchronously. - virtual void EchoAsyncNullableList(const flutter::EncodableList* a_list, std::function> reply)> result) = 0; - // Returns the passed map, to test serialization and deserialization asynchronously. - virtual void EchoAsyncNullableMap(const flutter::EncodableMap* a_map, 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; - 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; - virtual void CallFlutterEchoBool(bool a_bool, std::function reply)> result) = 0; - virtual void CallFlutterEchoInt(int64_t an_int, std::function reply)> result) = 0; - virtual void CallFlutterEchoDouble(double a_double, std::function reply)> result) = 0; - virtual void CallFlutterEchoString(const std::string& a_string, std::function reply)> result) = 0; - virtual void CallFlutterEchoUint8List(const std::vector& a_list, std::function> reply)> result) = 0; - virtual void CallFlutterEchoList(const flutter::EncodableList& a_list, std::function reply)> result) = 0; - virtual void CallFlutterEchoMap(const flutter::EncodableMap& a_map, std::function reply)> result) = 0; - virtual void CallFlutterEchoNullableBool(const bool* a_bool, std::function> reply)> result) = 0; - virtual void CallFlutterEchoNullableInt(const int64_t* an_int, std::function> reply)> result) = 0; - virtual void CallFlutterEchoNullableDouble(const double* a_double, std::function> reply)> result) = 0; - virtual void CallFlutterEchoNullableString(const std::string* a_string, std::function> reply)> result) = 0; - virtual void CallFlutterEchoNullableUint8List(const std::vector* a_list, std::function>> reply)> result) = 0; - virtual void CallFlutterEchoNullableList(const flutter::EncodableList* a_list, std::function> reply)> result) = 0; - virtual void CallFlutterEchoNullableMap(const flutter::EncodableMap* a_map, std::function> reply)> result) = 0; + virtual void EchoAsyncNullableObject( + const flutter::EncodableValue* an_object, + std::function> reply)> + result) = 0; + // Returns the passed list, to test serialization and deserialization + // asynchronously. + virtual void EchoAsyncNullableList( + const flutter::EncodableList* a_list, + std::function> reply)> + result) = 0; + // Returns the passed map, to test serialization and deserialization + // asynchronously. + virtual void EchoAsyncNullableMap( + const flutter::EncodableMap* a_map, + 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; + 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; + virtual void CallFlutterEchoBool( + bool a_bool, std::function reply)> result) = 0; + virtual void CallFlutterEchoInt( + int64_t an_int, std::function reply)> result) = 0; + virtual void CallFlutterEchoDouble( + double a_double, std::function reply)> result) = 0; + virtual void CallFlutterEchoString( + const std::string& a_string, + std::function reply)> result) = 0; + virtual void CallFlutterEchoUint8List( + const std::vector& a_list, + std::function> reply)> result) = 0; + virtual void CallFlutterEchoList( + const flutter::EncodableList& a_list, + std::function reply)> result) = 0; + virtual void CallFlutterEchoMap( + const flutter::EncodableMap& a_map, + std::function reply)> result) = 0; + virtual void CallFlutterEchoNullableBool( + const bool* a_bool, + std::function> reply)> result) = 0; + virtual void CallFlutterEchoNullableInt( + const int64_t* an_int, + std::function> reply)> result) = 0; + virtual void CallFlutterEchoNullableDouble( + const double* a_double, + std::function> reply)> result) = 0; + virtual void CallFlutterEchoNullableString( + const std::string* a_string, + std::function> reply)> + result) = 0; + virtual void CallFlutterEchoNullableUint8List( + const std::vector* a_list, + std::function>> reply)> + result) = 0; + virtual void CallFlutterEchoNullableList( + const flutter::EncodableList* a_list, + std::function> reply)> + result) = 0; + virtual void CallFlutterEchoNullableMap( + const flutter::EncodableMap* a_map, + 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); + // Sets up an instance of `HostIntegrationCoreApi` to handle messages through + // the `binary_messenger`. + static void SetUp(flutter::BinaryMessenger* binary_messenger, + HostIntegrationCoreApi* api); static flutter::EncodableValue WrapError(std::string_view error_message); static flutter::EncodableValue WrapError(const FlutterError& error); protected: HostIntegrationCoreApi() = default; - }; -class FlutterIntegrationCoreApiCodecSerializer : public flutter::StandardCodecSerializer { +class FlutterIntegrationCoreApiCodecSerializer + : public flutter::StandardCodecSerializer { public: - inline static FlutterIntegrationCoreApiCodecSerializer& GetInstance() { static FlutterIntegrationCoreApiCodecSerializer sInstance; return sInstance; @@ -453,17 +543,19 @@ class FlutterIntegrationCoreApiCodecSerializer : public flutter::StandardCodecSe FlutterIntegrationCoreApiCodecSerializer(); public: - 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; - + flutter::EncodableValue ReadValueOfType( + uint8_t type, flutter::ByteStreamReader* stream) const override; }; // 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 { private: flutter::BinaryMessenger* binary_messenger_; @@ -473,58 +565,103 @@ class FlutterIntegrationCoreApi { 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); + void ThrowError( + 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); + void EchoAllNullableTypes( + 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); + 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); // 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& a_list, std::function&)>&& on_success, std::function&& on_error); + void EchoUint8List( + const std::vector& a_list, + std::function&)>&& on_success, + std::function&& on_error); // Returns the passed list, to test serialization and deserialization. - void EchoList(const flutter::EncodableList& a_list, std::function&& on_success, std::function&& on_error); + void EchoList(const flutter::EncodableList& a_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 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* a_list, std::function*)>&& on_success, std::function&& on_error); + void EchoNullableUint8List( + const std::vector* a_list, + std::function*)>&& on_success, + std::function&& on_error); // Returns the passed list, to test serialization and deserialization. - void EchoNullableList(const flutter::EncodableList* a_list, std::function&& on_success, std::function&& on_error); + void EchoNullableList( + const flutter::EncodableList* a_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); + void EchoNullableMap( + const flutter::EncodableMap* a_map, + 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); }; // 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; @@ -534,40 +671,44 @@ 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); + // Sets up an instance of `HostTrivialApi` to handle messages through the + // `binary_messenger`. + static void SetUp(flutter::BinaryMessenger* binary_messenger, + HostTrivialApi* api); 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); + // Sets up an instance of `HostSmallApi` to handle messages through the + // `binary_messenger`. + static void SetUp(flutter::BinaryMessenger* binary_messenger, + HostSmallApi* api); static flutter::EncodableValue WrapError(std::string_view error_message); static flutter::EncodableValue WrapError(const FlutterError& error); protected: HostSmallApi() = default; - }; class FlutterSmallApiCodecSerializer : public flutter::StandardCodecSerializer { public: - inline static FlutterSmallApiCodecSerializer& GetInstance() { static FlutterSmallApiCodecSerializer sInstance; return sInstance; @@ -576,16 +717,18 @@ class FlutterSmallApiCodecSerializer : public flutter::StandardCodecSerializer { FlutterSmallApiCodecSerializer(); public: - 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; - + flutter::EncodableValue ReadValueOfType( + uint8_t type, flutter::ByteStreamReader* stream) const override; }; // 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 { private: flutter::BinaryMessenger* binary_messenger_; @@ -593,8 +736,9 @@ class FlutterSmallApi { public: FlutterSmallApi(flutter::BinaryMessenger* binary_messenger); static const flutter::StandardMessageCodec& GetCodec(); - void EchoWrappedList(const TestMessage& msg, std::function&& on_success, std::function&& on_error); - + void EchoWrappedList(const TestMessage& msg, + std::function&& on_success, + std::function&& on_error); }; } // namespace core_tests_pigeontest From c42e7d8aed0777f43fa399a3f16779ca1d2003c3 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Thu, 16 Feb 2023 12:58:29 -0500 Subject: [PATCH 10/10] Remove build references on Windows --- .../test_plugin/windows/CMakeLists.txt | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/packages/pigeon/platform_tests/test_plugin/windows/CMakeLists.txt b/packages/pigeon/platform_tests/test_plugin/windows/CMakeLists.txt index 97c0e7e4c96..4e41dd7f3c9 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/CMakeLists.txt +++ b/packages/pigeon/platform_tests/test_plugin/windows/CMakeLists.txt @@ -17,16 +17,10 @@ list(APPEND PLUGIN_SOURCES "test_plugin.cpp" "test_plugin.h" # Generated sources. - "pigeon/async_handlers.gen.cpp" - "pigeon/async_handlers.gen.h" "pigeon/core_tests.gen.cpp" "pigeon/core_tests.gen.h" "pigeon/enum.gen.cpp" "pigeon/enum.gen.h" - "pigeon/host2flutter.gen.cpp" - "pigeon/host2flutter.gen.h" - "pigeon/list.gen.cpp" - "pigeon/list.gen.h" "pigeon/message.gen.cpp" "pigeon/message.gen.h" "pigeon/multiple_arity.gen.cpp" @@ -39,14 +33,6 @@ list(APPEND PLUGIN_SOURCES "pigeon/nullable_returns.gen.h" "pigeon/primitive.gen.cpp" "pigeon/primitive.gen.h" - "pigeon/void_arg_flutter.gen.cpp" - "pigeon/void_arg_flutter.gen.h" - "pigeon/void_arg_host.gen.cpp" - "pigeon/void_arg_host.gen.h" - "pigeon/voidflutter.gen.cpp" - "pigeon/voidflutter.gen.h" - "pigeon/voidhost.gen.cpp" - "pigeon/voidhost.gen.h" ) # Define the plugin library target. Its name must not be changed (see comment